Skip to content

get_archive_message async

get_archive_message(
    archived_message_id: ArchivedMessageId,
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
) -> GetArchiveMessageResponse

Returns a pre-signed URL that provides temporary download access to the specific email message stored in the archive.

Parameters:

  • archived_message_id (ArchivedMessageId) –

    The unique identifier of the archived email message.

Raises:

  • AccessDeniedException –

    Occurs when a user is denied access to a specific resource or action.

  • ThrottlingException –

    Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.

  • ValidationException –

    The request validation has failed. For details, see the accompanying error message.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mailmanager/_services/async_mail_manager.py
async def get_archive_message(
    self,
    archived_message_id: "capo_mailmanager.types.archived_message_id.ArchivedMessageId",
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
) -> (
    "capo_mailmanager.types.get_archive_message_response.GetArchiveMessageResponse"
):
    """<p>Returns a pre-signed URL that provides temporary download access to the specific email message stored in the archive. </p>

    Args:
        archived_message_id: <p>The unique identifier of the archived email message.</p>

    Raises:
        capo_mailmanager.errors.access_denied_exception.AccessDeniedException: <p>Occurs when a user is denied access to a specific resource or action.</p>
        capo_mailmanager.errors.throttling_exception.ThrottlingException: <p>Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.</p>
        capo_mailmanager.errors.validation_exception.ValidationException: <p>The request validation has failed. For details, see the accompanying error message.</p>
        capo_mailmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mailmanager.types.get_archive_message_request.GetArchiveMessageRequest]",
    ) -> AsyncOperationResponse[
        "capo_mailmanager.types.get_archive_message_response.GetArchiveMessageResponse"
    ]:
        import capo_mailmanager._operations.mail_manager_svc.get_archive_message

        (
            output,
            http_response,
        ) = await capo_mailmanager._operations.mail_manager_svc.get_archive_message.async_get_archive_message(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_mailmanager.types.get_archive_message_response.GetArchiveMessageResponse",
    ) -> dict[str, Any]:
        import capo_mailmanager.types.get_archive_message_response

        return capo_mailmanager.types.get_archive_message_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetArchiveMessage", redact_output=_redact_output),
    )
    input_: capo_mailmanager.types.get_archive_message_request.GetArchiveMessageRequest = {
        "archived_message_id": archived_message_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output