MailManager / Client / start_archive_export

start_archive_export#

MailManager.Client.start_archive_export(**kwargs)#

Initiates an export of emails from the specified archive.

See also: AWS API Documentation

Request Syntax

response = client.start_archive_export(
    ArchiveId='string',
    ExportDestinationConfiguration={
        'S3': {
            'S3Location': 'string'
        }
    },
    Filters={
        'Include': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ],
        'Unless': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ]
    },
    FromTimestamp=datetime(2015, 1, 1),
    IncludeMetadata=True|False,
    MaxResults=123,
    ToTimestamp=datetime(2015, 1, 1)
)
Parameters:
  • ArchiveId (string) –

    [REQUIRED]

    The identifier of the archive to export emails from.

  • ExportDestinationConfiguration (dict) –

    [REQUIRED]

    Details on where to deliver the exported email data.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: S3.

    • S3 (dict) –

      Configuration for delivering to an Amazon S3 bucket.

      • S3Location (string) –

        The S3 location to deliver the exported email data.

  • Filters (dict) –

    Criteria to filter which emails are included in the export.

    • Include (list) –

      The filter conditions for emails to include.

      • (dict) –

        A filter condition used to include or exclude emails when exporting from or searching an archive.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: BooleanExpression, StringExpression.

        • BooleanExpression (dict) –

          A boolean expression to evaluate against email attributes.

          • Evaluate (dict) – [REQUIRED]

            The email attribute value to evaluate.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

            • Attribute (string) –

              The name of the email attribute to evaluate.

          • Operator (string) – [REQUIRED]

            The boolean operator to use for evaluation.

        • StringExpression (dict) –

          A string expression to evaluate against email attributes.

          • Evaluate (dict) – [REQUIRED]

            The attribute of the email to evaluate.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

            • Attribute (string) –

              The name of the email attribute to evaluate.

          • Operator (string) – [REQUIRED]

            The operator to use when evaluating the string values.

          • Values (list) – [REQUIRED]

            The list of string values to evaluate the email attribute against.

            • (string) –

    • Unless (list) –

      The filter conditions for emails to exclude.

      • (dict) –

        A filter condition used to include or exclude emails when exporting from or searching an archive.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: BooleanExpression, StringExpression.

        • BooleanExpression (dict) –

          A boolean expression to evaluate against email attributes.

          • Evaluate (dict) – [REQUIRED]

            The email attribute value to evaluate.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

            • Attribute (string) –

              The name of the email attribute to evaluate.

          • Operator (string) – [REQUIRED]

            The boolean operator to use for evaluation.

        • StringExpression (dict) –

          A string expression to evaluate against email attributes.

          • Evaluate (dict) – [REQUIRED]

            The attribute of the email to evaluate.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: Attribute.

            • Attribute (string) –

              The name of the email attribute to evaluate.

          • Operator (string) – [REQUIRED]

            The operator to use when evaluating the string values.

          • Values (list) – [REQUIRED]

            The list of string values to evaluate the email attribute against.

            • (string) –

  • FromTimestamp (datetime) –

    [REQUIRED]

    The start of the timestamp range to include emails from.

  • IncludeMetadata (boolean) – Whether to include message metadata as JSON files in the export.

  • MaxResults (integer) – The maximum number of email items to include in the export.

  • ToTimestamp (datetime) –

    [REQUIRED]

    The end of the timestamp range to include emails from.

Return type:

dict

Returns:

Response Syntax

{
    'ExportId': 'string'
}

Response Structure

  • (dict) –

    The response from initiating an archive export.

    • ExportId (string) –

      The unique identifier for the initiated export job.

Exceptions

  • MailManager.Client.exceptions.ValidationException

  • MailManager.Client.exceptions.AccessDeniedException

  • MailManager.Client.exceptions.ServiceQuotaExceededException

  • MailManager.Client.exceptions.ResourceNotFoundException

  • MailManager.Client.exceptions.ThrottlingException