aws_sdk_evidently/operation/create_launch/
_create_launch_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 CreateLaunchInput {
6    /// <p>The name or ARN of the project that you want to create the launch in.</p>
7    pub project: ::std::option::Option<::std::string::String>,
8    /// <p>The name for the new launch.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>An optional description for the launch.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
13    pub scheduled_splits_config: ::std::option::Option<crate::types::ScheduledSplitsLaunchConfig>,
14    /// <p>An array of structures that define the metrics that will be used to monitor the launch performance.</p>
15    pub metric_monitors: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitorConfig>>,
16    /// <p>An array of structures that contains the feature and variations that are to be used for the launch.</p>
17    pub groups: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroupConfig>>,
18    /// <p>When Evidently assigns a particular user session to a launch, it must use 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>. If you omit <code>randomizationSalt</code>, Evidently uses the launch name as the <code>randomizationSalt</code>.</p>
19    pub randomization_salt: ::std::option::Option<::std::string::String>,
20    /// <p>Assigns one or more tags (key-value pairs) to the launch.</p>
21    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
22    /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
23    /// <p>You can associate as many as 50 tags with a launch.</p>
24    /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
25    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26}
27impl CreateLaunchInput {
28    /// <p>The name or ARN of the project that you want to create the launch in.</p>
29    pub fn project(&self) -> ::std::option::Option<&str> {
30        self.project.as_deref()
31    }
32    /// <p>The name for the new launch.</p>
33    pub fn name(&self) -> ::std::option::Option<&str> {
34        self.name.as_deref()
35    }
36    /// <p>An optional description for the launch.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
41    pub fn scheduled_splits_config(&self) -> ::std::option::Option<&crate::types::ScheduledSplitsLaunchConfig> {
42        self.scheduled_splits_config.as_ref()
43    }
44    /// <p>An array of structures that define the metrics that will be used to monitor the launch performance.</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 `.metric_monitors.is_none()`.
47    pub fn metric_monitors(&self) -> &[crate::types::MetricMonitorConfig] {
48        self.metric_monitors.as_deref().unwrap_or_default()
49    }
50    /// <p>An array of structures that contains the feature and variations that are to be used for the launch.</p>
51    ///
52    /// 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()`.
53    pub fn groups(&self) -> &[crate::types::LaunchGroupConfig] {
54        self.groups.as_deref().unwrap_or_default()
55    }
56    /// <p>When Evidently assigns a particular user session to a launch, it must use 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>. If you omit <code>randomizationSalt</code>, Evidently uses the launch name as the <code>randomizationSalt</code>.</p>
57    pub fn randomization_salt(&self) -> ::std::option::Option<&str> {
58        self.randomization_salt.as_deref()
59    }
60    /// <p>Assigns one or more tags (key-value pairs) to the launch.</p>
61    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
62    /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
63    /// <p>You can associate as many as 50 tags with a launch.</p>
64    /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
65    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
66        self.tags.as_ref()
67    }
68}
69impl CreateLaunchInput {
70    /// Creates a new builder-style object to manufacture [`CreateLaunchInput`](crate::operation::create_launch::CreateLaunchInput).
71    pub fn builder() -> crate::operation::create_launch::builders::CreateLaunchInputBuilder {
72        crate::operation::create_launch::builders::CreateLaunchInputBuilder::default()
73    }
74}
75
76/// A builder for [`CreateLaunchInput`](crate::operation::create_launch::CreateLaunchInput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct CreateLaunchInputBuilder {
80    pub(crate) project: ::std::option::Option<::std::string::String>,
81    pub(crate) name: ::std::option::Option<::std::string::String>,
82    pub(crate) description: ::std::option::Option<::std::string::String>,
83    pub(crate) scheduled_splits_config: ::std::option::Option<crate::types::ScheduledSplitsLaunchConfig>,
84    pub(crate) metric_monitors: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitorConfig>>,
85    pub(crate) groups: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroupConfig>>,
86    pub(crate) randomization_salt: ::std::option::Option<::std::string::String>,
87    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
88}
89impl CreateLaunchInputBuilder {
90    /// <p>The name or ARN of the project that you want to create the launch in.</p>
91    /// This field is required.
92    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.project = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The name or ARN of the project that you want to create the launch in.</p>
97    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.project = input;
99        self
100    }
101    /// <p>The name or ARN of the project that you want to create the launch in.</p>
102    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
103        &self.project
104    }
105    /// <p>The name for the new launch.</p>
106    /// This field is required.
107    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.name = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The name for the new launch.</p>
112    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.name = input;
114        self
115    }
116    /// <p>The name for the new launch.</p>
117    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.name
119    }
120    /// <p>An optional description for the launch.</p>
121    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.description = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// <p>An optional description for the launch.</p>
126    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.description = input;
128        self
129    }
130    /// <p>An optional description for the launch.</p>
131    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
132        &self.description
133    }
134    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
135    pub fn scheduled_splits_config(mut self, input: crate::types::ScheduledSplitsLaunchConfig) -> Self {
136        self.scheduled_splits_config = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
140    pub fn set_scheduled_splits_config(mut self, input: ::std::option::Option<crate::types::ScheduledSplitsLaunchConfig>) -> Self {
141        self.scheduled_splits_config = input;
142        self
143    }
144    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
145    pub fn get_scheduled_splits_config(&self) -> &::std::option::Option<crate::types::ScheduledSplitsLaunchConfig> {
146        &self.scheduled_splits_config
147    }
148    /// Appends an item to `metric_monitors`.
149    ///
150    /// To override the contents of this collection use [`set_metric_monitors`](Self::set_metric_monitors).
151    ///
152    /// <p>An array of structures that define the metrics that will be used to monitor the launch performance.</p>
153    pub fn metric_monitors(mut self, input: crate::types::MetricMonitorConfig) -> Self {
154        let mut v = self.metric_monitors.unwrap_or_default();
155        v.push(input);
156        self.metric_monitors = ::std::option::Option::Some(v);
157        self
158    }
159    /// <p>An array of structures that define the metrics that will be used to monitor the launch performance.</p>
160    pub fn set_metric_monitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitorConfig>>) -> Self {
161        self.metric_monitors = input;
162        self
163    }
164    /// <p>An array of structures that define the metrics that will be used to monitor the launch performance.</p>
165    pub fn get_metric_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricMonitorConfig>> {
166        &self.metric_monitors
167    }
168    /// Appends an item to `groups`.
169    ///
170    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
171    ///
172    /// <p>An array of structures that contains the feature and variations that are to be used for the launch.</p>
173    pub fn groups(mut self, input: crate::types::LaunchGroupConfig) -> Self {
174        let mut v = self.groups.unwrap_or_default();
175        v.push(input);
176        self.groups = ::std::option::Option::Some(v);
177        self
178    }
179    /// <p>An array of structures that contains the feature and variations that are to be used for the launch.</p>
180    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroupConfig>>) -> Self {
181        self.groups = input;
182        self
183    }
184    /// <p>An array of structures that contains the feature and variations that are to be used for the launch.</p>
185    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LaunchGroupConfig>> {
186        &self.groups
187    }
188    /// <p>When Evidently assigns a particular user session to a launch, it must use 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>. If you omit <code>randomizationSalt</code>, Evidently uses the launch name as the <code>randomizationSalt</code>.</p>
189    pub fn randomization_salt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.randomization_salt = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>When Evidently assigns a particular user session to a launch, it must use 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>. If you omit <code>randomizationSalt</code>, Evidently uses the launch name as the <code>randomizationSalt</code>.</p>
194    pub fn set_randomization_salt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.randomization_salt = input;
196        self
197    }
198    /// <p>When Evidently assigns a particular user session to a launch, it must use 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>. If you omit <code>randomizationSalt</code>, Evidently uses the launch name as the <code>randomizationSalt</code>.</p>
199    pub fn get_randomization_salt(&self) -> &::std::option::Option<::std::string::String> {
200        &self.randomization_salt
201    }
202    /// Adds a key-value pair to `tags`.
203    ///
204    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
205    ///
206    /// <p>Assigns one or more tags (key-value pairs) to the launch.</p>
207    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
208    /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
209    /// <p>You can associate as many as 50 tags with a launch.</p>
210    /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
211    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
212        let mut hash_map = self.tags.unwrap_or_default();
213        hash_map.insert(k.into(), v.into());
214        self.tags = ::std::option::Option::Some(hash_map);
215        self
216    }
217    /// <p>Assigns one or more tags (key-value pairs) to the launch.</p>
218    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
219    /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
220    /// <p>You can associate as many as 50 tags with a launch.</p>
221    /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
222    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
223        self.tags = input;
224        self
225    }
226    /// <p>Assigns one or more tags (key-value pairs) to the launch.</p>
227    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
228    /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
229    /// <p>You can associate as many as 50 tags with a launch.</p>
230    /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
231    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
232        &self.tags
233    }
234    /// Consumes the builder and constructs a [`CreateLaunchInput`](crate::operation::create_launch::CreateLaunchInput).
235    pub fn build(
236        self,
237    ) -> ::std::result::Result<crate::operation::create_launch::CreateLaunchInput, ::aws_smithy_types::error::operation::BuildError> {
238        ::std::result::Result::Ok(crate::operation::create_launch::CreateLaunchInput {
239            project: self.project,
240            name: self.name,
241            description: self.description,
242            scheduled_splits_config: self.scheduled_splits_config,
243            metric_monitors: self.metric_monitors,
244            groups: self.groups,
245            randomization_salt: self.randomization_salt,
246            tags: self.tags,
247        })
248    }
249}