aws_sdk_evidently/types/_experiment.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure containing the configuration details of an experiment.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Experiment {
7 /// <p>The ARN of the experiment.</p>
8 pub arn: ::std::string::String,
9 /// <p>The name of the experiment.</p>
10 pub name: ::std::string::String,
11 /// <p>The name or ARN of the project that contains this experiment.</p>
12 pub project: ::std::option::Option<::std::string::String>,
13 /// <p>The current state of the experiment.</p>
14 pub status: crate::types::ExperimentStatus,
15 /// <p>If the experiment was stopped, this is the string that was entered by the person who stopped the experiment, to explain why it was stopped.</p>
16 pub status_reason: ::std::option::Option<::std::string::String>,
17 /// <p>A description of the experiment.</p>
18 pub description: ::std::option::Option<::std::string::String>,
19 /// <p>The date and time that the experiment is first created.</p>
20 pub created_time: ::aws_smithy_types::DateTime,
21 /// <p>The date and time that the experiment was most recently updated.</p>
22 pub last_updated_time: ::aws_smithy_types::DateTime,
23 /// <p>A structure that contains the time and date that Evidently completed the analysis of the experiment.</p>
24 pub schedule: ::std::option::Option<crate::types::ExperimentSchedule>,
25 /// <p>A structure that contains the date and time that the experiment started and ended.</p>
26 pub execution: ::std::option::Option<crate::types::ExperimentExecution>,
27 /// <p>An array of structures that describe the configuration of each feature variation used in the experiment.</p>
28 pub treatments: ::std::option::Option<::std::vec::Vec<crate::types::Treatment>>,
29 /// <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>
30 pub metric_goals: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoal>>,
31 /// <p>This value is used when Evidently assigns a particular user session to the experiment. It helps 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>
32 pub randomization_salt: ::std::option::Option<::std::string::String>,
33 /// <p>In thousandths of a percent, the amount of the available audience that is allocated to this experiment. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
34 /// <p>This is represented in thousandths of a percent, so a value of 10,000 is 10% of the available audience.</p>
35 pub sampling_rate: i64,
36 /// <p>The audience segment being used for the experiment, if a segment is being used.</p>
37 pub segment: ::std::option::Option<::std::string::String>,
38 /// <p>The type of this experiment. Currently, this value must be <code>aws.experiment.onlineab</code>.</p>
39 pub r#type: crate::types::ExperimentType,
40 /// <p>A structure that contains the configuration of which variation to 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>
41 pub online_ab_definition: ::std::option::Option<crate::types::OnlineAbDefinition>,
42 /// <p>The list of tag keys and values associated with this experiment.</p>
43 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
44}
45impl Experiment {
46 /// <p>The ARN of the experiment.</p>
47 pub fn arn(&self) -> &str {
48 use std::ops::Deref;
49 self.arn.deref()
50 }
51 /// <p>The name of the experiment.</p>
52 pub fn name(&self) -> &str {
53 use std::ops::Deref;
54 self.name.deref()
55 }
56 /// <p>The name or ARN of the project that contains this experiment.</p>
57 pub fn project(&self) -> ::std::option::Option<&str> {
58 self.project.as_deref()
59 }
60 /// <p>The current state of the experiment.</p>
61 pub fn status(&self) -> &crate::types::ExperimentStatus {
62 &self.status
63 }
64 /// <p>If the experiment was stopped, this is the string that was entered by the person who stopped the experiment, to explain why it was stopped.</p>
65 pub fn status_reason(&self) -> ::std::option::Option<&str> {
66 self.status_reason.as_deref()
67 }
68 /// <p>A description of the experiment.</p>
69 pub fn description(&self) -> ::std::option::Option<&str> {
70 self.description.as_deref()
71 }
72 /// <p>The date and time that the experiment is first created.</p>
73 pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
74 &self.created_time
75 }
76 /// <p>The date and time that the experiment was most recently updated.</p>
77 pub fn last_updated_time(&self) -> &::aws_smithy_types::DateTime {
78 &self.last_updated_time
79 }
80 /// <p>A structure that contains the time and date that Evidently completed the analysis of the experiment.</p>
81 pub fn schedule(&self) -> ::std::option::Option<&crate::types::ExperimentSchedule> {
82 self.schedule.as_ref()
83 }
84 /// <p>A structure that contains the date and time that the experiment started and ended.</p>
85 pub fn execution(&self) -> ::std::option::Option<&crate::types::ExperimentExecution> {
86 self.execution.as_ref()
87 }
88 /// <p>An array of structures that describe the configuration of each feature variation used in the experiment.</p>
89 ///
90 /// 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()`.
91 pub fn treatments(&self) -> &[crate::types::Treatment] {
92 self.treatments.as_deref().unwrap_or_default()
93 }
94 /// <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>
95 ///
96 /// 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()`.
97 pub fn metric_goals(&self) -> &[crate::types::MetricGoal] {
98 self.metric_goals.as_deref().unwrap_or_default()
99 }
100 /// <p>This value is used when Evidently assigns a particular user session to the experiment. It helps 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>
101 pub fn randomization_salt(&self) -> ::std::option::Option<&str> {
102 self.randomization_salt.as_deref()
103 }
104 /// <p>In thousandths of a percent, the amount of the available audience that is allocated to this experiment. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
105 /// <p>This is represented in thousandths of a percent, so a value of 10,000 is 10% of the available audience.</p>
106 pub fn sampling_rate(&self) -> i64 {
107 self.sampling_rate
108 }
109 /// <p>The audience segment being used for the experiment, if a segment is being used.</p>
110 pub fn segment(&self) -> ::std::option::Option<&str> {
111 self.segment.as_deref()
112 }
113 /// <p>The type of this experiment. Currently, this value must be <code>aws.experiment.onlineab</code>.</p>
114 pub fn r#type(&self) -> &crate::types::ExperimentType {
115 &self.r#type
116 }
117 /// <p>A structure that contains the configuration of which variation to 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>
118 pub fn online_ab_definition(&self) -> ::std::option::Option<&crate::types::OnlineAbDefinition> {
119 self.online_ab_definition.as_ref()
120 }
121 /// <p>The list of tag keys and values associated with this experiment.</p>
122 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
123 self.tags.as_ref()
124 }
125}
126impl Experiment {
127 /// Creates a new builder-style object to manufacture [`Experiment`](crate::types::Experiment).
128 pub fn builder() -> crate::types::builders::ExperimentBuilder {
129 crate::types::builders::ExperimentBuilder::default()
130 }
131}
132
133/// A builder for [`Experiment`](crate::types::Experiment).
134#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
135#[non_exhaustive]
136pub struct ExperimentBuilder {
137 pub(crate) arn: ::std::option::Option<::std::string::String>,
138 pub(crate) name: ::std::option::Option<::std::string::String>,
139 pub(crate) project: ::std::option::Option<::std::string::String>,
140 pub(crate) status: ::std::option::Option<crate::types::ExperimentStatus>,
141 pub(crate) status_reason: ::std::option::Option<::std::string::String>,
142 pub(crate) description: ::std::option::Option<::std::string::String>,
143 pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
144 pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
145 pub(crate) schedule: ::std::option::Option<crate::types::ExperimentSchedule>,
146 pub(crate) execution: ::std::option::Option<crate::types::ExperimentExecution>,
147 pub(crate) treatments: ::std::option::Option<::std::vec::Vec<crate::types::Treatment>>,
148 pub(crate) metric_goals: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoal>>,
149 pub(crate) randomization_salt: ::std::option::Option<::std::string::String>,
150 pub(crate) sampling_rate: ::std::option::Option<i64>,
151 pub(crate) segment: ::std::option::Option<::std::string::String>,
152 pub(crate) r#type: ::std::option::Option<crate::types::ExperimentType>,
153 pub(crate) online_ab_definition: ::std::option::Option<crate::types::OnlineAbDefinition>,
154 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
155}
156impl ExperimentBuilder {
157 /// <p>The ARN of the experiment.</p>
158 /// This field is required.
159 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.arn = ::std::option::Option::Some(input.into());
161 self
162 }
163 /// <p>The ARN of the experiment.</p>
164 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.arn = input;
166 self
167 }
168 /// <p>The ARN of the experiment.</p>
169 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
170 &self.arn
171 }
172 /// <p>The name of the experiment.</p>
173 /// This field is required.
174 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.name = ::std::option::Option::Some(input.into());
176 self
177 }
178 /// <p>The name of the experiment.</p>
179 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.name = input;
181 self
182 }
183 /// <p>The name of the experiment.</p>
184 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
185 &self.name
186 }
187 /// <p>The name or ARN of the project that contains this experiment.</p>
188 pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.project = ::std::option::Option::Some(input.into());
190 self
191 }
192 /// <p>The name or ARN of the project that contains this experiment.</p>
193 pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.project = input;
195 self
196 }
197 /// <p>The name or ARN of the project that contains this experiment.</p>
198 pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
199 &self.project
200 }
201 /// <p>The current state of the experiment.</p>
202 /// This field is required.
203 pub fn status(mut self, input: crate::types::ExperimentStatus) -> Self {
204 self.status = ::std::option::Option::Some(input);
205 self
206 }
207 /// <p>The current state of the experiment.</p>
208 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ExperimentStatus>) -> Self {
209 self.status = input;
210 self
211 }
212 /// <p>The current state of the experiment.</p>
213 pub fn get_status(&self) -> &::std::option::Option<crate::types::ExperimentStatus> {
214 &self.status
215 }
216 /// <p>If the experiment was stopped, this is the string that was entered by the person who stopped the experiment, to explain why it was stopped.</p>
217 pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.status_reason = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>If the experiment was stopped, this is the string that was entered by the person who stopped the experiment, to explain why it was stopped.</p>
222 pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.status_reason = input;
224 self
225 }
226 /// <p>If the experiment was stopped, this is the string that was entered by the person who stopped the experiment, to explain why it was stopped.</p>
227 pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
228 &self.status_reason
229 }
230 /// <p>A description of the experiment.</p>
231 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.description = ::std::option::Option::Some(input.into());
233 self
234 }
235 /// <p>A description of the experiment.</p>
236 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.description = input;
238 self
239 }
240 /// <p>A description of the experiment.</p>
241 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
242 &self.description
243 }
244 /// <p>The date and time that the experiment is first created.</p>
245 /// This field is required.
246 pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
247 self.created_time = ::std::option::Option::Some(input);
248 self
249 }
250 /// <p>The date and time that the experiment is first created.</p>
251 pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
252 self.created_time = input;
253 self
254 }
255 /// <p>The date and time that the experiment is first created.</p>
256 pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
257 &self.created_time
258 }
259 /// <p>The date and time that the experiment was most recently updated.</p>
260 /// This field is required.
261 pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
262 self.last_updated_time = ::std::option::Option::Some(input);
263 self
264 }
265 /// <p>The date and time that the experiment was most recently updated.</p>
266 pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
267 self.last_updated_time = input;
268 self
269 }
270 /// <p>The date and time that the experiment was most recently updated.</p>
271 pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
272 &self.last_updated_time
273 }
274 /// <p>A structure that contains the time and date that Evidently completed the analysis of the experiment.</p>
275 pub fn schedule(mut self, input: crate::types::ExperimentSchedule) -> Self {
276 self.schedule = ::std::option::Option::Some(input);
277 self
278 }
279 /// <p>A structure that contains the time and date that Evidently completed the analysis of the experiment.</p>
280 pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::ExperimentSchedule>) -> Self {
281 self.schedule = input;
282 self
283 }
284 /// <p>A structure that contains the time and date that Evidently completed the analysis of the experiment.</p>
285 pub fn get_schedule(&self) -> &::std::option::Option<crate::types::ExperimentSchedule> {
286 &self.schedule
287 }
288 /// <p>A structure that contains the date and time that the experiment started and ended.</p>
289 pub fn execution(mut self, input: crate::types::ExperimentExecution) -> Self {
290 self.execution = ::std::option::Option::Some(input);
291 self
292 }
293 /// <p>A structure that contains the date and time that the experiment started and ended.</p>
294 pub fn set_execution(mut self, input: ::std::option::Option<crate::types::ExperimentExecution>) -> Self {
295 self.execution = input;
296 self
297 }
298 /// <p>A structure that contains the date and time that the experiment started and ended.</p>
299 pub fn get_execution(&self) -> &::std::option::Option<crate::types::ExperimentExecution> {
300 &self.execution
301 }
302 /// Appends an item to `treatments`.
303 ///
304 /// To override the contents of this collection use [`set_treatments`](Self::set_treatments).
305 ///
306 /// <p>An array of structures that describe the configuration of each feature variation used in the experiment.</p>
307 pub fn treatments(mut self, input: crate::types::Treatment) -> Self {
308 let mut v = self.treatments.unwrap_or_default();
309 v.push(input);
310 self.treatments = ::std::option::Option::Some(v);
311 self
312 }
313 /// <p>An array of structures that describe the configuration of each feature variation used in the experiment.</p>
314 pub fn set_treatments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Treatment>>) -> Self {
315 self.treatments = input;
316 self
317 }
318 /// <p>An array of structures that describe the configuration of each feature variation used in the experiment.</p>
319 pub fn get_treatments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Treatment>> {
320 &self.treatments
321 }
322 /// Appends an item to `metric_goals`.
323 ///
324 /// To override the contents of this collection use [`set_metric_goals`](Self::set_metric_goals).
325 ///
326 /// <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>
327 pub fn metric_goals(mut self, input: crate::types::MetricGoal) -> Self {
328 let mut v = self.metric_goals.unwrap_or_default();
329 v.push(input);
330 self.metric_goals = ::std::option::Option::Some(v);
331 self
332 }
333 /// <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>
334 pub fn set_metric_goals(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricGoal>>) -> Self {
335 self.metric_goals = input;
336 self
337 }
338 /// <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>
339 pub fn get_metric_goals(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricGoal>> {
340 &self.metric_goals
341 }
342 /// <p>This value is used when Evidently assigns a particular user session to the experiment. It helps 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>
343 pub fn randomization_salt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
344 self.randomization_salt = ::std::option::Option::Some(input.into());
345 self
346 }
347 /// <p>This value is used when Evidently assigns a particular user session to the experiment. It helps 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>
348 pub fn set_randomization_salt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
349 self.randomization_salt = input;
350 self
351 }
352 /// <p>This value is used when Evidently assigns a particular user session to the experiment. It helps 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>
353 pub fn get_randomization_salt(&self) -> &::std::option::Option<::std::string::String> {
354 &self.randomization_salt
355 }
356 /// <p>In thousandths of a percent, the amount of the available audience that is allocated to this experiment. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
357 /// <p>This is represented in thousandths of a percent, so a value of 10,000 is 10% of the available audience.</p>
358 pub fn sampling_rate(mut self, input: i64) -> Self {
359 self.sampling_rate = ::std::option::Option::Some(input);
360 self
361 }
362 /// <p>In thousandths of a percent, the amount of the available audience that is allocated to this experiment. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
363 /// <p>This is represented in thousandths of a percent, so a value of 10,000 is 10% of the available audience.</p>
364 pub fn set_sampling_rate(mut self, input: ::std::option::Option<i64>) -> Self {
365 self.sampling_rate = input;
366 self
367 }
368 /// <p>In thousandths of a percent, the amount of the available audience that is allocated to this experiment. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.</p>
369 /// <p>This is represented in thousandths of a percent, so a value of 10,000 is 10% of the available audience.</p>
370 pub fn get_sampling_rate(&self) -> &::std::option::Option<i64> {
371 &self.sampling_rate
372 }
373 /// <p>The audience segment being used for the experiment, if a segment is being used.</p>
374 pub fn segment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
375 self.segment = ::std::option::Option::Some(input.into());
376 self
377 }
378 /// <p>The audience segment being used for the experiment, if a segment is being used.</p>
379 pub fn set_segment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
380 self.segment = input;
381 self
382 }
383 /// <p>The audience segment being used for the experiment, if a segment is being used.</p>
384 pub fn get_segment(&self) -> &::std::option::Option<::std::string::String> {
385 &self.segment
386 }
387 /// <p>The type of this experiment. Currently, this value must be <code>aws.experiment.onlineab</code>.</p>
388 /// This field is required.
389 pub fn r#type(mut self, input: crate::types::ExperimentType) -> Self {
390 self.r#type = ::std::option::Option::Some(input);
391 self
392 }
393 /// <p>The type of this experiment. Currently, this value must be <code>aws.experiment.onlineab</code>.</p>
394 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ExperimentType>) -> Self {
395 self.r#type = input;
396 self
397 }
398 /// <p>The type of this experiment. Currently, this value must be <code>aws.experiment.onlineab</code>.</p>
399 pub fn get_type(&self) -> &::std::option::Option<crate::types::ExperimentType> {
400 &self.r#type
401 }
402 /// <p>A structure that contains the configuration of which variation to 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>
403 pub fn online_ab_definition(mut self, input: crate::types::OnlineAbDefinition) -> Self {
404 self.online_ab_definition = ::std::option::Option::Some(input);
405 self
406 }
407 /// <p>A structure that contains the configuration of which variation to 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>
408 pub fn set_online_ab_definition(mut self, input: ::std::option::Option<crate::types::OnlineAbDefinition>) -> Self {
409 self.online_ab_definition = input;
410 self
411 }
412 /// <p>A structure that contains the configuration of which variation to 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>
413 pub fn get_online_ab_definition(&self) -> &::std::option::Option<crate::types::OnlineAbDefinition> {
414 &self.online_ab_definition
415 }
416 /// Adds a key-value pair to `tags`.
417 ///
418 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
419 ///
420 /// <p>The list of tag keys and values associated with this experiment.</p>
421 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
422 let mut hash_map = self.tags.unwrap_or_default();
423 hash_map.insert(k.into(), v.into());
424 self.tags = ::std::option::Option::Some(hash_map);
425 self
426 }
427 /// <p>The list of tag keys and values associated with this experiment.</p>
428 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
429 self.tags = input;
430 self
431 }
432 /// <p>The list of tag keys and values associated with this experiment.</p>
433 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
434 &self.tags
435 }
436 /// Consumes the builder and constructs a [`Experiment`](crate::types::Experiment).
437 /// This method will fail if any of the following fields are not set:
438 /// - [`arn`](crate::types::builders::ExperimentBuilder::arn)
439 /// - [`name`](crate::types::builders::ExperimentBuilder::name)
440 /// - [`status`](crate::types::builders::ExperimentBuilder::status)
441 /// - [`created_time`](crate::types::builders::ExperimentBuilder::created_time)
442 /// - [`last_updated_time`](crate::types::builders::ExperimentBuilder::last_updated_time)
443 /// - [`r#type`](crate::types::builders::ExperimentBuilder::type)
444 pub fn build(self) -> ::std::result::Result<crate::types::Experiment, ::aws_smithy_types::error::operation::BuildError> {
445 ::std::result::Result::Ok(crate::types::Experiment {
446 arn: self.arn.ok_or_else(|| {
447 ::aws_smithy_types::error::operation::BuildError::missing_field(
448 "arn",
449 "arn was not specified but it is required when building Experiment",
450 )
451 })?,
452 name: self.name.ok_or_else(|| {
453 ::aws_smithy_types::error::operation::BuildError::missing_field(
454 "name",
455 "name was not specified but it is required when building Experiment",
456 )
457 })?,
458 project: self.project,
459 status: self.status.ok_or_else(|| {
460 ::aws_smithy_types::error::operation::BuildError::missing_field(
461 "status",
462 "status was not specified but it is required when building Experiment",
463 )
464 })?,
465 status_reason: self.status_reason,
466 description: self.description,
467 created_time: self.created_time.ok_or_else(|| {
468 ::aws_smithy_types::error::operation::BuildError::missing_field(
469 "created_time",
470 "created_time was not specified but it is required when building Experiment",
471 )
472 })?,
473 last_updated_time: self.last_updated_time.ok_or_else(|| {
474 ::aws_smithy_types::error::operation::BuildError::missing_field(
475 "last_updated_time",
476 "last_updated_time was not specified but it is required when building Experiment",
477 )
478 })?,
479 schedule: self.schedule,
480 execution: self.execution,
481 treatments: self.treatments,
482 metric_goals: self.metric_goals,
483 randomization_salt: self.randomization_salt,
484 sampling_rate: self.sampling_rate.unwrap_or_default(),
485 segment: self.segment,
486 r#type: self.r#type.ok_or_else(|| {
487 ::aws_smithy_types::error::operation::BuildError::missing_field(
488 "r#type",
489 "r#type was not specified but it is required when building Experiment",
490 )
491 })?,
492 online_ab_definition: self.online_ab_definition,
493 tags: self.tags,
494 })
495 }
496}