import 'package:hoshan/data/model/ai/bots_model.dart';

class GensModel {
  List<GenModel>? categories;

  GensModel({this.categories});

  GensModel.fromJson(Map<String, dynamic> json) {
    if (json['categories'] != null) {
      categories = <GenModel>[];
      json['categories'].forEach((v) {
        categories!.add(GenModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (categories != null) {
      data['categories'] = categories!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class GenModel {
  int? id;
  String? name;
  String? image;
  String? icon;
  String? description;
  List<Bots>? bots;

  GenModel({this.id, this.name, this.image, this.description, this.bots});

  GenModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    image = json['image'];
    icon = json['icon'];
    description = json['description'];
    if (json['bots'] != null) {
      bots = <Bots>[];
      json['bots'].forEach((v) {
        bots!.add(Bots.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['image'] = image;
    data['icon'] = icon;
    data['description'] = description;
    if (bots != null) {
      data['bots'] = bots!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
