Automattic\WooCommerce\Admin\API\AI

AIEndpoint{}WC 1.0

AI Endpoint base controller

No Hooks.

Usage

$AIEndpoint = new AIEndpoint();
// use class methods

Methods

  1. public get_schema()
  2. public register( $args )

AIEndpoint{} code WC 9.6.1

abstract class AIEndpoint {
	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc-admin';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'ai';


	/**
	 * Endpoint.
	 *
	 * @var string
	 */
	protected $endpoint;

	/**
	 * Register routes.
	 *
	 * @param array $args Optional. Either an array of options for the endpoint,
	 * or an array of arrays for multiple methods. Default empty array.
	 */
	public function register( $args ) {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/' . $this->endpoint,
			$args
		);
	}

	/**
	 * Return schema properties.
	 *
	 * @return array
	 */
	public function get_schema() {
		return array();
	}
}