:doc:`MailManager <../../mailmanager>` / Client / start_archive_export

********************
start_archive_export
********************



.. py:method:: MailManager.Client.start_archive_export(**kwargs)

  

  Initiates an export of emails from the specified archive.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mailmanager-2023-10-17/StartArchiveExport>`_  


  **Request Syntax**
  ::

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

    The identifier of the archive to export emails from.

    

  
  :type Filters: dict
  :param Filters: 

    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: ``StringExpression``, ``BooleanExpression``. 

      
        - **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) --* 

            
        
        
        - **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.

            

          
        
      
  
    - **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: ``StringExpression``, ``BooleanExpression``. 

      
        - **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) --* 

            
        
        
        - **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.

            

          
        
      
  
  
  :type FromTimestamp: datetime
  :param FromTimestamp: **[REQUIRED]** 

    The start of the timestamp range to include emails from.

    

  
  :type ToTimestamp: datetime
  :param ToTimestamp: **[REQUIRED]** 

    The end of the timestamp range to include emails from.

    

  
  :type MaxResults: integer
  :param MaxResults: 

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

    

  
  :type ExportDestinationConfiguration: dict
  :param ExportDestinationConfiguration: **[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.

        

      
    
  
  :type IncludeMetadata: boolean
  :param IncludeMetadata: 

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

    

  
  
  :rtype: 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**
  
  *   :py:class:`MailManager.Client.exceptions.ValidationException`

  
  *   :py:class:`MailManager.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`MailManager.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`MailManager.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`MailManager.Client.exceptions.ThrottlingException`

  