Skip to content

cancel_mailbox_export_job

cancel_mailbox_export_job(
    client_token: IdempotencyClientToken,
    job_id: MailboxExportJobId,
    organization_id: OrganizationId,
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> CancelMailboxExportJobResponse

Cancels a mailbox export job.

If the mailbox export job is near completion, it might not be possible to cancel it.

Parameters:

Raises:

Source code in docs_src/capo_workmail/_services/work_mail.py
def cancel_mailbox_export_job(
    self,
    client_token: "capo_workmail.types.idempotency_client_token.IdempotencyClientToken",
    job_id: "capo_workmail.types.mailbox_export_job_id.MailboxExportJobId",
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> "capo_workmail.types.cancel_mailbox_export_job_response.CancelMailboxExportJobResponse":
    """<p>Cancels a mailbox export job.</p> <note> <p>If the mailbox export job is near completion, it might not be possible to cancel it.</p> </note>

    Args:
        client_token: <p>The idempotency token for the client request.</p>
        job_id: <p>The job ID.</p>
        organization_id: <p>The organization ID.</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.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.cancel_mailbox_export_job_request.CancelMailboxExportJobRequest]",
    ) -> OperationResponse[
        "capo_workmail.types.cancel_mailbox_export_job_response.CancelMailboxExportJobResponse"
    ]:
        import capo_workmail._operations.work_mail_service.cancel_mailbox_export_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelMailboxExportJob")
    )
    input_: capo_workmail.types.cancel_mailbox_export_job_request.CancelMailboxExportJobRequest = {
        "client_token": client_token,
        "job_id": job_id,
        "organization_id": organization_id,
    }

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