AttachmentUpdate.fromJson constructor

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

Implementation

factory AttachmentUpdate.fromJson(Map<String, Object?> json) {
  return AttachmentUpdate(
    version: AttachmentUpdateVersion.fromJson(
        json[r'version'] as Map<String, Object?>? ?? const {}),
    id: json[r'id'] as String? ?? '',
    type: AttachmentUpdateType.fromValue(json[r'type'] as String? ?? ''),
    title: json[r'title'] as String?,
    metadata: json[r'metadata'] != null
        ? AttachmentUpdateMetadata.fromJson(
            json[r'metadata']! as Map<String, Object?>)
        : null,
    container: json[r'container'] != null
        ? AttachmentUpdateContainer.fromJson(
            json[r'container']! as Map<String, Object?>)
        : null,
  );
}