Skip to content

start_archive_export async

start_archive_export(
    archive_id: ArchiveId,
    from_timestamp: datetime,
    to_timestamp: datetime,
    export_destination_configuration: ExportDestinationConfiguration,
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
    filters: Optional[ArchiveFilters] = None,
    max_results: Optional[ExportMaxResults] = None,
    include_metadata: Optional[bool] = None,
) -> StartArchiveExportResponse

Initiates an export of emails from the specified archive.

Parameters:

  • archive_id (ArchiveId) –

    The identifier of the archive to export emails from.

  • filters (Optional[ArchiveFilters], default: None ) –

    Criteria to filter which emails are included in the export.

  • from_timestamp (datetime) –

    The start of the timestamp range to include emails from.

  • to_timestamp (datetime) –

    The end of the timestamp range to include emails from.

  • max_results (Optional[ExportMaxResults], default: None ) –

    The maximum number of email items to include in the export.

  • export_destination_configuration (ExportDestinationConfiguration) –

    Details on where to deliver the exported email data.

  • include_metadata (Optional[bool], default: None ) –

    Whether to include message metadata as JSON files in the export.

Raises:

Source code in docs_src/capo_mailmanager/_services/async_mail_manager.py
async def start_archive_export(
    self,
    archive_id: "capo_mailmanager.types.archive_id.ArchiveId",
    from_timestamp: datetime.datetime,
    to_timestamp: datetime.datetime,
    export_destination_configuration: "capo_mailmanager.types.export_destination_configuration.ExportDestinationConfiguration",
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
    filters: Optional[
        "capo_mailmanager.types.archive_filters.ArchiveFilters"
    ] = None,
    max_results: Optional[
        "capo_mailmanager.types.export_max_results.ExportMaxResults"
    ] = None,
    include_metadata: Optional[bool] = None,
) -> "capo_mailmanager.types.start_archive_export_response.StartArchiveExportResponse":
    """<p>Initiates an export of emails from the specified archive.</p>

    Args:
        archive_id: <p>The identifier of the archive to export emails from.</p>
        filters: <p>Criteria to filter which emails are included in the export.</p>
        from_timestamp: <p>The start of the timestamp range to include emails from.</p>
        to_timestamp: <p>The end of the timestamp range to include emails from.</p>
        max_results: <p>The maximum number of email items to include in the export.</p>
        export_destination_configuration: <p>Details on where to deliver the exported email data.</p>
        include_metadata: <p>Whether to include message metadata as JSON files in the export.</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.resource_not_found_exception.ResourceNotFoundException: <p>Occurs when a requested resource is not found.</p>
        capo_mailmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Occurs when an operation exceeds a predefined service quota or limit.</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.start_archive_export_request.StartArchiveExportRequest]",
    ) -> AsyncOperationResponse[
        "capo_mailmanager.types.start_archive_export_response.StartArchiveExportResponse"
    ]:
        import capo_mailmanager._operations.mail_manager_svc.start_archive_export

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartArchiveExport")
    )
    input_: capo_mailmanager.types.start_archive_export_request.StartArchiveExportRequest = {
        "archive_id": archive_id,
        "from_timestamp": from_timestamp,
        "to_timestamp": to_timestamp,
        "export_destination_configuration": export_destination_configuration,
    }
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if include_metadata is not None:
        input_["include_metadata"] = include_metadata

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