Capabilities.fromJson constructor
Implementation
Capabilities.fromJson(Map<String, Object?> json)
: m3pidChanges = ((v) => v != null
? BooleanCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.3pid_changes']),
mChangePassword = ((v) => v != null
? BooleanCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.change_password']),
mGetLoginToken = ((v) => v != null
? BooleanCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.get_login_token']),
mRoomVersions = ((v) => v != null
? RoomVersionsCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.room_versions']),
mSetAvatarUrl = ((v) => v != null
? BooleanCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.set_avatar_url']),
mSetDisplayname = ((v) => v != null
? BooleanCapability.fromJson(v as Map<String, Object?>)
: null)(json['m.set_displayname']),
additionalProperties = Map.fromEntries(
json.entries
.where(
(e) => ![
'm.3pid_changes',
'm.change_password',
'm.get_login_token',
'm.room_versions',
'm.set_avatar_url',
'm.set_displayname',
].contains(e.key),
)
.map((e) => MapEntry(e.key, e.value)),
);