aws_sdk_sqs/operation/start_message_move_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_message_move_task::_start_message_move_task_output::StartMessageMoveTaskOutputBuilder;
3
4pub use crate::operation::start_message_move_task::_start_message_move_task_input::StartMessageMoveTaskInputBuilder;
5
6impl crate::operation::start_message_move_task::builders::StartMessageMoveTaskInputBuilder {
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::start_message_move_task::StartMessageMoveTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_message_move_task::StartMessageMoveTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_message_move_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartMessageMoveTask`.
24///
25/// <p>Starts an asynchronous task to move messages from a specified source queue to a specified destination queue.</p><note>
26/// <ul>
27/// <li>
28/// <p>This action is currently limited to supporting message redrive from queues that are configured as <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">dead-letter queues (DLQs)</a> of other Amazon SQS queues only. Non-SQS queue sources of dead-letter queues, such as Lambda or Amazon SNS topics, are currently not supported.</p></li>
29/// <li>
30/// <p>In dead-letter queues redrive context, the <code>StartMessageMoveTask</code> the source queue is the DLQ, while the destination queue can be the original source queue (from which the messages were driven to the dead-letter-queue), or a custom destination queue.</p></li>
31/// <li>
32/// <p>Only one active message movement task is supported per queue at any given time.</p></li>
33/// </ul>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct StartMessageMoveTaskFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::start_message_move_task::builders::StartMessageMoveTaskInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::start_message_move_task::StartMessageMoveTaskOutput,
44 crate::operation::start_message_move_task::StartMessageMoveTaskError,
45 > for StartMessageMoveTaskFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::start_message_move_task::StartMessageMoveTaskOutput,
53 crate::operation::start_message_move_task::StartMessageMoveTaskError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl StartMessageMoveTaskFluentBuilder {
60 /// Creates a new `StartMessageMoveTaskFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the StartMessageMoveTask as a reference.
69 pub fn as_input(&self) -> &crate::operation::start_message_move_task::builders::StartMessageMoveTaskInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::start_message_move_task::StartMessageMoveTaskOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::start_message_move_task::StartMessageMoveTaskError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::start_message_move_task::StartMessageMoveTask::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::start_message_move_task::StartMessageMoveTask::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::start_message_move_task::StartMessageMoveTaskOutput,
106 crate::operation::start_message_move_task::StartMessageMoveTaskError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <p>The ARN of the queue that contains the messages to be moved to another queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS queues, such as Lambda or Amazon SNS topics, are not currently supported.</p>
121 pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.source_arn(input.into());
123 self
124 }
125 /// <p>The ARN of the queue that contains the messages to be moved to another queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS queues, such as Lambda or Amazon SNS topics, are not currently supported.</p>
126 pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_source_arn(input);
128 self
129 }
130 /// <p>The ARN of the queue that contains the messages to be moved to another queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS queues, such as Lambda or Amazon SNS topics, are not currently supported.</p>
131 pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_source_arn()
133 }
134 /// <p>The ARN of the queue that receives the moved messages. You can use this field to specify the destination queue where you would like to redrive messages. If this field is left blank, the messages will be redriven back to their respective original source queues.</p>
135 pub fn destination_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.destination_arn(input.into());
137 self
138 }
139 /// <p>The ARN of the queue that receives the moved messages. You can use this field to specify the destination queue where you would like to redrive messages. If this field is left blank, the messages will be redriven back to their respective original source queues.</p>
140 pub fn set_destination_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_destination_arn(input);
142 self
143 }
144 /// <p>The ARN of the queue that receives the moved messages. You can use this field to specify the destination queue where you would like to redrive messages. If this field is left blank, the messages will be redriven back to their respective original source queues.</p>
145 pub fn get_destination_arn(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_destination_arn()
147 }
148 /// <p>The number of messages to be moved per second (the message movement rate). You can use this field to define a fixed message movement rate. The maximum value for messages per second is 500. If this field is left blank, the system will optimize the rate based on the queue message backlog size, which may vary throughout the duration of the message movement task.</p>
149 pub fn max_number_of_messages_per_second(mut self, input: i32) -> Self {
150 self.inner = self.inner.max_number_of_messages_per_second(input);
151 self
152 }
153 /// <p>The number of messages to be moved per second (the message movement rate). You can use this field to define a fixed message movement rate. The maximum value for messages per second is 500. If this field is left blank, the system will optimize the rate based on the queue message backlog size, which may vary throughout the duration of the message movement task.</p>
154 pub fn set_max_number_of_messages_per_second(mut self, input: ::std::option::Option<i32>) -> Self {
155 self.inner = self.inner.set_max_number_of_messages_per_second(input);
156 self
157 }
158 /// <p>The number of messages to be moved per second (the message movement rate). You can use this field to define a fixed message movement rate. The maximum value for messages per second is 500. If this field is left blank, the system will optimize the rate based on the queue message backlog size, which may vary throughout the duration of the message movement task.</p>
159 pub fn get_max_number_of_messages_per_second(&self) -> &::std::option::Option<i32> {
160 self.inner.get_max_number_of_messages_per_second()
161 }
162}