*/ protected function input_properties(): array { return array( 'limit' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 100, 'default' => 20, ), 'offset' => array( 'type' => 'integer', 'minimum' => 0, 'default' => 0, ), ); } /** * @since 0.0.35 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.35 * @return array */ protected function output_properties(): array { return array( 'backups' => array( 'type' => 'array', 'items' => array( 'type' => 'object', 'additionalProperties' => true ), ), 'count' => array( 'type' => 'integer' ), 'total' => array( 'type' => 'integer' ), ); } /** * @since 0.0.35 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.35 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { $limit = isset( $input['limit'] ) ? (int) $input['limit'] : 20; $offset = isset( $input['offset'] ) ? (int) $input['offset'] : 0; return Backup_Repository::list_backups( $limit, $offset ); } }