*/ protected function input_properties(): array { return array( 'limit' => array( 'type' => 'integer', 'default' => 50, 'minimum' => 1, 'maximum' => 200, 'description' => __( 'How many coupons to return.', 'acrossai-abilities-manager' ) ), ); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'coupons' => array( 'type' => 'array', 'items' => array( 'type' => 'object', 'additionalProperties' => true ) ), 'count' => array( 'type' => 'integer' ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { return Config_Repository::list_coupons( (int) ( $input['limit'] ?? 50 ) ); } }