import 'package:didvan/models/ai/bots_model.dart'; class BotAssistantsModel { List? botAssistants; BotAssistantsModel({this.botAssistants}); BotAssistantsModel.fromJson(Map json) { if (json['bots'] != null) { botAssistants = []; json['bots'].forEach((v) { botAssistants!.add(BotAssistants.fromJson(v)); }); } } Map toJson() { final Map data = {}; if (botAssistants != null) { data['bots'] = botAssistants!.map((v) => v.toJson()).toList(); } return data; } } class BotAssistants { int? id; int? userId; int? botId; String? name; String? description; String? createdAt; String? image; String? type; String? prompt; bool? private; BotsModel? bot; User? user; List? files; List? websites; BotAssistants( {this.id, this.name, this.description, this.createdAt, this.image, this.bot, this.private, this.user, this.botId, this.prompt, this.type, this.websites, this.files, this.userId}); BotAssistants.fromJson(Map json) { id = json['id']; userId = json['userId']; botId = json['botId']; name = json['name']; description = json['description']; createdAt = json['createdAt']; image = json['image']; type = json['type']; prompt = json['prompt']; private = json['private']; bot = json['bot'] != null ? BotsModel.fromJson(json['bot']) : null; user = json['user'] != null ? User.fromJson(json['user']) : null; if (json['files'] != null) { files = []; json['files'].forEach((v) { files!.add(v); }); } if (json['websites'] != null) { websites = []; json['websites'].forEach((v) { websites!.add(v); }); } } Map toJson() { final Map data = {}; data['id'] = id; data['name'] = name; data['description'] = description; data['createdAt'] = createdAt; data['image'] = image; data['private'] = private; if (bot != null) { data['bot'] = bot!.toJson(); } if (user != null) { data['user'] = user!.toJson(); } return data; } } class User { String? fullName; String? photo; User({this.fullName, this.photo}); User.fromJson(Map json) { fullName = json['fullName']; photo = json['photo']; } Map toJson() { final Map data = {}; data['fullName'] = fullName; data['photo'] = photo; return data; } }