A low-level client representing Amazon WorkMail Message Flow
The WorkMail Message Flow API provides access to email messages as they are being sent and received by a WorkMail organization.
client = session.create_client('workmailmessageflow')
These are the available methods:
Check if an operation can be paginated.
operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo
, and you’d normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.
True
if the operation can be paginated,
False
otherwise.
Closes underlying endpoint connections.
Create a paginator for an operation.
operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo
, and you’d normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.
OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate
method to
check if an operation is pageable.
L{botocore.paginate.Paginator}
A paginator object.
Retrieves the raw content of an in-transit email message, in MIME format.
See also: AWS API Documentation
Request Syntax
response = client.get_raw_message_content(
messageId='string'
)
messageId (string) –
[REQUIRED]
The identifier of the email message to retrieve.
dict
Response Syntax
{
'messageContent': StreamingBody()
}
Response Structure
(dict) –
messageContent (StreamingBody
) –
The raw content of the email message, in MIME format.
Exceptions
Returns an object that can wait for some condition.
waiter_name (str) – The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
The specified waiter object.
botocore.waiter.Waiter
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 .
Note
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 call PutRawMessageContent
on a delivered or sent message, the message remains unchanged, even though GetRawMessageContent returns an updated message.
See also: AWS API Documentation
Request Syntax
response = client.put_raw_message_content(
messageId='string',
content={
's3Reference': {
'bucket': 'string',
'key': 'string',
'objectVersion': 'string'
}
}
)
messageId (string) –
[REQUIRED]
The identifier of the email message being updated.
content (dict) –
[REQUIRED]
Describes the raw message content of the updated email message.
s3Reference (dict) – [REQUIRED]
The S3 reference of an email message.
bucket (string) – [REQUIRED]
The S3 bucket name.
key (string) – [REQUIRED]
The S3 key object name.
objectVersion (string) –
If you enable versioning for the bucket, you can specify the object version.
dict
Response Syntax
{}
Response Structure
(dict) –
Exceptions
Client exceptions are available on a client instance via the exceptions
property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
WorkMailMessageFlow.Client.exceptions.InvalidContentLocation
WorkMailMessageFlow.Client.exceptions.ResourceNotFoundException
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 .
Example
try:
...
except client.exceptions.InvalidContentLocation as e:
print(e.response)
The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
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 .
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
The requested email is not eligible for update. This is usually the case for a redirected email.
Example
try:
...
except client.exceptions.MessageFrozen as e:
print(e.response)
The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
The requested email is not eligible for update. This is usually the case for a redirected email.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
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.
Example
try:
...
except client.exceptions.MessageRejected as e:
print(e.response)
The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
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.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
The requested email message is not found.
Example
try:
...
except client.exceptions.ResourceNotFoundException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) –
The requested email message is not found.
message (string) –
Error (dict) – Normalized access to common exception attributes.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
The available paginators are: