aws_sdk_fis/operation/start_experiment/
_start_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 StartExperimentInput {
6    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the experiment template.</p>
9    pub experiment_template_id: ::std::option::Option<::std::string::String>,
10    /// <p>The experiment options for running the experiment.</p>
11    pub experiment_options: ::std::option::Option<crate::types::StartExperimentExperimentOptionsInput>,
12    /// <p>The tags to apply to the experiment.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl StartExperimentInput {
16    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
17    pub fn client_token(&self) -> ::std::option::Option<&str> {
18        self.client_token.as_deref()
19    }
20    /// <p>The ID of the experiment template.</p>
21    pub fn experiment_template_id(&self) -> ::std::option::Option<&str> {
22        self.experiment_template_id.as_deref()
23    }
24    /// <p>The experiment options for running the experiment.</p>
25    pub fn experiment_options(&self) -> ::std::option::Option<&crate::types::StartExperimentExperimentOptionsInput> {
26        self.experiment_options.as_ref()
27    }
28    /// <p>The tags to apply to the experiment.</p>
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl StartExperimentInput {
34    /// Creates a new builder-style object to manufacture [`StartExperimentInput`](crate::operation::start_experiment::StartExperimentInput).
35    pub fn builder() -> crate::operation::start_experiment::builders::StartExperimentInputBuilder {
36        crate::operation::start_experiment::builders::StartExperimentInputBuilder::default()
37    }
38}
39
40/// A builder for [`StartExperimentInput`](crate::operation::start_experiment::StartExperimentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct StartExperimentInputBuilder {
44    pub(crate) client_token: ::std::option::Option<::std::string::String>,
45    pub(crate) experiment_template_id: ::std::option::Option<::std::string::String>,
46    pub(crate) experiment_options: ::std::option::Option<crate::types::StartExperimentExperimentOptionsInput>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl StartExperimentInputBuilder {
50    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
51    /// This field is required.
52    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.client_token = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
57    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.client_token = input;
59        self
60    }
61    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
62    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
63        &self.client_token
64    }
65    /// <p>The ID of the experiment template.</p>
66    /// This field is required.
67    pub fn experiment_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.experiment_template_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The ID of the experiment template.</p>
72    pub fn set_experiment_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.experiment_template_id = input;
74        self
75    }
76    /// <p>The ID of the experiment template.</p>
77    pub fn get_experiment_template_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.experiment_template_id
79    }
80    /// <p>The experiment options for running the experiment.</p>
81    pub fn experiment_options(mut self, input: crate::types::StartExperimentExperimentOptionsInput) -> Self {
82        self.experiment_options = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The experiment options for running the experiment.</p>
86    pub fn set_experiment_options(mut self, input: ::std::option::Option<crate::types::StartExperimentExperimentOptionsInput>) -> Self {
87        self.experiment_options = input;
88        self
89    }
90    /// <p>The experiment options for running the experiment.</p>
91    pub fn get_experiment_options(&self) -> &::std::option::Option<crate::types::StartExperimentExperimentOptionsInput> {
92        &self.experiment_options
93    }
94    /// Adds a key-value pair to `tags`.
95    ///
96    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
97    ///
98    /// <p>The tags to apply to the experiment.</p>
99    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
100        let mut hash_map = self.tags.unwrap_or_default();
101        hash_map.insert(k.into(), v.into());
102        self.tags = ::std::option::Option::Some(hash_map);
103        self
104    }
105    /// <p>The tags to apply to the experiment.</p>
106    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
107        self.tags = input;
108        self
109    }
110    /// <p>The tags to apply to the experiment.</p>
111    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112        &self.tags
113    }
114    /// Consumes the builder and constructs a [`StartExperimentInput`](crate::operation::start_experiment::StartExperimentInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::start_experiment::StartExperimentInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::start_experiment::StartExperimentInput {
119            client_token: self.client_token,
120            experiment_template_id: self.experiment_template_id,
121            experiment_options: self.experiment_options,
122            tags: self.tags,
123        })
124    }
125}