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

class ToolsCategoriesModel {
  List<Categories>? categories;

  ToolsCategoriesModel({this.categories});

  ToolsCategoriesModel.fromJson(Map<String, dynamic> json) {
    if (json['categories'] != null) {
      categories = <Categories>[];
      json['categories'].forEach((v) {
        categories!.add(Categories.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 Categories {
  int? id;
  String? name;
  String? image;
  String? description;
  List<Bots>? bots;

  Categories({this.id, this.name});

  Categories.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    image = json['image'];
    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['description'] = description;
    if (bots != null) {
      data['bots'] = bots!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
