copyWith method

Thread copyWith({
  1. String? id,
  2. String? object,
  3. int? createdAt,
  4. Object? toolResources = unsetCopyWithValue,
  5. Map<String, String>? metadata,
})

Creates a copy with the given fields replaced.

Implementation

Thread copyWith({
  String? id,
  String? object,
  int? createdAt,
  Object? toolResources = unsetCopyWithValue,
  Map<String, String>? metadata,
}) {
  return Thread(
    id: id ?? this.id,
    object: object ?? this.object,
    createdAt: createdAt ?? this.createdAt,
    toolResources: toolResources == unsetCopyWithValue
        ? this.toolResources
        : toolResources as ToolResources?,
    metadata: metadata ?? this.metadata,
  );
}