toJson method

Map<String, dynamic> toJson()

Generic JSON representation

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'size_bytes': sizeBytes,
    'created_at': createdAt.toIso8601String(),
    'filename': filename,
    'object': object,
    if (purpose != null) 'purpose': purpose!.value,
    if (status != null) 'status': status!.value,
    if (statusDetails != null) 'status_details': statusDetails,
    if (mimeType != null) 'mime_type': mimeType,
    if (downloadable != null) 'downloadable': downloadable,
    if (metadata != null) 'metadata': metadata,
  };
}