AttachmentMetadata.fromJson constructor

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

Implementation

factory AttachmentMetadata.fromJson(Map<String, Object?> json) {
  return AttachmentMetadata(
    author: json[r'author'] != null
        ? User.fromJson(json[r'author']! as Map<String, Object?>)
        : null,
    content: json[r'content'] as String?,
    created: DateTime.tryParse(json[r'created'] as String? ?? ''),
    filename: json[r'filename'] as String?,
    id: (json[r'id'] as num?)?.toInt(),
    mimeType: json[r'mimeType'] as String?,
    properties: json[r'properties'] as Map<String, Object?>?,
    self: json[r'self'] as String?,
    size: (json[r'size'] as num?)?.toInt(),
    thumbnail: json[r'thumbnail'] as String?,
  );
}