44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
class BotsModel {
|
|
int? id;
|
|
String? name;
|
|
String? image;
|
|
String? responseType;
|
|
String? description;
|
|
List<String>? attachmentType;
|
|
int? attachment;
|
|
bool? editable;
|
|
|
|
BotsModel({this.id, this.name, this.image});
|
|
|
|
BotsModel.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
image = json['image'];
|
|
description = json['description'];
|
|
if (json['attachmentType'] != null) {
|
|
attachmentType = <String>[];
|
|
json['attachmentType'].forEach((v) {
|
|
attachmentType!.add(v);
|
|
});
|
|
}
|
|
attachment = json['attachment'];
|
|
editable = json['editable'];
|
|
responseType = json['responseType'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['name'] = name;
|
|
data['image'] = image;
|
|
data['description'] = description;
|
|
if (attachmentType != null) {
|
|
data['attachmentType'] = attachmentType!.map((v) => v).toList();
|
|
}
|
|
data['attachment'] = attachment;
|
|
data['editable'] = editable;
|
|
data['responseType'] = responseType;
|
|
return data;
|
|
}
|
|
}
|