toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.banExpires != null) {
json[r'ban_expires'] = this.banExpires!.toUtc().toIso8601String();
} else {
json[r'ban_expires'] = null;
}
json[r'banned'] = this.banned;
json[r'channel_role'] = this.channelRole;
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'custom'] = this.custom;
if (this.deletedAt != null) {
json[r'deleted_at'] = this.deletedAt!.toUtc().toIso8601String();
} else {
json[r'deleted_at'] = null;
}
if (this.inviteAcceptedAt != null) {
json[r'invite_accepted_at'] = this.inviteAcceptedAt!.toUtc().toIso8601String();
} else {
json[r'invite_accepted_at'] = null;
}
if (this.inviteRejectedAt != null) {
json[r'invite_rejected_at'] = this.inviteRejectedAt!.toUtc().toIso8601String();
} else {
json[r'invite_rejected_at'] = null;
}
if (this.invited != null) {
json[r'invited'] = this.invited;
} else {
json[r'invited'] = null;
}
if (this.isModerator != null) {
json[r'is_moderator'] = this.isModerator;
} else {
json[r'is_moderator'] = null;
}
json[r'notifications_muted'] = this.notificationsMuted;
json[r'shadow_banned'] = this.shadowBanned;
if (this.status != null) {
json[r'status'] = this.status;
} else {
json[r'status'] = null;
}
json[r'updated_at'] = this.updatedAt.toUtc().toIso8601String();
if (this.user != null) {
json[r'user'] = this.user;
} else {
json[r'user'] = null;
}
if (this.userId != null) {
json[r'user_id'] = this.userId;
} else {
json[r'user_id'] = null;
}
return json;
}