89 lines
2.0 KiB
Dart
89 lines
2.0 KiB
Dart
import 'package:didvan/models/ai/bots_model.dart';
|
|
|
|
class BotAssistantsModel {
|
|
List<BotAssistants>? botAssistants;
|
|
|
|
BotAssistantsModel({this.botAssistants});
|
|
|
|
BotAssistantsModel.fromJson(Map<String, dynamic> json) {
|
|
if (json['bots'] != null) {
|
|
botAssistants = <BotAssistants>[];
|
|
json['bots'].forEach((v) {
|
|
botAssistants!.add(BotAssistants.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
if (botAssistants != null) {
|
|
data['bots'] = botAssistants!.map((v) => v.toJson()).toList();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class BotAssistants {
|
|
int? id;
|
|
String? name;
|
|
String? description;
|
|
String? createdAt;
|
|
String? image;
|
|
BotsModel? bot;
|
|
User? user;
|
|
|
|
BotAssistants(
|
|
{this.id,
|
|
this.name,
|
|
this.description,
|
|
this.createdAt,
|
|
this.image,
|
|
this.bot,
|
|
this.user});
|
|
|
|
BotAssistants.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
description = json['description'];
|
|
createdAt = json['createdAt'];
|
|
image = json['image'];
|
|
bot = json['bot'] != null ? BotsModel.fromJson(json['bot']) : null;
|
|
user = json['user'] != null ? User.fromJson(json['user']) : null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['name'] = name;
|
|
data['description'] = description;
|
|
data['createdAt'] = createdAt;
|
|
data['image'] = image;
|
|
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<String, dynamic> json) {
|
|
fullName = json['fullName'];
|
|
photo = json['photo'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['fullName'] = fullName;
|
|
data['photo'] = photo;
|
|
return data;
|
|
}
|
|
}
|