enum Effect {
  allow,
  deny,
}

extension EffectExtension on Effect {
  String toShortString() => toString().split('.').last;

  static Effect fromString(String value) => Effect.values.firstWhere(
    (e) => e.toShortString() == value,
    orElse: () => throw ArgumentError('Invalid effect: $value'),
  );
}
