toJson method

Map<String, dynamic> toJson()

Converts to JSON.

Implementation

Map<String, dynamic> toJson() => {
  'id': id,
  'object': object,
  'created_at': createdAt,
  'run_id': runId,
  'assistant_id': assistantId,
  'thread_id': threadId,
  'type': type.toJson(),
  'status': status.toJson(),
  'step_details': stepDetails.toJson(),
  if (lastError != null) 'last_error': lastError!.toJson(),
  if (expiredAt != null) 'expired_at': expiredAt,
  if (cancelledAt != null) 'cancelled_at': cancelledAt,
  if (failedAt != null) 'failed_at': failedAt,
  if (completedAt != null) 'completed_at': completedAt,
  'metadata': metadata,
  if (usage != null) 'usage': usage!.toJson(),
};