Skip to content

Commit ea8d4a3

Browse files
committed
model: Add ChannelPostPolicy.fromApiValue method
1 parent 6deaa57 commit ea8d4a3

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)