AttachmentDTO.fromJson constructor

AttachmentDTO.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory AttachmentDTO.fromJson(Map<String, Object?> json) {
  return AttachmentDTO(
    links: json[r'_links'] != null
        ? AttachmentLinkDTO.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
    author: json[r'author'] != null
        ? UserDTO.fromJson(json[r'author']! as Map<String, Object?>)
        : null,
    created: json[r'created'] != null
        ? DateDTO.fromJson(json[r'created']! as Map<String, Object?>)
        : null,
    filename: json[r'filename'] as String?,
    mimeType: json[r'mimeType'] as String?,
    size: (json[r'size'] as num?)?.toInt(),
  );
}