*/ protected function input_properties(): array { return array( 'key' => array( 'type' => 'string', 'description' => __( 'Backup key, as reported by aioseo/list-backups.', 'acrossai-abilities-manager' ), ), 'action' => array( 'type' => 'string', 'enum' => array( 'restore', 'delete' ), 'description' => __( 'Whether to restore this backup over the current settings, or delete it.', 'acrossai-abilities-manager' ), ), ); } /** * @since 0.0.44 * @return array */ protected function output_properties(): array { return array( 'key' => array( 'type' => 'string' ), 'action' => array( 'type' => 'string' ), 'remaining' => array( 'type' => 'integer' ), ); } /** * @since 0.0.44 * @return array */ protected function required_input(): array { return array( 'key', 'action' ); } /** * @since 0.0.44 * @return array{readonly: bool, destructive: bool, idempotent: bool} */ protected function annotations(): array { return array( 'readonly' => false, 'destructive' => true, 'idempotent' => false, ); } /** * @since 0.0.44 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { return Status_Repository::manage_backup( self::scalar( $input['key'] ?? '' ), self::scalar( $input['action'] ?? '' ) ); } }