Automattic\WooCommerce\Admin\API

AnalyticsImports::get_status_schemapublicWC 1.0

Get the schema for the status endpoint, conforming to JSON Schema.

Method of the class: AnalyticsImports{}

No Hooks.

Returns

Array.

Usage

$AnalyticsImports = new AnalyticsImports();
$AnalyticsImports->get_status_schema();

AnalyticsImports::get_status_schema() code WC 10.5.0

public function get_status_schema() {
	$schema = array(
		'$schema'    => 'https://json-schema.org/draft-04/schema#',
		'title'      => 'analytics_import_status',
		'type'       => 'object',
		'properties' => array(
			'mode'                      => array(
				'type'        => 'string',
				'enum'        => array( 'scheduled', 'immediate' ),
				'description' => __( 'Current import mode.', 'woocommerce' ),
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'last_processed_date'       => array(
				'type'        => array( 'string', 'null' ),
				'description' => __( 'Last processed order date (null in immediate mode).', 'woocommerce' ),
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'next_scheduled'            => array(
				'type'        => array( 'string', 'null' ),
				'description' => __( 'Next scheduled import time (null in immediate mode).', 'woocommerce' ),
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'import_in_progress_or_due' => array(
				'type'        => array( 'boolean', 'null' ),
				'description' => __( 'Whether a batch import is currently running or scheduled to run within the next minute (null in immediate mode).', 'woocommerce' ),
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
		),
	);

	return $this->add_additional_fields_schema( $schema );
}