Skip to content

Commit 550bf2e

Browse files
committed
model: Add ChannelPostPolicy.fromApiValue method
1 parent fb18a96 commit 550bf2e

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) => _byApiValue[value]!;
387+
388+
static final _byApiValue = _$ChannelPostPolicyEnumMap
389+
.map((key, value) => MapEntry(value, key));
385390
}
386391

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

0 commit comments

Comments
 (0)