aws_sdk_sfn/operation/test_state/
_test_state_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)]
5pub struct TestStateInput {
6    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
7    pub definition: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
9    pub role_arn: ::std::option::Option<::std::string::String>,
10    /// <p>A string that contains the JSON input data for the state.</p>
11    pub input: ::std::option::Option<::std::string::String>,
12    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
13    /// <ul>
14    /// <li>
15    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
16    /// <li>
17    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
18    /// <li>
19    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
20    /// </ul>
21    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
22    pub inspection_level: ::std::option::Option<crate::types::InspectionLevel>,
23    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
24    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
25    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
26    pub reveal_secrets: ::std::option::Option<bool>,
27    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
28    pub variables: ::std::option::Option<::std::string::String>,
29    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
30    pub state_name: ::std::option::Option<::std::string::String>,
31    /// <p>Defines a mocked result or error for the state under test.</p>
32    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
33    pub mock: ::std::option::Option<crate::types::MockInput>,
34    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
35    pub context: ::std::option::Option<::std::string::String>,
36    /// <p>Contains configurations for the state under test.</p>
37    pub state_configuration: ::std::option::Option<crate::types::TestStateConfiguration>,
38}
39impl TestStateInput {
40    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
41    pub fn definition(&self) -> ::std::option::Option<&str> {
42        self.definition.as_deref()
43    }
44    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
45    pub fn role_arn(&self) -> ::std::option::Option<&str> {
46        self.role_arn.as_deref()
47    }
48    /// <p>A string that contains the JSON input data for the state.</p>
49    pub fn input(&self) -> ::std::option::Option<&str> {
50        self.input.as_deref()
51    }
52    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
53    /// <ul>
54    /// <li>
55    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
56    /// <li>
57    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
58    /// <li>
59    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
60    /// </ul>
61    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
62    pub fn inspection_level(&self) -> ::std::option::Option<&crate::types::InspectionLevel> {
63        self.inspection_level.as_ref()
64    }
65    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
66    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
67    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
68    pub fn reveal_secrets(&self) -> ::std::option::Option<bool> {
69        self.reveal_secrets
70    }
71    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
72    pub fn variables(&self) -> ::std::option::Option<&str> {
73        self.variables.as_deref()
74    }
75    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
76    pub fn state_name(&self) -> ::std::option::Option<&str> {
77        self.state_name.as_deref()
78    }
79    /// <p>Defines a mocked result or error for the state under test.</p>
80    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
81    pub fn mock(&self) -> ::std::option::Option<&crate::types::MockInput> {
82        self.mock.as_ref()
83    }
84    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
85    pub fn context(&self) -> ::std::option::Option<&str> {
86        self.context.as_deref()
87    }
88    /// <p>Contains configurations for the state under test.</p>
89    pub fn state_configuration(&self) -> ::std::option::Option<&crate::types::TestStateConfiguration> {
90        self.state_configuration.as_ref()
91    }
92}
93impl ::std::fmt::Debug for TestStateInput {
94    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
95        let mut formatter = f.debug_struct("TestStateInput");
96        formatter.field("definition", &"*** Sensitive Data Redacted ***");
97        formatter.field("role_arn", &self.role_arn);
98        formatter.field("input", &"*** Sensitive Data Redacted ***");
99        formatter.field("inspection_level", &self.inspection_level);
100        formatter.field("reveal_secrets", &self.reveal_secrets);
101        formatter.field("variables", &"*** Sensitive Data Redacted ***");
102        formatter.field("state_name", &"*** Sensitive Data Redacted ***");
103        formatter.field("mock", &self.mock);
104        formatter.field("context", &"*** Sensitive Data Redacted ***");
105        formatter.field("state_configuration", &self.state_configuration);
106        formatter.finish()
107    }
108}
109impl TestStateInput {
110    /// Creates a new builder-style object to manufacture [`TestStateInput`](crate::operation::test_state::TestStateInput).
111    pub fn builder() -> crate::operation::test_state::builders::TestStateInputBuilder {
112        crate::operation::test_state::builders::TestStateInputBuilder::default()
113    }
114}
115
116/// A builder for [`TestStateInput`](crate::operation::test_state::TestStateInput).
117#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
118#[non_exhaustive]
119pub struct TestStateInputBuilder {
120    pub(crate) definition: ::std::option::Option<::std::string::String>,
121    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
122    pub(crate) input: ::std::option::Option<::std::string::String>,
123    pub(crate) inspection_level: ::std::option::Option<crate::types::InspectionLevel>,
124    pub(crate) reveal_secrets: ::std::option::Option<bool>,
125    pub(crate) variables: ::std::option::Option<::std::string::String>,
126    pub(crate) state_name: ::std::option::Option<::std::string::String>,
127    pub(crate) mock: ::std::option::Option<crate::types::MockInput>,
128    pub(crate) context: ::std::option::Option<::std::string::String>,
129    pub(crate) state_configuration: ::std::option::Option<crate::types::TestStateConfiguration>,
130}
131impl TestStateInputBuilder {
132    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
133    /// This field is required.
134    pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.definition = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
139    pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.definition = input;
141        self
142    }
143    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
144    pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
145        &self.definition
146    }
147    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
148    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.role_arn = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
153    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.role_arn = input;
155        self
156    }
157    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
158    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
159        &self.role_arn
160    }
161    /// <p>A string that contains the JSON input data for the state.</p>
162    pub fn input(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.input = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>A string that contains the JSON input data for the state.</p>
167    pub fn set_input(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.input = input;
169        self
170    }
171    /// <p>A string that contains the JSON input data for the state.</p>
172    pub fn get_input(&self) -> &::std::option::Option<::std::string::String> {
173        &self.input
174    }
175    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
176    /// <ul>
177    /// <li>
178    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
179    /// <li>
180    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
181    /// <li>
182    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
183    /// </ul>
184    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
185    pub fn inspection_level(mut self, input: crate::types::InspectionLevel) -> Self {
186        self.inspection_level = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
190    /// <ul>
191    /// <li>
192    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
193    /// <li>
194    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
195    /// <li>
196    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
197    /// </ul>
198    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
199    pub fn set_inspection_level(mut self, input: ::std::option::Option<crate::types::InspectionLevel>) -> Self {
200        self.inspection_level = input;
201        self
202    }
203    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
204    /// <ul>
205    /// <li>
206    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
207    /// <li>
208    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
209    /// <li>
210    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
211    /// </ul>
212    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
213    pub fn get_inspection_level(&self) -> &::std::option::Option<crate::types::InspectionLevel> {
214        &self.inspection_level
215    }
216    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
217    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
218    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
219    pub fn reveal_secrets(mut self, input: bool) -> Self {
220        self.reveal_secrets = ::std::option::Option::Some(input);
221        self
222    }
223    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
224    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
225    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
226    pub fn set_reveal_secrets(mut self, input: ::std::option::Option<bool>) -> Self {
227        self.reveal_secrets = input;
228        self
229    }
230    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
231    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
232    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
233    pub fn get_reveal_secrets(&self) -> &::std::option::Option<bool> {
234        &self.reveal_secrets
235    }
236    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
237    pub fn variables(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.variables = ::std::option::Option::Some(input.into());
239        self
240    }
241    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
242    pub fn set_variables(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.variables = input;
244        self
245    }
246    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
247    pub fn get_variables(&self) -> &::std::option::Option<::std::string::String> {
248        &self.variables
249    }
250    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
251    pub fn state_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.state_name = ::std::option::Option::Some(input.into());
253        self
254    }
255    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
256    pub fn set_state_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257        self.state_name = input;
258        self
259    }
260    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
261    pub fn get_state_name(&self) -> &::std::option::Option<::std::string::String> {
262        &self.state_name
263    }
264    /// <p>Defines a mocked result or error for the state under test.</p>
265    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
266    pub fn mock(mut self, input: crate::types::MockInput) -> Self {
267        self.mock = ::std::option::Option::Some(input);
268        self
269    }
270    /// <p>Defines a mocked result or error for the state under test.</p>
271    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
272    pub fn set_mock(mut self, input: ::std::option::Option<crate::types::MockInput>) -> Self {
273        self.mock = input;
274        self
275    }
276    /// <p>Defines a mocked result or error for the state under test.</p>
277    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
278    pub fn get_mock(&self) -> &::std::option::Option<crate::types::MockInput> {
279        &self.mock
280    }
281    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
282    pub fn context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
283        self.context = ::std::option::Option::Some(input.into());
284        self
285    }
286    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
287    pub fn set_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.context = input;
289        self
290    }
291    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
292    pub fn get_context(&self) -> &::std::option::Option<::std::string::String> {
293        &self.context
294    }
295    /// <p>Contains configurations for the state under test.</p>
296    pub fn state_configuration(mut self, input: crate::types::TestStateConfiguration) -> Self {
297        self.state_configuration = ::std::option::Option::Some(input);
298        self
299    }
300    /// <p>Contains configurations for the state under test.</p>
301    pub fn set_state_configuration(mut self, input: ::std::option::Option<crate::types::TestStateConfiguration>) -> Self {
302        self.state_configuration = input;
303        self
304    }
305    /// <p>Contains configurations for the state under test.</p>
306    pub fn get_state_configuration(&self) -> &::std::option::Option<crate::types::TestStateConfiguration> {
307        &self.state_configuration
308    }
309    /// Consumes the builder and constructs a [`TestStateInput`](crate::operation::test_state::TestStateInput).
310    pub fn build(self) -> ::std::result::Result<crate::operation::test_state::TestStateInput, ::aws_smithy_types::error::operation::BuildError> {
311        ::std::result::Result::Ok(crate::operation::test_state::TestStateInput {
312            definition: self.definition,
313            role_arn: self.role_arn,
314            input: self.input,
315            inspection_level: self.inspection_level,
316            reveal_secrets: self.reveal_secrets,
317            variables: self.variables,
318            state_name: self.state_name,
319            mock: self.mock,
320            context: self.context,
321            state_configuration: self.state_configuration,
322        })
323    }
324}
325impl ::std::fmt::Debug for TestStateInputBuilder {
326    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
327        let mut formatter = f.debug_struct("TestStateInputBuilder");
328        formatter.field("definition", &"*** Sensitive Data Redacted ***");
329        formatter.field("role_arn", &self.role_arn);
330        formatter.field("input", &"*** Sensitive Data Redacted ***");
331        formatter.field("inspection_level", &self.inspection_level);
332        formatter.field("reveal_secrets", &self.reveal_secrets);
333        formatter.field("variables", &"*** Sensitive Data Redacted ***");
334        formatter.field("state_name", &"*** Sensitive Data Redacted ***");
335        formatter.field("mock", &self.mock);
336        formatter.field("context", &"*** Sensitive Data Redacted ***");
337        formatter.field("state_configuration", &self.state_configuration);
338        formatter.finish()
339    }
340}