aws_sdk_evidently/operation/update_experiment/
_update_experiment_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 UpdateExperimentInput {
6    /// <p>The name or ARN of the project that contains the experiment that you want to update.</p>
7    pub project: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the experiment to update.</p>
9    pub experiment: ::std::option::Option<::std::string::String>,
10    /// <p>An optional description of the experiment.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>An array of structures that define the variations being tested in the experiment.</p>
13    pub treatments: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentConfig>>,
14    /// <p>An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.</p>
15    pub metric_goals: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoalConfig>>,
16    /// <p>When Evidently assigns a particular user session to an experiment, 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 experiment name as the <code>randomizationSalt</code>.</p>
17    pub randomization_salt: ::std::option::Option<::std::string::String>,
18    /// <p>The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
19    /// <p>This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.</p>
20    pub sampling_rate: ::std::option::Option<i64>,
21    /// <p>Adds an audience <i>segment</i> to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.</p>
22    pub segment: ::std::option::Option<::std::string::String>,
23    /// <p>Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.</p>
24    pub remove_segment: ::std::option::Option<bool>,
25    /// <p>A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.</p>
26    pub online_ab_config: ::std::option::Option<crate::types::OnlineAbConfig>,
27}
28impl UpdateExperimentInput {
29    /// <p>The name or ARN of the project that contains the experiment that you want to update.</p>
30    pub fn project(&self) -> ::std::option::Option<&str> {
31        self.project.as_deref()
32    }
33    /// <p>The name of the experiment to update.</p>
34    pub fn experiment(&self) -> ::std::option::Option<&str> {
35        self.experiment.as_deref()
36    }
37    /// <p>An optional description of the experiment.</p>
38    pub fn description(&self) -> ::std::option::Option<&str> {
39        self.description.as_deref()
40    }
41    /// <p>An array of structures that define the variations being tested in the experiment.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.treatments.is_none()`.
44    pub fn treatments(&self) -> &[crate::types::TreatmentConfig] {
45        self.treatments.as_deref().unwrap_or_default()
46    }
47    /// <p>An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.</p>
48    ///
49    /// 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_goals.is_none()`.
50    pub fn metric_goals(&self) -> &[crate::types::MetricGoalConfig] {
51        self.metric_goals.as_deref().unwrap_or_default()
52    }
53    /// <p>When Evidently assigns a particular user session to an experiment, 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 experiment name as the <code>randomizationSalt</code>.</p>
54    pub fn randomization_salt(&self) -> ::std::option::Option<&str> {
55        self.randomization_salt.as_deref()
56    }
57    /// <p>The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
58    /// <p>This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.</p>
59    pub fn sampling_rate(&self) -> ::std::option::Option<i64> {
60        self.sampling_rate
61    }
62    /// <p>Adds an audience <i>segment</i> to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.</p>
63    pub fn segment(&self) -> ::std::option::Option<&str> {
64        self.segment.as_deref()
65    }
66    /// <p>Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.</p>
67    pub fn remove_segment(&self) -> ::std::option::Option<bool> {
68        self.remove_segment
69    }
70    /// <p>A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.</p>
71    pub fn online_ab_config(&self) -> ::std::option::Option<&crate::types::OnlineAbConfig> {
72        self.online_ab_config.as_ref()
73    }
74}
75impl UpdateExperimentInput {
76    /// Creates a new builder-style object to manufacture [`UpdateExperimentInput`](crate::operation::update_experiment::UpdateExperimentInput).
77    pub fn builder() -> crate::operation::update_experiment::builders::UpdateExperimentInputBuilder {
78        crate::operation::update_experiment::builders::UpdateExperimentInputBuilder::default()
79    }
80}
81
82/// A builder for [`UpdateExperimentInput`](crate::operation::update_experiment::UpdateExperimentInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct UpdateExperimentInputBuilder {
86    pub(crate) project: ::std::option::Option<::std::string::String>,
87    pub(crate) experiment: ::std::option::Option<::std::string::String>,
88    pub(crate) description: ::std::option::Option<::std::string::String>,
89    pub(crate) treatments: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentConfig>>,
90    pub(crate) metric_goals: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoalConfig>>,
91    pub(crate) randomization_salt: ::std::option::Option<::std::string::String>,
92    pub(crate) sampling_rate: ::std::option::Option<i64>,
93    pub(crate) segment: ::std::option::Option<::std::string::String>,
94    pub(crate) remove_segment: ::std::option::Option<bool>,
95    pub(crate) online_ab_config: ::std::option::Option<crate::types::OnlineAbConfig>,
96}
97impl UpdateExperimentInputBuilder {
98    /// <p>The name or ARN of the project that contains the experiment that you want to update.</p>
99    /// This field is required.
100    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.project = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The name or ARN of the project that contains the experiment that you want to update.</p>
105    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.project = input;
107        self
108    }
109    /// <p>The name or ARN of the project that contains the experiment that you want to update.</p>
110    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
111        &self.project
112    }
113    /// <p>The name of the experiment to update.</p>
114    /// This field is required.
115    pub fn experiment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.experiment = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The name of the experiment to update.</p>
120    pub fn set_experiment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.experiment = input;
122        self
123    }
124    /// <p>The name of the experiment to update.</p>
125    pub fn get_experiment(&self) -> &::std::option::Option<::std::string::String> {
126        &self.experiment
127    }
128    /// <p>An optional description of the experiment.</p>
129    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.description = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>An optional description of the experiment.</p>
134    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.description = input;
136        self
137    }
138    /// <p>An optional description of the experiment.</p>
139    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
140        &self.description
141    }
142    /// Appends an item to `treatments`.
143    ///
144    /// To override the contents of this collection use [`set_treatments`](Self::set_treatments).
145    ///
146    /// <p>An array of structures that define the variations being tested in the experiment.</p>
147    pub fn treatments(mut self, input: crate::types::TreatmentConfig) -> Self {
148        let mut v = self.treatments.unwrap_or_default();
149        v.push(input);
150        self.treatments = ::std::option::Option::Some(v);
151        self
152    }
153    /// <p>An array of structures that define the variations being tested in the experiment.</p>
154    pub fn set_treatments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TreatmentConfig>>) -> Self {
155        self.treatments = input;
156        self
157    }
158    /// <p>An array of structures that define the variations being tested in the experiment.</p>
159    pub fn get_treatments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TreatmentConfig>> {
160        &self.treatments
161    }
162    /// Appends an item to `metric_goals`.
163    ///
164    /// To override the contents of this collection use [`set_metric_goals`](Self::set_metric_goals).
165    ///
166    /// <p>An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.</p>
167    pub fn metric_goals(mut self, input: crate::types::MetricGoalConfig) -> Self {
168        let mut v = self.metric_goals.unwrap_or_default();
169        v.push(input);
170        self.metric_goals = ::std::option::Option::Some(v);
171        self
172    }
173    /// <p>An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.</p>
174    pub fn set_metric_goals(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoalConfig>>) -> Self {
175        self.metric_goals = input;
176        self
177    }
178    /// <p>An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.</p>
179    pub fn get_metric_goals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricGoalConfig>> {
180        &self.metric_goals
181    }
182    /// <p>When Evidently assigns a particular user session to an experiment, 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 experiment name as the <code>randomizationSalt</code>.</p>
183    pub fn randomization_salt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.randomization_salt = ::std::option::Option::Some(input.into());
185        self
186    }
187    /// <p>When Evidently assigns a particular user session to an experiment, 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 experiment name as the <code>randomizationSalt</code>.</p>
188    pub fn set_randomization_salt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.randomization_salt = input;
190        self
191    }
192    /// <p>When Evidently assigns a particular user session to an experiment, 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 experiment name as the <code>randomizationSalt</code>.</p>
193    pub fn get_randomization_salt(&self) -> &::std::option::Option<::std::string::String> {
194        &self.randomization_salt
195    }
196    /// <p>The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
197    /// <p>This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.</p>
198    pub fn sampling_rate(mut self, input: i64) -> Self {
199        self.sampling_rate = ::std::option::Option::Some(input);
200        self
201    }
202    /// <p>The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
203    /// <p>This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.</p>
204    pub fn set_sampling_rate(mut self, input: ::std::option::Option<i64>) -> Self {
205        self.sampling_rate = input;
206        self
207    }
208    /// <p>The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
209    /// <p>This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.</p>
210    pub fn get_sampling_rate(&self) -> &::std::option::Option<i64> {
211        &self.sampling_rate
212    }
213    /// <p>Adds an audience <i>segment</i> to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.</p>
214    pub fn segment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.segment = ::std::option::Option::Some(input.into());
216        self
217    }
218    /// <p>Adds an audience <i>segment</i> to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.</p>
219    pub fn set_segment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220        self.segment = input;
221        self
222    }
223    /// <p>Adds an audience <i>segment</i> to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.</p>
224    pub fn get_segment(&self) -> &::std::option::Option<::std::string::String> {
225        &self.segment
226    }
227    /// <p>Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.</p>
228    pub fn remove_segment(mut self, input: bool) -> Self {
229        self.remove_segment = ::std::option::Option::Some(input);
230        self
231    }
232    /// <p>Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.</p>
233    pub fn set_remove_segment(mut self, input: ::std::option::Option<bool>) -> Self {
234        self.remove_segment = input;
235        self
236    }
237    /// <p>Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.</p>
238    pub fn get_remove_segment(&self) -> &::std::option::Option<bool> {
239        &self.remove_segment
240    }
241    /// <p>A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.</p>
242    pub fn online_ab_config(mut self, input: crate::types::OnlineAbConfig) -> Self {
243        self.online_ab_config = ::std::option::Option::Some(input);
244        self
245    }
246    /// <p>A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.</p>
247    pub fn set_online_ab_config(mut self, input: ::std::option::Option<crate::types::OnlineAbConfig>) -> Self {
248        self.online_ab_config = input;
249        self
250    }
251    /// <p>A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.</p>
252    pub fn get_online_ab_config(&self) -> &::std::option::Option<crate::types::OnlineAbConfig> {
253        &self.online_ab_config
254    }
255    /// Consumes the builder and constructs a [`UpdateExperimentInput`](crate::operation::update_experiment::UpdateExperimentInput).
256    pub fn build(
257        self,
258    ) -> ::std::result::Result<crate::operation::update_experiment::UpdateExperimentInput, ::aws_smithy_types::error::operation::BuildError> {
259        ::std::result::Result::Ok(crate::operation::update_experiment::UpdateExperimentInput {
260            project: self.project,
261            experiment: self.experiment,
262            description: self.description,
263            treatments: self.treatments,
264            metric_goals: self.metric_goals,
265            randomization_salt: self.randomization_salt,
266            sampling_rate: self.sampling_rate,
267            segment: self.segment,
268            remove_segment: self.remove_segment,
269            online_ab_config: self.online_ab_config,
270        })
271    }
272}