aws_sdk_datapipeline/operation/report_task_progress/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::report_task_progress::_report_task_progress_output::ReportTaskProgressOutputBuilder;
3
4pub use crate::operation::report_task_progress::_report_task_progress_input::ReportTaskProgressInputBuilder;
5
6impl crate::operation::report_task_progress::builders::ReportTaskProgressInputBuilder {
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::report_task_progress::ReportTaskProgressOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::report_task_progress::ReportTaskProgressError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.report_task_progress();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ReportTaskProgress`.
24///
25/// <p>Task runners call <code>ReportTaskProgress</code> when assigned a task to acknowledge that it has the task. If the web service does not receive this acknowledgement within 2 minutes, it assigns the task in a subsequent <code>PollForTask</code> call. After this initial acknowledgement, the task runner only needs to report progress every 15 minutes to maintain its ownership of the task. You can change this reporting time from 15 minutes by specifying a <code>reportProgressTimeout</code> field in your pipeline.</p>
26/// <p>If a task runner does not report its status after 5 minutes, AWS Data Pipeline assumes that the task runner is unable to process the task and reassigns the task in a subsequent response to <code>PollForTask</code>. Task runners should call <code>ReportTaskProgress</code> every 60 seconds.</p><examples>
27/// <request>
28/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.ReportTaskProgress Content-Length: 832 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"taskId": "aaGgHT4LuH0T0Y0oLrJRjas5qH0d8cDPADxqq3tn+zCWGELkCdV2JprLreXm1oxeP5EFZHFLJ69kjSsLYE0iYHYBYVGBrB+E/pYq7ANEEeGJFnSBMRiXZVA+8UJ3OzcInvXeinqBmBaKwii7hnnKb/AXjXiNTXyxgydX1KAyg1AxkwBYG4cfPYMZbuEbQJFJvv5C/2+GVXz1w94nKYTeUeepwUOFOuRLS6JVtZoYwpF56E+Yfk1IcGpFOvCZ01B4Bkuu7x3J+MD/j6kJgZLAgbCJQtI3eiW3kdGmX0p0I2BdY1ZsX6b4UiSvM3OMj6NEHJCJL4E0ZfitnhCoe24Kvjo6C2hFbZq+ei/HPgSXBQMSagkr4vS9c0ChzxH2+LNYvec6bY4kymkaZI1dvOzmpa0FcnGf5AjSK4GpsViZ/ujz6zxFv81qBXzjF0/4M1775rjV1VUdyKaixiA/sJiACNezqZqETidp8d24BDPRhGsj6pBCrnelqGFrk/gXEXUsJ+xwMifRC8UVwiKekpAvHUywVk7Ku4jH/n3i2VoLRP6FXwpUbelu34iiZ9czpXyLtyPKwxa87dlrnRVURwkcVjOt2Mcrcaqe+cbWHvNRhyrPkkdfSF3ac8/wfgVbXvLEB2k9mKc67aD9rvdc1PKX09Tk8BKklsMTpZ3TRCd4NzQlJKigMe8Jat9+1tKj4Ole5ZzW6uyTu2s2iFjEV8KXu4MaiRJyNKCdKeGhhZWY37Qk4NBK4Ppgu+C6Y41dpfOh288SLDEVx0/UySlqOEdhba7c6BiPp5r3hKj3mk9lFy5OYp1aoGLeeFmjXveTnPdf2gkWqXXg7AUbJ7jEs1F0lKZQg4szep2gcKyAJXgvXLfJJHcha8Lfb/Ee7wYmyOcAaRpDBoFNSbtoVXar46teIrpho+ZDvynUXvU0grHWGOk=:wn3SgymHZM99bEXAMPLE", "fields": \[ {"key": "percentComplete", "stringValue": "50"} \] }
29/// </request>
30/// <response>
31/// x-amzn-RequestId: 640bd023-0775-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 18 Date: Mon, 12 Nov 2012 17:50:53 GMT {"canceled": false}
32/// </response>
33/// </examples>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct ReportTaskProgressFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::report_task_progress::builders::ReportTaskProgressInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::report_task_progress::ReportTaskProgressOutput,
43 crate::operation::report_task_progress::ReportTaskProgressError,
44 > for ReportTaskProgressFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::report_task_progress::ReportTaskProgressOutput,
52 crate::operation::report_task_progress::ReportTaskProgressError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl ReportTaskProgressFluentBuilder {
59 /// Creates a new `ReportTaskProgressFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the ReportTaskProgress as a reference.
68 pub fn as_input(&self) -> &crate::operation::report_task_progress::builders::ReportTaskProgressInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::report_task_progress::ReportTaskProgressOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::report_task_progress::ReportTaskProgressError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::report_task_progress::ReportTaskProgress::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::report_task_progress::ReportTaskProgress::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::report_task_progress::ReportTaskProgressOutput,
105 crate::operation::report_task_progress::ReportTaskProgressError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The ID of the task assigned to the task runner. This value is provided in the response for <code>PollForTask</code>.</p>
120 pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.task_id(input.into());
122 self
123 }
124 /// <p>The ID of the task assigned to the task runner. This value is provided in the response for <code>PollForTask</code>.</p>
125 pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_task_id(input);
127 self
128 }
129 /// <p>The ID of the task assigned to the task runner. This value is provided in the response for <code>PollForTask</code>.</p>
130 pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_task_id()
132 }
133 ///
134 /// Appends an item to `fields`.
135 ///
136 /// To override the contents of this collection use [`set_fields`](Self::set_fields).
137 ///
138 /// <p>Key-value pairs that define the properties of the ReportTaskProgressInput object.</p>
139 pub fn fields(mut self, input: crate::types::Field) -> Self {
140 self.inner = self.inner.fields(input);
141 self
142 }
143 /// <p>Key-value pairs that define the properties of the ReportTaskProgressInput object.</p>
144 pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Field>>) -> Self {
145 self.inner = self.inner.set_fields(input);
146 self
147 }
148 /// <p>Key-value pairs that define the properties of the ReportTaskProgressInput object.</p>
149 pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Field>> {
150 self.inner.get_fields()
151 }
152}