Skip to content

Commit 9ff0917

Browse files
committed
model: Add ChannelPostPolicy.fromApiValue method
1 parent 8fee7b8 commit 9ff0917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/api/model/model.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ enum ChannelPostPolicy {
382382
final int? apiValue;
383383

384384
int? toJson() => apiValue;
385+
386+
static ChannelPostPolicy fromApiValue(int value) => _byIntValue[value]!;
387+
388+
static final _byIntValue = _$ChannelPostPolicyEnumMap
389+
.map((key, value) => MapEntry(value, key));
385390
}
386391

387392
/// As in `subscriptions` in the initial snapshot.

0 commit comments

Comments
 (0)