AIAttachment.fromJson constructor

AIAttachment.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory AIAttachment.fromJson(Map<String, dynamic> json) {
  return AIAttachment(
    type: AIAttachmentType.values.firstWhere((e) => e.name == json['type']),
    bytes:
        json['bytes'] != null ? List<int>.from(json['bytes'] as List) : null,
    url: json['url'] as String?,
    filePath: json['filePath'] as String?,
    mimeType: json['mimeType'] as String?,
    name: json['name'] as String?,
  );
}