Message constructor

const Message({
  1. required int id,
  2. required String body,
  3. required String date,
  4. @JsonKey(name: 'author_id', fromJson: MessageAuthor.fromList) required MessageAuthor author,
  5. @JsonKey(name: 'email_from') required String emailFrom,
  6. @JsonKey(name: 'message_type') required String messageType,
  7. @JsonKey(name: 'subtype_id') required List subtypeId,
  8. required String model,
  9. @JsonKey(name: 'res_id') required int resId,
  10. @JsonKey(name: 'record_name') required String recordName,
  11. @JsonKey(name: 'partner_ids') required List<int> partnerIds,
  12. @JsonKey(name: 'starred_partner_ids') required List<int> starredPartnerIds,
  13. @JsonKey(name: 'moderation_status', fromJson: Message.parseModerationStatus) required String? moderationStatus,
  14. required List<int> notifications,
  15. @JsonKey(name: 'attachment_ids') required List<Attachment> atachments,
  16. @JsonKey(name: 'tracking_value_ids') required List<int> trackingValueIds,
  17. @JsonKey(name: 'needaction_partner_ids') required List<int> needactionPartnerIds,
  18. @JsonKey(name: 'history_partner_ids') required List<int> historyPartnerIds,
  19. @JsonKey(name: 'is_note') required bool isNote,
  20. @JsonKey(name: 'is_discussion') required bool isDiscussion,
  21. @JsonKey(name: 'subtype_description') required bool subtypeDescription,
  22. @JsonKey(name: 'is_notification') required bool isNotification,
  23. @JsonKey(name: 'module_icon') required String moduleIcon,
  24. @JsonKey(name: 'sms_ids') required List<int> smsIds,
})

Implementation

const factory Message({
  required int id,
  required String body,
  required String date,
  @JsonKey(name: 'author_id', fromJson: MessageAuthor.fromList)
  required MessageAuthor author,
  @JsonKey(name: 'email_from') required String emailFrom,
  @JsonKey(name: 'message_type') required String messageType,
  @JsonKey(name: 'subtype_id') required List<dynamic> subtypeId,
  required String model,
  @JsonKey(name: 'res_id') required int resId,
  @JsonKey(name: 'record_name') required String recordName,
  @JsonKey(name: 'partner_ids') required List<int> partnerIds,
  @JsonKey(name: 'starred_partner_ids') required List<int> starredPartnerIds,
  @JsonKey(name: 'moderation_status', fromJson: Message.parseModerationStatus)
  required String? moderationStatus,
  required List<int> notifications,
  @JsonKey(name: 'attachment_ids') required List<Attachment> atachments,
  @JsonKey(name: 'tracking_value_ids') required List<int> trackingValueIds,
  @JsonKey(name: 'needaction_partner_ids')
  required List<int> needactionPartnerIds,
  @JsonKey(name: 'history_partner_ids') required List<int> historyPartnerIds,
  @JsonKey(name: 'is_note') required bool isNote,
  @JsonKey(name: 'is_discussion') required bool isDiscussion,
  @JsonKey(name: 'subtype_description') required bool subtypeDescription,
  @JsonKey(name: 'is_notification') required bool isNotification,
  @JsonKey(name: 'module_icon') required String moduleIcon,
  @JsonKey(name: 'sms_ids') required List<int> smsIds,
}) = _Message;