aws_sdk_fis/operation/start_experiment/
_start_experiment_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct StartExperimentInput {
6 pub client_token: ::std::option::Option<::std::string::String>,
8 pub experiment_template_id: ::std::option::Option<::std::string::String>,
10 pub experiment_options: ::std::option::Option<crate::types::StartExperimentExperimentOptionsInput>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl StartExperimentInput {
16 pub fn client_token(&self) -> ::std::option::Option<&str> {
18 self.client_token.as_deref()
19 }
20 pub fn experiment_template_id(&self) -> ::std::option::Option<&str> {
22 self.experiment_template_id.as_deref()
23 }
24 pub fn experiment_options(&self) -> ::std::option::Option<&crate::types::StartExperimentExperimentOptionsInput> {
26 self.experiment_options.as_ref()
27 }
28 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 pub fn builder() -> crate::operation::start_experiment::builders::StartExperimentInputBuilder {
36 crate::operation::start_experiment::builders::StartExperimentInputBuilder::default()
37 }
38}
39
40#[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 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.client_token = input;
59 self
60 }
61 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
63 &self.client_token
64 }
65 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 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 pub fn get_experiment_template_id(&self) -> &::std::option::Option<::std::string::String> {
78 &self.experiment_template_id
79 }
80 pub fn experiment_options(mut self, input: crate::types::StartExperimentExperimentOptionsInput) -> Self {
82 self.experiment_options = ::std::option::Option::Some(input);
83 self
84 }
85 pub fn set_experiment_options(mut self, input: ::std::option::Option<crate::types::StartExperimentExperimentOptionsInput>) -> Self {
87 self.experiment_options = input;
88 self
89 }
90 pub fn get_experiment_options(&self) -> &::std::option::Option<crate::types::StartExperimentExperimentOptionsInput> {
92 &self.experiment_options
93 }
94 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112 &self.tags
113 }
114 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}