WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Import

Controller::cancel_import() public WC 1.0

Cancel all queued import actions.

{} It's a method of the class: Controller{}

No Hooks.

Return

WP_Error|WP_REST_Response. Nothing.

Usage

$Controller = new Controller();
$Controller->cancel_import( $request );
$request(WP_REST_Request) (required)
Request data.

Code of Controller::cancel_import() WC 5.2.2

<?php
public function cancel_import( $request ) {
	ReportsSync::clear_queued_actions();

	$result = array(
		'status'  => 'success',
		'message' => __( 'All pending and in-progress import actions have been cancelled.', 'woocommerce' ),
	);

	$response = $this->prepare_item_for_response( $result, $request );
	$data     = $this->prepare_response_for_collection( $response );

	return rest_ensure_response( $data );
}