aws_sdk_sqs/operation/change_message_visibility/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::change_message_visibility::_change_message_visibility_output::ChangeMessageVisibilityOutputBuilder;
3
4pub use crate::operation::change_message_visibility::_change_message_visibility_input::ChangeMessageVisibilityInputBuilder;
5
6impl crate::operation::change_message_visibility::builders::ChangeMessageVisibilityInputBuilder {
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::change_message_visibility::ChangeMessageVisibilityOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::change_message_visibility::ChangeMessageVisibilityError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.change_message_visibility();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ChangeMessageVisibility`.
24///
25/// <p>Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
26/// <p>For example, if the default timeout for a queue is 60 seconds, 15 seconds have elapsed since you received the message, and you send a ChangeMessageVisibility call with <code>VisibilityTimeout</code> set to 10 seconds, the 10 seconds begin to count from the time that you make the <code>ChangeMessageVisibility</code> call. Thus, any attempt to change the visibility timeout or to delete that message 10 seconds after you initially change the visibility timeout (a total of 25 seconds) might result in an error.</p>
27/// <p>An Amazon SQS message has three basic states:</p>
28/// <ol>
29/// <li>
30/// <p>Sent to a queue by a producer.</p></li>
31/// <li>
32/// <p>Received from the queue by a consumer.</p></li>
33/// <li>
34/// <p>Deleted from the queue.</p></li>
35/// </ol>
36/// <p>A message is considered to be <i>stored</i> after it is sent to a queue by a producer, but not yet received from the queue by a consumer (that is, between states 1 and 2). There is no limit to the number of stored messages. A message is considered to be <i>in flight</i> after it is received from a queue by a consumer, but not yet deleted from the queue (that is, between states 2 and 3). There is a limit to the number of in flight messages.</p>
37/// <p>Limits that apply to in flight messages are unrelated to the <i>unlimited</i> number of stored messages.</p>
38/// <p>For most standard queues (depending on queue traffic and message backlog), there can be a maximum of approximately 120,000 in flight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns the <code>OverLimit</code> error message. To avoid reaching the limit, you should delete messages from the queue after they're processed. You can also increase the number of queues you use to process your messages. To request a limit increase, <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sqs">file a support request</a>.</p>
39/// <p>For FIFO queues, there can be a maximum of 120,000 in flight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns no error messages.</p><important>
40/// <p>If you attempt to set the <code>VisibilityTimeout</code> to a value greater than the maximum time left, Amazon SQS returns an error. Amazon SQS doesn't automatically recalculate and increase the timeout to the maximum remaining time.</p>
41/// <p>Unlike with a queue, when you change the visibility timeout for a specific message the timeout value is applied immediately but isn't saved in memory for that message. If you don't delete a message after it is received, the visibility timeout for the message reverts to the original timeout value (not to the value you set using the <code>ChangeMessageVisibility</code> action) the next time the message is received.</p>
42/// </important>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct ChangeMessageVisibilityFluentBuilder {
45 handle: ::std::sync::Arc<crate::client::Handle>,
46 inner: crate::operation::change_message_visibility::builders::ChangeMessageVisibilityInputBuilder,
47 config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50 crate::client::customize::internal::CustomizableSend<
51 crate::operation::change_message_visibility::ChangeMessageVisibilityOutput,
52 crate::operation::change_message_visibility::ChangeMessageVisibilityError,
53 > for ChangeMessageVisibilityFluentBuilder
54{
55 fn send(
56 self,
57 config_override: crate::config::Builder,
58 ) -> crate::client::customize::internal::BoxFuture<
59 crate::client::customize::internal::SendResult<
60 crate::operation::change_message_visibility::ChangeMessageVisibilityOutput,
61 crate::operation::change_message_visibility::ChangeMessageVisibilityError,
62 >,
63 > {
64 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65 }
66}
67impl ChangeMessageVisibilityFluentBuilder {
68 /// Creates a new `ChangeMessageVisibilityFluentBuilder`.
69 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70 Self {
71 handle,
72 inner: ::std::default::Default::default(),
73 config_override: ::std::option::Option::None,
74 }
75 }
76 /// Access the ChangeMessageVisibility as a reference.
77 pub fn as_input(&self) -> &crate::operation::change_message_visibility::builders::ChangeMessageVisibilityInputBuilder {
78 &self.inner
79 }
80 /// Sends the request and returns the response.
81 ///
82 /// If an error occurs, an `SdkError` will be returned with additional details that
83 /// can be matched against.
84 ///
85 /// By default, any retryable failures will be retried twice. Retry behavior
86 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87 /// set when configuring the client.
88 pub async fn send(
89 self,
90 ) -> ::std::result::Result<
91 crate::operation::change_message_visibility::ChangeMessageVisibilityOutput,
92 ::aws_smithy_runtime_api::client::result::SdkError<
93 crate::operation::change_message_visibility::ChangeMessageVisibilityError,
94 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95 >,
96 > {
97 let input = self
98 .inner
99 .build()
100 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101 let runtime_plugins = crate::operation::change_message_visibility::ChangeMessageVisibility::operation_runtime_plugins(
102 self.handle.runtime_plugins.clone(),
103 &self.handle.conf,
104 self.config_override,
105 );
106 crate::operation::change_message_visibility::ChangeMessageVisibility::orchestrate(&runtime_plugins, input).await
107 }
108
109 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110 pub fn customize(
111 self,
112 ) -> crate::client::customize::CustomizableOperation<
113 crate::operation::change_message_visibility::ChangeMessageVisibilityOutput,
114 crate::operation::change_message_visibility::ChangeMessageVisibilityError,
115 Self,
116 > {
117 crate::client::customize::CustomizableOperation::new(self)
118 }
119 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120 self.set_config_override(::std::option::Option::Some(config_override.into()));
121 self
122 }
123
124 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125 self.config_override = config_override;
126 self
127 }
128 /// <p>The URL of the Amazon SQS queue whose message's visibility is changed.</p>
129 /// <p>Queue URLs and names are case-sensitive.</p>
130 pub fn queue_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.queue_url(input.into());
132 self
133 }
134 /// <p>The URL of the Amazon SQS queue whose message's visibility is changed.</p>
135 /// <p>Queue URLs and names are case-sensitive.</p>
136 pub fn set_queue_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_queue_url(input);
138 self
139 }
140 /// <p>The URL of the Amazon SQS queue whose message's visibility is changed.</p>
141 /// <p>Queue URLs and names are case-sensitive.</p>
142 pub fn get_queue_url(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_queue_url()
144 }
145 /// <p>The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the <code> <code>ReceiveMessage</code> </code> action.</p>
146 pub fn receipt_handle(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.receipt_handle(input.into());
148 self
149 }
150 /// <p>The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the <code> <code>ReceiveMessage</code> </code> action.</p>
151 pub fn set_receipt_handle(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_receipt_handle(input);
153 self
154 }
155 /// <p>The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the <code> <code>ReceiveMessage</code> </code> action.</p>
156 pub fn get_receipt_handle(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_receipt_handle()
158 }
159 /// <p>The new value for the message's visibility timeout (in seconds). Values range: <code>0</code> to <code>43200</code>. Maximum: 12 hours.</p>
160 pub fn visibility_timeout(mut self, input: i32) -> Self {
161 self.inner = self.inner.visibility_timeout(input);
162 self
163 }
164 /// <p>The new value for the message's visibility timeout (in seconds). Values range: <code>0</code> to <code>43200</code>. Maximum: 12 hours.</p>
165 pub fn set_visibility_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
166 self.inner = self.inner.set_visibility_timeout(input);
167 self
168 }
169 /// <p>The new value for the message's visibility timeout (in seconds). Values range: <code>0</code> to <code>43200</code>. Maximum: 12 hours.</p>
170 pub fn get_visibility_timeout(&self) -> &::std::option::Option<i32> {
171 self.inner.get_visibility_timeout()
172 }
173}