FileListResponse.fromAnthropic constructor

FileListResponse.fromAnthropic(
  1. Map<String, dynamic> json
)

Create from Anthropic format

Implementation

factory FileListResponse.fromAnthropic(Map<String, dynamic> json) {
  return FileListResponse(
    data: (json['data'] as List)
        .map((item) => FileObject.fromAnthropic(item as Map<String, dynamic>))
        .toList(),
    object: 'list',
    firstId: json['first_id'] as String?,
    lastId: json['last_id'] as String?,
    hasMore: json['has_more'] as bool?,
  );
}