toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (this.autoTranslationEnabled != null) {
    json[r'auto_translation_enabled'] = this.autoTranslationEnabled;
  } else {
    json[r'auto_translation_enabled'] = null;
  }
  if (this.autoTranslationLanguage != null) {
    json[r'auto_translation_language'] = this.autoTranslationLanguage;
  } else {
    json[r'auto_translation_language'] = null;
  }
  if (this.blocked != null) {
    json[r'blocked'] = this.blocked;
  } else {
    json[r'blocked'] = null;
  }
    json[r'cid'] = this.cid;
  if (this.config != null) {
    json[r'config'] = this.config;
  } else {
    json[r'config'] = null;
  }
  if (this.cooldown != null) {
    json[r'cooldown'] = this.cooldown;
  } else {
    json[r'cooldown'] = null;
  }
    json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
  if (this.createdBy != null) {
    json[r'created_by'] = this.createdBy;
  } else {
    json[r'created_by'] = null;
  }
    json[r'custom'] = this.custom;
  if (this.deletedAt != null) {
    json[r'deleted_at'] = this.deletedAt!.toUtc().toIso8601String();
  } else {
    json[r'deleted_at'] = null;
  }
    json[r'disabled'] = this.disabled;
    json[r'frozen'] = this.frozen;
  if (this.hidden != null) {
    json[r'hidden'] = this.hidden;
  } else {
    json[r'hidden'] = null;
  }
  if (this.hideMessagesBefore != null) {
    json[r'hide_messages_before'] = this.hideMessagesBefore!.toUtc().toIso8601String();
  } else {
    json[r'hide_messages_before'] = null;
  }
    json[r'id'] = this.id;
  if (this.lastMessageAt != null) {
    json[r'last_message_at'] = this.lastMessageAt!.toUtc().toIso8601String();
  } else {
    json[r'last_message_at'] = null;
  }
  if (this.memberCount != null) {
    json[r'member_count'] = this.memberCount;
  } else {
    json[r'member_count'] = null;
  }
    json[r'members'] = this.members;
  if (this.muteExpiresAt != null) {
    json[r'mute_expires_at'] = this.muteExpiresAt!.toUtc().toIso8601String();
  } else {
    json[r'mute_expires_at'] = null;
  }
  if (this.muted != null) {
    json[r'muted'] = this.muted;
  } else {
    json[r'muted'] = null;
  }
    json[r'own_capabilities'] = this.ownCapabilities;
  if (this.team != null) {
    json[r'team'] = this.team;
  } else {
    json[r'team'] = null;
  }
  if (this.truncatedAt != null) {
    json[r'truncated_at'] = this.truncatedAt!.toUtc().toIso8601String();
  } else {
    json[r'truncated_at'] = null;
  }
  if (this.truncatedBy != null) {
    json[r'truncated_by'] = this.truncatedBy;
  } else {
    json[r'truncated_by'] = null;
  }
    json[r'type'] = this.type;
    json[r'updated_at'] = this.updatedAt.toUtc().toIso8601String();
  return json;
}