implement keytoken list and all-messages list
This commit is contained in:
@@ -2,7 +2,7 @@ class KeyToken {
|
||||
final String keytokenID;
|
||||
final String name;
|
||||
final String timestampCreated;
|
||||
final String? timestampLastused;
|
||||
final String? timestampLastUsed;
|
||||
final String ownerUserID;
|
||||
final bool allChannels;
|
||||
final List<String> channels;
|
||||
@@ -13,7 +13,7 @@ class KeyToken {
|
||||
required this.keytokenID,
|
||||
required this.name,
|
||||
required this.timestampCreated,
|
||||
required this.timestampLastused,
|
||||
required this.timestampLastUsed,
|
||||
required this.ownerUserID,
|
||||
required this.allChannels,
|
||||
required this.channels,
|
||||
@@ -26,7 +26,7 @@ class KeyToken {
|
||||
keytokenID: json['keytoken_id'] as String,
|
||||
name: json['name'] as String,
|
||||
timestampCreated: json['timestamp_created'] as String,
|
||||
timestampLastused: json['timestamp_lastused'] as String?,
|
||||
timestampLastUsed: json['timestamp_lastused'] as String?,
|
||||
ownerUserID: json['owner_user_id'] as String,
|
||||
allChannels: json['all_channels'] as bool,
|
||||
channels: (json['channels'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
@@ -38,6 +38,17 @@ class KeyToken {
|
||||
static List<KeyToken> fromJsonArray(List<dynamic> jsonArr) {
|
||||
return jsonArr.map<KeyToken>((e) => KeyToken.fromJson(e as Map<String, dynamic>)).toList();
|
||||
}
|
||||
|
||||
KeyTokenPreview toPreview() {
|
||||
return KeyTokenPreview(
|
||||
keytokenID: keytokenID,
|
||||
name: name,
|
||||
ownerUserID: ownerUserID,
|
||||
allChannels: allChannels,
|
||||
channels: channels,
|
||||
permissions: permissions,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class KeyTokenWithToken {
|
||||
|
||||
Reference in New Issue
Block a user