Interface WorkMailMessageFlowAsyncClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.The asynchronous client performs non-blocking I/O when configured with any
invalid reference
SdkAsyncHttpClient
The WorkMail Message Flow API provides access to email messages as they are being sent and received by a WorkMail organization.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder that can be used to configure and create aWorkMailMessageFlowAsyncClient
.create()
Create aWorkMailMessageFlowAsyncClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.getRawMessageContent
(Consumer<GetRawMessageContentRequest.Builder> getRawMessageContentRequest, Path destinationPath) Retrieves the raw content of an in-transit email message, in MIME format.default <ReturnT> CompletableFuture
<ReturnT> getRawMessageContent
(Consumer<GetRawMessageContentRequest.Builder> getRawMessageContentRequest, AsyncResponseTransformer<GetRawMessageContentResponse, ReturnT> asyncResponseTransformer) Retrieves the raw content of an in-transit email message, in MIME format.getRawMessageContent
(GetRawMessageContentRequest getRawMessageContentRequest, Path destinationPath) Retrieves the raw content of an in-transit email message, in MIME format.default <ReturnT> CompletableFuture
<ReturnT> getRawMessageContent
(GetRawMessageContentRequest getRawMessageContentRequest, AsyncResponseTransformer<GetRawMessageContentResponse, ReturnT> asyncResponseTransformer) Retrieves the raw content of an in-transit email message, in MIME format.putRawMessageContent
(Consumer<PutRawMessageContentRequest.Builder> putRawMessageContentRequest) Updates the raw content of an in-transit email message, in MIME format.putRawMessageContent
(PutRawMessageContentRequest putRawMessageContentRequest) Updates the raw content of an in-transit email message, in MIME format.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
getRawMessageContent
default <ReturnT> CompletableFuture<ReturnT> getRawMessageContent(GetRawMessageContentRequest getRawMessageContentRequest, AsyncResponseTransformer<GetRawMessageContentResponse, ReturnT> asyncResponseTransformer) Retrieves the raw content of an in-transit email message, in MIME format.
- Parameters:
getRawMessageContentRequest
-asyncResponseTransformer
- The response transformer for processing the streaming response in a non-blocking manner. SeeAsyncResponseTransformer
for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'The raw content of the email message, in MIME format.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getRawMessageContent
default <ReturnT> CompletableFuture<ReturnT> getRawMessageContent(Consumer<GetRawMessageContentRequest.Builder> getRawMessageContentRequest, AsyncResponseTransformer<GetRawMessageContentResponse, ReturnT> asyncResponseTransformer) Retrieves the raw content of an in-transit email message, in MIME format.
This is a convenience which creates an instance of the
GetRawMessageContentRequest.Builder
avoiding the need to create one manually viaGetRawMessageContentRequest.builder()
- Parameters:
getRawMessageContentRequest
- AConsumer
that will call methods onGetRawMessageContentRequest.Builder
to create a request.asyncResponseTransformer
- The response transformer for processing the streaming response in a non-blocking manner. SeeAsyncResponseTransformer
for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'The raw content of the email message, in MIME format.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getRawMessageContent
default CompletableFuture<GetRawMessageContentResponse> getRawMessageContent(GetRawMessageContentRequest getRawMessageContentRequest, Path destinationPath) Retrieves the raw content of an in-transit email message, in MIME format.
- Parameters:
getRawMessageContentRequest
-destinationPath
-Path
to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'The raw content of the email message, in MIME format.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getRawMessageContent
default CompletableFuture<GetRawMessageContentResponse> getRawMessageContent(Consumer<GetRawMessageContentRequest.Builder> getRawMessageContentRequest, Path destinationPath) Retrieves the raw content of an in-transit email message, in MIME format.
This is a convenience which creates an instance of the
GetRawMessageContentRequest.Builder
avoiding the need to create one manually viaGetRawMessageContentRequest.builder()
- Parameters:
getRawMessageContentRequest
- AConsumer
that will call methods onGetRawMessageContentRequest.Builder
to create a request.destinationPath
-Path
to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'The raw content of the email message, in MIME format.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putRawMessageContent
default CompletableFuture<PutRawMessageContentResponse> putRawMessageContent(PutRawMessageContentRequest putRawMessageContentRequest) Updates the raw content of an in-transit email message, in MIME format.
This example describes how to update in-transit email message. For more information and examples for using this API, see Updating message content with AWS Lambda.
Updates to an in-transit message only appear when you call
PutRawMessageContent
from an AWS Lambda function configured with a synchronous Run Lambda rule. If you callPutRawMessageContent
on a delivered or sent message, the message remains unchanged, even though GetRawMessageContent returns an updated message.- Parameters:
putRawMessageContentRequest
-- Returns:
- A Java Future containing the result of the PutRawMessageContent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- InvalidContentLocationException WorkMail could not access the updated email content. Possible
reasons:
-
You made the request in a region other than your S3 bucket region.
-
The S3 bucket owner is not the same as the calling AWS account.
-
You have an incomplete or missing S3 bucket policy. For more information about policies, see Updating message content with AWS Lambda in the WorkMail Administrator Guide.
-
- MessageRejectedException The requested email could not be updated due to an error in the MIME content. Check the error message for more information about what caused the error.
- MessageFrozenException The requested email is not eligible for update. This is usually the case for a redirected email.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putRawMessageContent
default CompletableFuture<PutRawMessageContentResponse> putRawMessageContent(Consumer<PutRawMessageContentRequest.Builder> putRawMessageContentRequest) Updates the raw content of an in-transit email message, in MIME format.
This example describes how to update in-transit email message. For more information and examples for using this API, see Updating message content with AWS Lambda.
Updates to an in-transit message only appear when you call
PutRawMessageContent
from an AWS Lambda function configured with a synchronous Run Lambda rule. If you callPutRawMessageContent
on a delivered or sent message, the message remains unchanged, even though GetRawMessageContent returns an updated message.
This is a convenience which creates an instance of the
PutRawMessageContentRequest.Builder
avoiding the need to create one manually viaPutRawMessageContentRequest.builder()
- Parameters:
putRawMessageContentRequest
- AConsumer
that will call methods onPutRawMessageContentRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the PutRawMessageContent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The requested email message is not found.
- InvalidContentLocationException WorkMail could not access the updated email content. Possible
reasons:
-
You made the request in a region other than your S3 bucket region.
-
The S3 bucket owner is not the same as the calling AWS account.
-
You have an incomplete or missing S3 bucket policy. For more information about policies, see Updating message content with AWS Lambda in the WorkMail Administrator Guide.
-
- MessageRejectedException The requested email could not be updated due to an error in the MIME content. Check the error message for more information about what caused the error.
- MessageFrozenException The requested email is not eligible for update. This is usually the case for a redirected email.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- WorkMailMessageFlowException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-
create
Create aWorkMailMessageFlowAsyncClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aWorkMailMessageFlowAsyncClient
.
-