import '../../marianumconnect_query.dart';

/// Removes this device's push subscription from MarianumConnect via
/// `DELETE /api/mobile/v1/me/push-device?deviceIdentifier=...`. Idempotent
/// (204 even when the row is already gone).
class PushDeviceUnregister extends MarianumConnectQuery {
  PushDeviceUnregister({super.dio});

  Future<void> run({required String deviceIdentifier}) => guard(() async {
    await dio.delete<void>(
      endpoint('me/push-device'),
      queryParameters: {'deviceIdentifier': deviceIdentifier},
    );
  });
}
