toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'banned'] = this.banned;
json[r'blocked_user_ids'] = this.blockedUserIds;
json[r'channel_mutes'] = this.channelMutes;
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'custom'] = this.custom;
if (this.deactivatedAt != null) {
json[r'deactivated_at'] = this.deactivatedAt!.toUtc().toIso8601String();
} else {
json[r'deactivated_at'] = null;
}
if (this.deletedAt != null) {
json[r'deleted_at'] = this.deletedAt!.toUtc().toIso8601String();
} else {
json[r'deleted_at'] = null;
}
json[r'devices'] = this.devices;
json[r'id'] = this.id;
if (this.image != null) {
json[r'image'] = this.image;
} else {
json[r'image'] = null;
}
json[r'invisible'] = this.invisible;
json[r'language'] = this.language;
if (this.lastActive != null) {
json[r'last_active'] = this.lastActive!.toUtc().toIso8601String();
} else {
json[r'last_active'] = null;
}
json[r'latest_hidden_channels'] = this.latestHiddenChannels;
json[r'mutes'] = this.mutes;
if (this.name != null) {
json[r'name'] = this.name;
} else {
json[r'name'] = null;
}
json[r'online'] = this.online;
if (this.privacySettings != null) {
json[r'privacy_settings'] = this.privacySettings;
} else {
json[r'privacy_settings'] = null;
}
if (this.pushNotifications != null) {
json[r'push_notifications'] = this.pushNotifications;
} else {
json[r'push_notifications'] = null;
}
if (this.revokeTokensIssuedBefore != null) {
json[r'revoke_tokens_issued_before'] = this.revokeTokensIssuedBefore!.toUtc().toIso8601String();
} else {
json[r'revoke_tokens_issued_before'] = null;
}
json[r'role'] = this.role;
json[r'teams'] = this.teams;
json[r'total_unread_count'] = this.totalUnreadCount;
json[r'unread_channels'] = this.unreadChannels;
json[r'unread_count'] = this.unreadCount;
json[r'unread_threads'] = this.unreadThreads;
json[r'updated_at'] = this.updatedAt.toUtc().toIso8601String();
return json;
}