Skip to content

start_mailbox_export_job

start_mailbox_export_job(
    client_token: IdempotencyClientToken,
    organization_id: OrganizationId,
    entity_id: EntityIdentifier,
    role_arn: RoleArn,
    kms_key_arn: KmsKeyArn,
    s3_bucket_name: S3BucketName,
    s3_prefix: S3ObjectKey,
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
    description: Optional[Description] = None,
) -> StartMailboxExportJobResponse

Starts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Exporting mailbox content in the WorkMail Administrator Guide.

Parameters:

  • client_token (IdempotencyClientToken) –

    The idempotency token for the client request.

  • organization_id (OrganizationId) –

    The identifier associated with the organization.

  • entity_id (EntityIdentifier) –

    The identifier of the user or resource associated with the mailbox.

    The identifier can accept UserId or ResourceId, Username or Resourcename, or email. The following identity formats are available:

    • Entity ID: 12345678-1234-1234-1234-123456789012, r-0123456789a0123456789b0123456789 , or S-1-1-12-1234567890-123456789-123456789-1234

    • Email address: [email protected]

    • Entity name: entity

  • description (Optional[Description], default: None ) –

    The mailbox export job description.

  • role_arn (RoleArn) –

    The ARN of the AWS Identity and Access Management (IAM) role that grants write permission to the S3 bucket.

  • kms_key_arn (KmsKeyArn) –

    The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS KMS) key that encrypts the exported mailbox content.

  • s3_bucket_name (S3BucketName) –

    The name of the S3 bucket.

  • s3_prefix (S3ObjectKey) –

    The S3 bucket prefix.

Raises:

Source code in docs_src/capo_workmail/_services/work_mail.py
def start_mailbox_export_job(
    self,
    client_token: "capo_workmail.types.idempotency_client_token.IdempotencyClientToken",
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    entity_id: "capo_workmail.types.entity_identifier.EntityIdentifier",
    role_arn: "capo_workmail.types.role_arn.RoleArn",
    kms_key_arn: "capo_workmail.types.kms_key_arn.KmsKeyArn",
    s3_bucket_name: "capo_workmail.types.s3_bucket_name.S3BucketName",
    s3_prefix: "capo_workmail.types.s3_object_key.S3ObjectKey",
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
    description: Optional["capo_workmail.types.description.Description"] = None,
) -> "capo_workmail.types.start_mailbox_export_job_response.StartMailboxExportJobResponse":
    """<p>Starts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket. For more information, see <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/mail-export.html">Exporting mailbox content</a> in the <i>WorkMail Administrator Guide</i>.</p>

    Args:
        client_token: <p>The idempotency token for the client request.</p>
        organization_id: <p>The identifier associated with the organization.</p>
        entity_id: <p>The identifier of the user or resource associated with the mailbox.</p> <p>The identifier can accept <i>UserId or ResourceId</i>, <i>Username or Resourcename</i>, or <i>email</i>. The following identity formats are available:</p> <ul> <li> <p>Entity ID: 12345678-1234-1234-1234-123456789012, r-0123456789a0123456789b0123456789 , or S-1-1-12-1234567890-123456789-123456789-1234</p> </li> <li> <p>Email address: [email protected]</p> </li> <li> <p>Entity name: entity</p> </li> </ul>
        description: <p>The mailbox export job description.</p>
        role_arn: <p>The ARN of the AWS Identity and Access Management (IAM) role that grants write permission to the S3 bucket.</p>
        kms_key_arn: <p>The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS KMS) key that encrypts the exported mailbox content.</p>
        s3_bucket_name: <p>The name of the S3 bucket.</p>
        s3_prefix: <p>The S3 bucket prefix.</p>

    Raises:
        capo_workmail.errors.entity_not_found_exception.EntityNotFoundException: <p>The identifier supplied for the user, group, or resource does not exist in your organization.</p>
        capo_workmail.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the input parameters don't match the service's restrictions.</p>
        capo_workmail.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeds the limit of the resource.</p>
        capo_workmail.errors.organization_not_found_exception.OrganizationNotFoundException: <p>An operation received a valid organization identifier that either doesn't belong or exist in the system.</p>
        capo_workmail.errors.organization_state_exception.OrganizationStateException: <p>The organization must have a valid state to perform certain operations on the organization or its members.</p>
        capo_workmail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workmail.types.start_mailbox_export_job_request.StartMailboxExportJobRequest]",
    ) -> OperationResponse[
        "capo_workmail.types.start_mailbox_export_job_response.StartMailboxExportJobResponse"
    ]:
        import capo_workmail._operations.work_mail_service.start_mailbox_export_job

        output, http_response = (
            capo_workmail._operations.work_mail_service.start_mailbox_export_job.start_mailbox_export_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMailboxExportJob")
    )
    input_: capo_workmail.types.start_mailbox_export_job_request.StartMailboxExportJobRequest = {
        "client_token": client_token,
        "organization_id": organization_id,
        "entity_id": entity_id,
        "role_arn": role_arn,
        "kms_key_arn": kms_key_arn,
        "s3_bucket_name": s3_bucket_name,
        "s3_prefix": s3_prefix,
    }
    if description is not None:
        input_["description"] = description

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output