Retrieves the raw content of an in-transit email message, in MIME format.
Parameters:
-
message_id
(messageIdType)
–
The identifier of the email message to retrieve.
Raises:
Source code in docs_src/capo_workmailmessageflow/_services/async_work_mail_message_flow.py
| @asynccontextmanager
async def get_raw_message_content(
self,
message_id: "capo_workmailmessageflow.types.message_id_type.messageIdType",
*,
config_overrides: Optional[AsyncWorkMailMessageFlowClientConfig] = None,
) -> "AsyncGenerator[capo_workmailmessageflow.types.get_raw_message_content_response.GetRawMessageContentResponse]":
"""<p>Retrieves the raw content of an in-transit email message, in MIME format.</p>
Args:
message_id: <p>The identifier of the email message to retrieve.</p>
Raises:
capo_workmailmessageflow.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested email message is not found.</p>
capo_workmailmessageflow.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_workmailmessageflow.types.get_raw_message_content_request.GetRawMessageContentRequest]",
) -> AsyncOperationResponse[
"capo_workmailmessageflow.types.get_raw_message_content_response.GetRawMessageContentResponse"
]:
import capo_workmailmessageflow._operations.giraffe_message_in_transit_service.get_raw_message_content
(
output,
http_response,
) = await capo_workmailmessageflow._operations.giraffe_message_in_transit_service.get_raw_message_content.async_get_raw_message_content(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_workmailmessageflow.types.get_raw_message_content_response.GetRawMessageContentResponse",
) -> dict[str, Any]:
import capo_workmailmessageflow.types.get_raw_message_content_response
return capo_workmailmessageflow.types.get_raw_message_content_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetRawMessageContent", redact_output=_redact_output),
)
input_: capo_workmailmessageflow.types.get_raw_message_content_request.GetRawMessageContentRequest = {
"message_id": message_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
try:
yield response.output
finally:
await response.response.aclose()
|