aws_sdk_sfn/operation/update_state_machine/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_state_machine::_update_state_machine_output::UpdateStateMachineOutputBuilder;
3
4pub use crate::operation::update_state_machine::_update_state_machine_input::UpdateStateMachineInputBuilder;
5
6impl crate::operation::update_state_machine::builders::UpdateStateMachineInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_state_machine::UpdateStateMachineOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_state_machine::UpdateStateMachineError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_state_machine();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateStateMachine`.
24///
25/// <p>Updates an existing state machine by modifying its <code>definition</code>, <code>roleArn</code>, <code>loggingConfiguration</code>, or <code>EncryptionConfiguration</code>. Running executions will continue to use the previous <code>definition</code> and <code>roleArn</code>. You must include at least one of <code>definition</code> or <code>roleArn</code> or you will receive a <code>MissingRequiredParameter</code> error.</p>
26/// <p>A qualified state machine ARN refers to a <i>Distributed Map state</i> defined within a state machine. For example, the qualified state machine ARN <code>arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel</code> refers to a <i>Distributed Map state</i> with a label <code>mapStateLabel</code> in the state machine named <code>stateMachineName</code>.</p>
27/// <p>A qualified state machine ARN can either refer to a <i>Distributed Map state</i> defined within a state machine, a version ARN, or an alias ARN.</p>
28/// <p>The following are some examples of qualified and unqualified state machine ARNs:</p>
29/// <ul>
30/// <li>
31/// <p>The following qualified state machine ARN refers to a <i>Distributed Map state</i> with a label <code>mapStateLabel</code> in a state machine named <code>myStateMachine</code>.</p>
32/// <p><code>arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel</code></p><note>
33/// <p>If you provide a qualified state machine ARN that refers to a <i>Distributed Map state</i>, the request fails with <code>ValidationException</code>.</p>
34/// </note></li>
35/// <li>
36/// <p>The following qualified state machine ARN refers to an alias named <code>PROD</code>.</p>
37/// <p><code>arn:<partition>
38/// :states:
39/// <region>
40/// :
41/// <account-id>
42/// :stateMachine:
43/// <mystatemachine:prod></mystatemachine:prod>
44/// </account-id>
45/// </region>
46/// </partition></code></p><note>
47/// <p>If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias.</p>
48/// </note></li>
49/// <li>
50/// <p>The following unqualified state machine ARN refers to a state machine named <code>myStateMachine</code>.</p>
51/// <p><code>arn:<partition>
52/// :states:
53/// <region>
54/// :
55/// <account-id>
56/// :stateMachine:
57/// <mystatemachine></mystatemachine>
58/// </account-id>
59/// </region>
60/// </partition></code></p></li>
61/// </ul>
62/// <p>After you update your state machine, you can set the <code>publish</code> parameter to <code>true</code> in the same action to publish a new <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">version</a>. This way, you can opt-in to strict versioning of your state machine.</p><note>
63/// <p>Step Functions assigns monotonically increasing integers for state machine versions, starting at version number 1.</p>
64/// </note> <note>
65/// <p>All <code>StartExecution</code> calls within a few seconds use the updated <code>definition</code> and <code>roleArn</code>. Executions started immediately after you call <code>UpdateStateMachine</code> may use the previous state machine <code>definition</code> and <code>roleArn</code>.</p>
66/// </note>
67#[derive(::std::clone::Clone, ::std::fmt::Debug)]
68pub struct UpdateStateMachineFluentBuilder {
69 handle: ::std::sync::Arc<crate::client::Handle>,
70 inner: crate::operation::update_state_machine::builders::UpdateStateMachineInputBuilder,
71 config_override: ::std::option::Option<crate::config::Builder>,
72}
73impl
74 crate::client::customize::internal::CustomizableSend<
75 crate::operation::update_state_machine::UpdateStateMachineOutput,
76 crate::operation::update_state_machine::UpdateStateMachineError,
77 > for UpdateStateMachineFluentBuilder
78{
79 fn send(
80 self,
81 config_override: crate::config::Builder,
82 ) -> crate::client::customize::internal::BoxFuture<
83 crate::client::customize::internal::SendResult<
84 crate::operation::update_state_machine::UpdateStateMachineOutput,
85 crate::operation::update_state_machine::UpdateStateMachineError,
86 >,
87 > {
88 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
89 }
90}
91impl UpdateStateMachineFluentBuilder {
92 /// Creates a new `UpdateStateMachineFluentBuilder`.
93 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
94 Self {
95 handle,
96 inner: ::std::default::Default::default(),
97 config_override: ::std::option::Option::None,
98 }
99 }
100 /// Access the UpdateStateMachine as a reference.
101 pub fn as_input(&self) -> &crate::operation::update_state_machine::builders::UpdateStateMachineInputBuilder {
102 &self.inner
103 }
104 /// Sends the request and returns the response.
105 ///
106 /// If an error occurs, an `SdkError` will be returned with additional details that
107 /// can be matched against.
108 ///
109 /// By default, any retryable failures will be retried twice. Retry behavior
110 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
111 /// set when configuring the client.
112 pub async fn send(
113 self,
114 ) -> ::std::result::Result<
115 crate::operation::update_state_machine::UpdateStateMachineOutput,
116 ::aws_smithy_runtime_api::client::result::SdkError<
117 crate::operation::update_state_machine::UpdateStateMachineError,
118 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
119 >,
120 > {
121 let input = self
122 .inner
123 .build()
124 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
125 let runtime_plugins = crate::operation::update_state_machine::UpdateStateMachine::operation_runtime_plugins(
126 self.handle.runtime_plugins.clone(),
127 &self.handle.conf,
128 self.config_override,
129 );
130 crate::operation::update_state_machine::UpdateStateMachine::orchestrate(&runtime_plugins, input).await
131 }
132
133 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
134 pub fn customize(
135 self,
136 ) -> crate::client::customize::CustomizableOperation<
137 crate::operation::update_state_machine::UpdateStateMachineOutput,
138 crate::operation::update_state_machine::UpdateStateMachineError,
139 Self,
140 > {
141 crate::client::customize::CustomizableOperation::new(self)
142 }
143 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
144 self.set_config_override(::std::option::Option::Some(config_override.into()));
145 self
146 }
147
148 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
149 self.config_override = config_override;
150 self
151 }
152 /// <p>The Amazon Resource Name (ARN) of the state machine.</p>
153 pub fn state_machine_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.inner = self.inner.state_machine_arn(input.into());
155 self
156 }
157 /// <p>The Amazon Resource Name (ARN) of the state machine.</p>
158 pub fn set_state_machine_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.inner = self.inner.set_state_machine_arn(input);
160 self
161 }
162 /// <p>The Amazon Resource Name (ARN) of the state machine.</p>
163 pub fn get_state_machine_arn(&self) -> &::std::option::Option<::std::string::String> {
164 self.inner.get_state_machine_arn()
165 }
166 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
167 pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.definition(input.into());
169 self
170 }
171 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
172 pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.inner = self.inner.set_definition(input);
174 self
175 }
176 /// <p>The Amazon States Language definition of the state machine. See <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a>.</p>
177 pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_definition()
179 }
180 /// <p>The Amazon Resource Name (ARN) of the IAM role of the state machine.</p>
181 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182 self.inner = self.inner.role_arn(input.into());
183 self
184 }
185 /// <p>The Amazon Resource Name (ARN) of the IAM role of the state machine.</p>
186 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187 self.inner = self.inner.set_role_arn(input);
188 self
189 }
190 /// <p>The Amazon Resource Name (ARN) of the IAM role of the state machine.</p>
191 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
192 self.inner.get_role_arn()
193 }
194 /// <p>Use the <code>LoggingConfiguration</code> data type to set CloudWatch Logs options.</p>
195 pub fn logging_configuration(mut self, input: crate::types::LoggingConfiguration) -> Self {
196 self.inner = self.inner.logging_configuration(input);
197 self
198 }
199 /// <p>Use the <code>LoggingConfiguration</code> data type to set CloudWatch Logs options.</p>
200 pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::LoggingConfiguration>) -> Self {
201 self.inner = self.inner.set_logging_configuration(input);
202 self
203 }
204 /// <p>Use the <code>LoggingConfiguration</code> data type to set CloudWatch Logs options.</p>
205 pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::LoggingConfiguration> {
206 self.inner.get_logging_configuration()
207 }
208 /// <p>Selects whether X-Ray tracing is enabled.</p>
209 pub fn tracing_configuration(mut self, input: crate::types::TracingConfiguration) -> Self {
210 self.inner = self.inner.tracing_configuration(input);
211 self
212 }
213 /// <p>Selects whether X-Ray tracing is enabled.</p>
214 pub fn set_tracing_configuration(mut self, input: ::std::option::Option<crate::types::TracingConfiguration>) -> Self {
215 self.inner = self.inner.set_tracing_configuration(input);
216 self
217 }
218 /// <p>Selects whether X-Ray tracing is enabled.</p>
219 pub fn get_tracing_configuration(&self) -> &::std::option::Option<crate::types::TracingConfiguration> {
220 self.inner.get_tracing_configuration()
221 }
222 /// <p>Specifies whether the state machine version is published. The default is <code>false</code>. To publish a version after updating the state machine, set <code>publish</code> to <code>true</code>.</p>
223 pub fn publish(mut self, input: bool) -> Self {
224 self.inner = self.inner.publish(input);
225 self
226 }
227 /// <p>Specifies whether the state machine version is published. The default is <code>false</code>. To publish a version after updating the state machine, set <code>publish</code> to <code>true</code>.</p>
228 pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
229 self.inner = self.inner.set_publish(input);
230 self
231 }
232 /// <p>Specifies whether the state machine version is published. The default is <code>false</code>. To publish a version after updating the state machine, set <code>publish</code> to <code>true</code>.</p>
233 pub fn get_publish(&self) -> &::std::option::Option<bool> {
234 self.inner.get_publish()
235 }
236 /// <p>An optional description of the state machine version to publish.</p>
237 /// <p>You can only specify the <code>versionDescription</code> parameter if you've set <code>publish</code> to <code>true</code>.</p>
238 pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239 self.inner = self.inner.version_description(input.into());
240 self
241 }
242 /// <p>An optional description of the state machine version to publish.</p>
243 /// <p>You can only specify the <code>versionDescription</code> parameter if you've set <code>publish</code> to <code>true</code>.</p>
244 pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245 self.inner = self.inner.set_version_description(input);
246 self
247 }
248 /// <p>An optional description of the state machine version to publish.</p>
249 /// <p>You can only specify the <code>versionDescription</code> parameter if you've set <code>publish</code> to <code>true</code>.</p>
250 pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
251 self.inner.get_version_description()
252 }
253 /// <p>Settings to configure server-side encryption.</p>
254 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
255 self.inner = self.inner.encryption_configuration(input);
256 self
257 }
258 /// <p>Settings to configure server-side encryption.</p>
259 pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
260 self.inner = self.inner.set_encryption_configuration(input);
261 self
262 }
263 /// <p>Settings to configure server-side encryption.</p>
264 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
265 self.inner.get_encryption_configuration()
266 }
267}