// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::delete_message::_delete_message_input::DeleteMessageInputBuilder;
pub use crate::operation::delete_message::_delete_message_output::DeleteMessageOutputBuilder;
impl crate::operation::delete_message::builders::DeleteMessageInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::delete_message::DeleteMessageOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::delete_message::DeleteMessageError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.delete_message();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `DeleteMessage`.
///
/// <p>Deletes the specified message from the specified queue. To select the message to delete, use the <code>ReceiptHandle</code> of the message (<i>not</i> the <code>MessageId</code> which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue.</p><note>
/// <p>Each time you receive a message, meaning when a consumer retrieves a message from the queue, it comes with a unique <code>ReceiptHandle</code>. If you receive the same message more than once, you will get a different <code>ReceiptHandle</code> each time. When you want to delete a message using the <code>DeleteMessage</code> action, you must use the <code>ReceiptHandle</code> from the most recent time you received the message. If you use an old <code>ReceiptHandle</code>, the request will succeed, but the message might not be deleted.</p>
/// <p>For standard queues, it is possible to receive a message even after you delete it. This might happen on rare occasions if one of the servers which stores a copy of the message is unavailable when you send the request to delete the message. The copy remains on the server and might be returned to you during a subsequent receive request. You should ensure that your application is idempotent, so that receiving a message more than once does not cause issues.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DeleteMessageFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::delete_message::builders::DeleteMessageInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::delete_message::DeleteMessageOutput,
crate::operation::delete_message::DeleteMessageError,
> for DeleteMessageFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::delete_message::DeleteMessageOutput,
crate::operation::delete_message::DeleteMessageError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl DeleteMessageFluentBuilder {
/// Creates a new `DeleteMessageFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the DeleteMessage as a reference.
pub fn as_input(&self) -> &crate::operation::delete_message::builders::DeleteMessageInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::delete_message::DeleteMessageOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::delete_message::DeleteMessageError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::delete_message::DeleteMessage::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::delete_message::DeleteMessage::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::delete_message::DeleteMessageOutput,
crate::operation::delete_message::DeleteMessageError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The URL of the Amazon SQS queue from which messages are deleted.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn queue_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.queue_url(input.into());
self
}
/// <p>The URL of the Amazon SQS queue from which messages are deleted.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn set_queue_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_queue_url(input);
self
}
/// <p>The URL of the Amazon SQS queue from which messages are deleted.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn get_queue_url(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_queue_url()
}
/// <p>The receipt handle associated with the message to delete.</p>
pub fn receipt_handle(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.receipt_handle(input.into());
self
}
/// <p>The receipt handle associated with the message to delete.</p>
pub fn set_receipt_handle(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_receipt_handle(input);
self
}
/// <p>The receipt handle associated with the message to delete.</p>
pub fn get_receipt_handle(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_receipt_handle()
}
}