aws_sdk_robomaker/operation/create_simulation_job/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_simulation_job::_create_simulation_job_output::CreateSimulationJobOutputBuilder;
3
4pub use crate::operation::create_simulation_job::_create_simulation_job_input::CreateSimulationJobInputBuilder;
5
6impl crate::operation::create_simulation_job::builders::CreateSimulationJobInputBuilder {
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::create_simulation_job::CreateSimulationJobOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_simulation_job::CreateSimulationJobError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_simulation_job();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateSimulationJob`.
24///
25/// <important>
26/// <p>End of support notice: On September 10, 2025, Amazon Web Services will discontinue support for Amazon Web Services RoboMaker. After September 10, 2025, you will no longer be able to access the Amazon Web Services RoboMaker console or Amazon Web Services RoboMaker resources. For more information on transitioning to Batch to help run containerized simulations, visit <a href="https://aws.amazon.com/blogs/hpc/run-simulations-using-multiple-containers-in-a-single-aws-batch-job/">https://aws.amazon.com/blogs/hpc/run-simulations-using-multiple-containers-in-a-single-aws-batch-job/</a>.</p>
27/// </important>
28/// <p>Creates a simulation job.</p><note>
29/// <p>After 90 days, simulation jobs expire and will be deleted. They will no longer be accessible.</p>
30/// </note>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateSimulationJobFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::create_simulation_job::builders::CreateSimulationJobInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::create_simulation_job::CreateSimulationJobOutput,
40 crate::operation::create_simulation_job::CreateSimulationJobError,
41 > for CreateSimulationJobFluentBuilder
42{
43 fn send(
44 self,
45 config_override: crate::config::Builder,
46 ) -> crate::client::customize::internal::BoxFuture<
47 crate::client::customize::internal::SendResult<
48 crate::operation::create_simulation_job::CreateSimulationJobOutput,
49 crate::operation::create_simulation_job::CreateSimulationJobError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl CreateSimulationJobFluentBuilder {
56 /// Creates a new `CreateSimulationJobFluentBuilder`.
57 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58 Self {
59 handle,
60 inner: ::std::default::Default::default(),
61 config_override: ::std::option::Option::None,
62 }
63 }
64 /// Access the CreateSimulationJob as a reference.
65 pub fn as_input(&self) -> &crate::operation::create_simulation_job::builders::CreateSimulationJobInputBuilder {
66 &self.inner
67 }
68 /// Sends the request and returns the response.
69 ///
70 /// If an error occurs, an `SdkError` will be returned with additional details that
71 /// can be matched against.
72 ///
73 /// By default, any retryable failures will be retried twice. Retry behavior
74 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75 /// set when configuring the client.
76 pub async fn send(
77 self,
78 ) -> ::std::result::Result<
79 crate::operation::create_simulation_job::CreateSimulationJobOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::create_simulation_job::CreateSimulationJobError,
82 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83 >,
84 > {
85 let input = self
86 .inner
87 .build()
88 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89 let runtime_plugins = crate::operation::create_simulation_job::CreateSimulationJob::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::create_simulation_job::CreateSimulationJob::orchestrate(&runtime_plugins, input).await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::create_simulation_job::CreateSimulationJobOutput,
102 crate::operation::create_simulation_job::CreateSimulationJobError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
117 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.client_request_token(input.into());
119 self
120 }
121 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
122 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_client_request_token(input);
124 self
125 }
126 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
127 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_client_request_token()
129 }
130 /// <p>Location for output files generated by the simulation job.</p>
131 pub fn output_location(mut self, input: crate::types::OutputLocation) -> Self {
132 self.inner = self.inner.output_location(input);
133 self
134 }
135 /// <p>Location for output files generated by the simulation job.</p>
136 pub fn set_output_location(mut self, input: ::std::option::Option<crate::types::OutputLocation>) -> Self {
137 self.inner = self.inner.set_output_location(input);
138 self
139 }
140 /// <p>Location for output files generated by the simulation job.</p>
141 pub fn get_output_location(&self) -> &::std::option::Option<crate::types::OutputLocation> {
142 self.inner.get_output_location()
143 }
144 /// <p>The logging configuration.</p>
145 pub fn logging_config(mut self, input: crate::types::LoggingConfig) -> Self {
146 self.inner = self.inner.logging_config(input);
147 self
148 }
149 /// <p>The logging configuration.</p>
150 pub fn set_logging_config(mut self, input: ::std::option::Option<crate::types::LoggingConfig>) -> Self {
151 self.inner = self.inner.set_logging_config(input);
152 self
153 }
154 /// <p>The logging configuration.</p>
155 pub fn get_logging_config(&self) -> &::std::option::Option<crate::types::LoggingConfig> {
156 self.inner.get_logging_config()
157 }
158 /// <p>The maximum simulation job duration in seconds (up to 14 days or 1,209,600 seconds. When <code>maxJobDurationInSeconds</code> is reached, the simulation job will status will transition to <code>Completed</code>.</p>
159 pub fn max_job_duration_in_seconds(mut self, input: i64) -> Self {
160 self.inner = self.inner.max_job_duration_in_seconds(input);
161 self
162 }
163 /// <p>The maximum simulation job duration in seconds (up to 14 days or 1,209,600 seconds. When <code>maxJobDurationInSeconds</code> is reached, the simulation job will status will transition to <code>Completed</code>.</p>
164 pub fn set_max_job_duration_in_seconds(mut self, input: ::std::option::Option<i64>) -> Self {
165 self.inner = self.inner.set_max_job_duration_in_seconds(input);
166 self
167 }
168 /// <p>The maximum simulation job duration in seconds (up to 14 days or 1,209,600 seconds. When <code>maxJobDurationInSeconds</code> is reached, the simulation job will status will transition to <code>Completed</code>.</p>
169 pub fn get_max_job_duration_in_seconds(&self) -> &::std::option::Option<i64> {
170 self.inner.get_max_job_duration_in_seconds()
171 }
172 /// <p>The IAM role name that allows the simulation instance to call the AWS APIs that are specified in its associated policies on your behalf. This is how credentials are passed in to your simulation job.</p>
173 pub fn iam_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174 self.inner = self.inner.iam_role(input.into());
175 self
176 }
177 /// <p>The IAM role name that allows the simulation instance to call the AWS APIs that are specified in its associated policies on your behalf. This is how credentials are passed in to your simulation job.</p>
178 pub fn set_iam_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.inner = self.inner.set_iam_role(input);
180 self
181 }
182 /// <p>The IAM role name that allows the simulation instance to call the AWS APIs that are specified in its associated policies on your behalf. This is how credentials are passed in to your simulation job.</p>
183 pub fn get_iam_role(&self) -> &::std::option::Option<::std::string::String> {
184 self.inner.get_iam_role()
185 }
186 /// <p>The failure behavior the simulation job.</p>
187 /// <dl>
188 /// <dt>
189 /// Continue
190 /// </dt>
191 /// <dd>
192 /// <p>Leaves the instance running for its maximum timeout duration after a <code>4XX</code> error code.</p>
193 /// </dd>
194 /// <dt>
195 /// Fail
196 /// </dt>
197 /// <dd>
198 /// <p>Stop the simulation job and terminate the instance.</p>
199 /// </dd>
200 /// </dl>
201 pub fn failure_behavior(mut self, input: crate::types::FailureBehavior) -> Self {
202 self.inner = self.inner.failure_behavior(input);
203 self
204 }
205 /// <p>The failure behavior the simulation job.</p>
206 /// <dl>
207 /// <dt>
208 /// Continue
209 /// </dt>
210 /// <dd>
211 /// <p>Leaves the instance running for its maximum timeout duration after a <code>4XX</code> error code.</p>
212 /// </dd>
213 /// <dt>
214 /// Fail
215 /// </dt>
216 /// <dd>
217 /// <p>Stop the simulation job and terminate the instance.</p>
218 /// </dd>
219 /// </dl>
220 pub fn set_failure_behavior(mut self, input: ::std::option::Option<crate::types::FailureBehavior>) -> Self {
221 self.inner = self.inner.set_failure_behavior(input);
222 self
223 }
224 /// <p>The failure behavior the simulation job.</p>
225 /// <dl>
226 /// <dt>
227 /// Continue
228 /// </dt>
229 /// <dd>
230 /// <p>Leaves the instance running for its maximum timeout duration after a <code>4XX</code> error code.</p>
231 /// </dd>
232 /// <dt>
233 /// Fail
234 /// </dt>
235 /// <dd>
236 /// <p>Stop the simulation job and terminate the instance.</p>
237 /// </dd>
238 /// </dl>
239 pub fn get_failure_behavior(&self) -> &::std::option::Option<crate::types::FailureBehavior> {
240 self.inner.get_failure_behavior()
241 }
242 ///
243 /// Appends an item to `robotApplications`.
244 ///
245 /// To override the contents of this collection use [`set_robot_applications`](Self::set_robot_applications).
246 ///
247 /// <p>The robot application to use in the simulation job.</p>
248 pub fn robot_applications(mut self, input: crate::types::RobotApplicationConfig) -> Self {
249 self.inner = self.inner.robot_applications(input);
250 self
251 }
252 /// <p>The robot application to use in the simulation job.</p>
253 pub fn set_robot_applications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RobotApplicationConfig>>) -> Self {
254 self.inner = self.inner.set_robot_applications(input);
255 self
256 }
257 /// <p>The robot application to use in the simulation job.</p>
258 pub fn get_robot_applications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RobotApplicationConfig>> {
259 self.inner.get_robot_applications()
260 }
261 ///
262 /// Appends an item to `simulationApplications`.
263 ///
264 /// To override the contents of this collection use [`set_simulation_applications`](Self::set_simulation_applications).
265 ///
266 /// <p>The simulation application to use in the simulation job.</p>
267 pub fn simulation_applications(mut self, input: crate::types::SimulationApplicationConfig) -> Self {
268 self.inner = self.inner.simulation_applications(input);
269 self
270 }
271 /// <p>The simulation application to use in the simulation job.</p>
272 pub fn set_simulation_applications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SimulationApplicationConfig>>) -> Self {
273 self.inner = self.inner.set_simulation_applications(input);
274 self
275 }
276 /// <p>The simulation application to use in the simulation job.</p>
277 pub fn get_simulation_applications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SimulationApplicationConfig>> {
278 self.inner.get_simulation_applications()
279 }
280 ///
281 /// Appends an item to `dataSources`.
282 ///
283 /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
284 ///
285 /// <p>Specify data sources to mount read-only files from S3 into your simulation. These files are available under <code>/opt/robomaker/datasources/data_source_name</code>.</p><note>
286 /// <p>There is a limit of 100 files and a combined size of 25GB for all <code>DataSourceConfig</code> objects.</p>
287 /// </note>
288 pub fn data_sources(mut self, input: crate::types::DataSourceConfig) -> Self {
289 self.inner = self.inner.data_sources(input);
290 self
291 }
292 /// <p>Specify data sources to mount read-only files from S3 into your simulation. These files are available under <code>/opt/robomaker/datasources/data_source_name</code>.</p><note>
293 /// <p>There is a limit of 100 files and a combined size of 25GB for all <code>DataSourceConfig</code> objects.</p>
294 /// </note>
295 pub fn set_data_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSourceConfig>>) -> Self {
296 self.inner = self.inner.set_data_sources(input);
297 self
298 }
299 /// <p>Specify data sources to mount read-only files from S3 into your simulation. These files are available under <code>/opt/robomaker/datasources/data_source_name</code>.</p><note>
300 /// <p>There is a limit of 100 files and a combined size of 25GB for all <code>DataSourceConfig</code> objects.</p>
301 /// </note>
302 pub fn get_data_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSourceConfig>> {
303 self.inner.get_data_sources()
304 }
305 ///
306 /// Adds a key-value pair to `tags`.
307 ///
308 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
309 ///
310 /// <p>A map that contains tag keys and tag values that are attached to the simulation job.</p>
311 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
312 self.inner = self.inner.tags(k.into(), v.into());
313 self
314 }
315 /// <p>A map that contains tag keys and tag values that are attached to the simulation job.</p>
316 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
317 self.inner = self.inner.set_tags(input);
318 self
319 }
320 /// <p>A map that contains tag keys and tag values that are attached to the simulation job.</p>
321 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
322 self.inner.get_tags()
323 }
324 /// <p>If your simulation job accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs. These must belong to the same VPC. You must provide at least one security group and one subnet ID.</p>
325 pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
326 self.inner = self.inner.vpc_config(input);
327 self
328 }
329 /// <p>If your simulation job accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs. These must belong to the same VPC. You must provide at least one security group and one subnet ID.</p>
330 pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
331 self.inner = self.inner.set_vpc_config(input);
332 self
333 }
334 /// <p>If your simulation job accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs. These must belong to the same VPC. You must provide at least one security group and one subnet ID.</p>
335 pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
336 self.inner.get_vpc_config()
337 }
338 /// <p>Compute information for the simulation job.</p>
339 pub fn compute(mut self, input: crate::types::Compute) -> Self {
340 self.inner = self.inner.compute(input);
341 self
342 }
343 /// <p>Compute information for the simulation job.</p>
344 pub fn set_compute(mut self, input: ::std::option::Option<crate::types::Compute>) -> Self {
345 self.inner = self.inner.set_compute(input);
346 self
347 }
348 /// <p>Compute information for the simulation job.</p>
349 pub fn get_compute(&self) -> &::std::option::Option<crate::types::Compute> {
350 self.inner.get_compute()
351 }
352}