aws_sdk_migrationhub/operation/notify_migration_task_state/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::notify_migration_task_state::_notify_migration_task_state_output::NotifyMigrationTaskStateOutputBuilder;
3
4pub use crate::operation::notify_migration_task_state::_notify_migration_task_state_input::NotifyMigrationTaskStateInputBuilder;
5
6impl crate::operation::notify_migration_task_state::builders::NotifyMigrationTaskStateInputBuilder {
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::notify_migration_task_state::NotifyMigrationTaskStateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::notify_migration_task_state::NotifyMigrationTaskStateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.notify_migration_task_state();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `NotifyMigrationTaskState`.
24///
25/// <p>Notifies Migration Hub of the current status, progress, or other detail regarding a migration task. This API has the following traits:</p>
26/// <ul>
27/// <li>
28/// <p>Migration tools will call the <code>NotifyMigrationTaskState</code> API to share the latest progress and status.</p></li>
29/// <li>
30/// <p><code>MigrationTaskName</code> is used for addressing updates to the correct target.</p></li>
31/// <li>
32/// <p><code>ProgressUpdateStream</code> is used for access control and to provide a namespace for each migration tool.</p></li>
33/// </ul>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct NotifyMigrationTaskStateFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::notify_migration_task_state::builders::NotifyMigrationTaskStateInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::notify_migration_task_state::NotifyMigrationTaskStateOutput,
43        crate::operation::notify_migration_task_state::NotifyMigrationTaskStateError,
44    > for NotifyMigrationTaskStateFluentBuilder
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::notify_migration_task_state::NotifyMigrationTaskStateOutput,
52            crate::operation::notify_migration_task_state::NotifyMigrationTaskStateError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl NotifyMigrationTaskStateFluentBuilder {
59    /// Creates a new `NotifyMigrationTaskStateFluentBuilder`.
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 NotifyMigrationTaskState as a reference.
68    pub fn as_input(&self) -> &crate::operation::notify_migration_task_state::builders::NotifyMigrationTaskStateInputBuilder {
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::notify_migration_task_state::NotifyMigrationTaskStateOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::notify_migration_task_state::NotifyMigrationTaskStateError,
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::notify_migration_task_state::NotifyMigrationTaskState::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::notify_migration_task_state::NotifyMigrationTaskState::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::notify_migration_task_state::NotifyMigrationTaskStateOutput,
105        crate::operation::notify_migration_task_state::NotifyMigrationTaskStateError,
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 name of the ProgressUpdateStream.</p>
120    pub fn progress_update_stream(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.progress_update_stream(input.into());
122        self
123    }
124    /// <p>The name of the ProgressUpdateStream.</p>
125    pub fn set_progress_update_stream(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_progress_update_stream(input);
127        self
128    }
129    /// <p>The name of the ProgressUpdateStream.</p>
130    pub fn get_progress_update_stream(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_progress_update_stream()
132    }
133    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
134    pub fn migration_task_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.migration_task_name(input.into());
136        self
137    }
138    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
139    pub fn set_migration_task_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_migration_task_name(input);
141        self
142    }
143    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
144    pub fn get_migration_task_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_migration_task_name()
146    }
147    /// <p>Information about the task's progress and status.</p>
148    pub fn task(mut self, input: crate::types::Task) -> Self {
149        self.inner = self.inner.task(input);
150        self
151    }
152    /// <p>Information about the task's progress and status.</p>
153    pub fn set_task(mut self, input: ::std::option::Option<crate::types::Task>) -> Self {
154        self.inner = self.inner.set_task(input);
155        self
156    }
157    /// <p>Information about the task's progress and status.</p>
158    pub fn get_task(&self) -> &::std::option::Option<crate::types::Task> {
159        self.inner.get_task()
160    }
161    /// <p>The timestamp when the task was gathered.</p>
162    pub fn update_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
163        self.inner = self.inner.update_date_time(input);
164        self
165    }
166    /// <p>The timestamp when the task was gathered.</p>
167    pub fn set_update_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
168        self.inner = self.inner.set_update_date_time(input);
169        self
170    }
171    /// <p>The timestamp when the task was gathered.</p>
172    pub fn get_update_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173        self.inner.get_update_date_time()
174    }
175    /// <p>Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.</p>
176    pub fn next_update_seconds(mut self, input: i32) -> Self {
177        self.inner = self.inner.next_update_seconds(input);
178        self
179    }
180    /// <p>Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.</p>
181    pub fn set_next_update_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
182        self.inner = self.inner.set_next_update_seconds(input);
183        self
184    }
185    /// <p>Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.</p>
186    pub fn get_next_update_seconds(&self) -> &::std::option::Option<i32> {
187        self.inner.get_next_update_seconds()
188    }
189    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
190    pub fn dry_run(mut self, input: bool) -> Self {
191        self.inner = self.inner.dry_run(input);
192        self
193    }
194    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
195    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
196        self.inner = self.inner.set_dry_run(input);
197        self
198    }
199    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
200    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
201        self.inner.get_dry_run()
202    }
203}