///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class CategoryDataListSubCategoryListSubListItem {
/*
{
  "Id": 1,
  "Image": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2015/07/thuoc-tim-mach-28072015142917.jpg",
  "Name": "Hỗ trợ tim mạch"
}
*/
  int? id;
  String? image;
  String? name;
//
  CategoryDataListSubCategoryListSubListItem({
    this.id,
    this.image,
    this.name,
  });
  CategoryDataListSubCategoryListSubListItem.fromJson(Map<String, dynamic> json) {
    id = json["Id"]?.toInt();
    image = json["Image"]?.toString();
    name = json["Name"]?.toString();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["Id"] = id;
    data["Image"] = image;
    data["Name"] = name;
    return data;
  }
}

class CategoryDataListSubCategoryListSub {
/*
{
  "Id": 2,
  "Name": "Vitamin Và Khoáng Chất",
  "ListItem": [
    {
      "Id": 1,
      "Image": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2015/07/thuoc-tim-mach-28072015142917.jpg",
      "Name": "Hỗ trợ tim mạch"
    }
  ]
}
*/

  int? id;
  String? name;
  List<CategoryDataListSubCategoryListSubListItem>? listItem;

  CategoryDataListSubCategoryListSub({
    this.id,
    this.name,
    this.listItem,
  });
  CategoryDataListSubCategoryListSub.fromJson(Map<String, dynamic> json) {
    id = json["Id"]?.toInt();
    name = json["Name"]?.toString();
    if (json["ListItem"] != null) {
      final v = json["ListItem"];
      final arr0 = <CategoryDataListSubCategoryListSubListItem>[];
      v.forEach((v) {
        arr0.add(CategoryDataListSubCategoryListSubListItem.fromJson(v));
      });
      listItem = arr0;
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["Id"] = id;
    data["Name"] = name;
    if (listItem != null) {
      final v = listItem;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["ListItem"] = arr0;
    }
    return data;
  }
}

class CategoryDataListSubCategory {
/*
{
  "SubId": 1,
  "SubName": "Thực phẩm chức năng",
  "SubImage": "unsafe/0x500/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/news/2020/11/thuc-pham-chuc-nang-cua-han-quoc-tot-nhat-10112020163528.jpg",
  "ListSub": [
    {
      "Id": 2,
      "Name": "Vitamin Và Khoáng Chất",
      "ListItem": [
        {
          "Id": 1,
          "Image": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2015/07/thuoc-tim-mach-28072015142917.jpg",
          "Name": "Hỗ trợ tim mạch"
        }
      ]
    }
  ]
}
*/

  int? subId;
  String? subName;
  String? subImage;
  List<CategoryDataListSubCategoryListSub>? listSub;

  CategoryDataListSubCategory({
    this.subId,
    this.subName,
    this.subImage,
    this.listSub,
  });
  CategoryDataListSubCategory.fromJson(Map<String, dynamic> json) {
    subId = json["SubId"]?.toInt();
    subName = json["SubName"]?.toString();
    subImage = json["SubImage"]?.toString();
    if (json["ListSub"] != null) {
      final v = json["ListSub"];
      final arr0 = <CategoryDataListSubCategoryListSub>[];
      v.forEach((v) {
        arr0.add(CategoryDataListSubCategoryListSub.fromJson(v));
      });
      listSub = arr0;
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["SubId"] = subId;
    data["SubName"] = subName;
    data["SubImage"] = subImage;
    if (listSub != null) {
      final v = listSub;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["ListSub"] = arr0;
    }
    return data;
  }
}

class CategoryData {
/*
{
  "CategoryId": 1,
  "CategoryName": "Thực phẩm chức năng",
  "CategoryImage": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2021/05/tinh-dau-hoa-anh-thao-19052021163958.jpg",
  "listSubCategory": [
    {
      "SubId": 1,
      "SubName": "Thực phẩm chức năng",
      "SubImage": "unsafe/0x500/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/news/2020/11/thuc-pham-chuc-nang-cua-han-quoc-tot-nhat-10112020163528.jpg",
      "ListSub": [
        {
          "Id": 2,
          "Name": "Vitamin Và Khoáng Chất",
          "ListItem": [
            {
              "Id": 1,
              "Image": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2015/07/thuoc-tim-mach-28072015142917.jpg",
              "Name": "Hỗ trợ tim mạch"
            }
          ]
        }
      ]
    }
  ]
}
*/

  int? categoryId;
  String? categoryName;
  String? categoryImage;
  List<CategoryDataListSubCategory>? listSubCategory;

  CategoryData({
    this.categoryId,
    this.categoryName,
    this.categoryImage,
    this.listSubCategory,
  });
  CategoryData.fromJson(Map<String, dynamic> json) {
    categoryId = json["CategoryId"]?.toInt();
    categoryName = json["CategoryName"]?.toString();
    categoryImage = json["CategoryImage"]?.toString();
    if (json["listSubCategory"] != null) {
      final v = json["listSubCategory"];
      final arr0 = <CategoryDataListSubCategory>[];
      v.forEach((v) {
        arr0.add(CategoryDataListSubCategory.fromJson(v));
      });
      listSubCategory = arr0;
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["CategoryId"] = categoryId;
    data["CategoryName"] = categoryName;
    data["CategoryImage"] = categoryImage;
    if (listSubCategory != null) {
      final v = listSubCategory;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["listSubCategory"] = arr0;
    }
    return data;
  }
}

class CategoryResponse {
/*
{
  "totalRecord": 1,
  "isSuccess": true,
  "errorMesssage": null,
  "Data": [
    {
      "CategoryId": 1,
      "CategoryName": "Thực phẩm chức năng",
      "CategoryImage": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2021/05/tinh-dau-hoa-anh-thao-19052021163958.jpg",
      "listSubCategory": [
        {
          "SubId": 1,
          "SubName": "Thực phẩm chức năng",
          "SubImage": "unsafe/0x500/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/news/2020/11/thuc-pham-chuc-nang-cua-han-quoc-tot-nhat-10112020163528.jpg",
          "ListSub": [
            {
              "Id": 2,
              "Name": "Vitamin Và Khoáng Chất",
              "ListItem": [
                {
                  "Id": 1,
                  "Image": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2015/07/thuoc-tim-mach-28072015142917.jpg",
                  "Name": "Hỗ trợ tim mạch"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "message": null
}
*/

  int? totalRecord;
  bool? isSuccess;
  String? errorMesssage;
  List<CategoryData>? data;
  String? message;

  CategoryResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.data,
    this.message,
  });
  CategoryResponse.fromJson(Map<String, dynamic> json) {
    totalRecord = json["totalRecord"]?.toInt();
    isSuccess = json["isSuccess"];
    errorMesssage = json["errorMesssage"]?.toString();
    if (json["Data"] != null) {
      final v = json["Data"];
      final arr0 = <CategoryData>[];
      v.forEach((v) {
        arr0.add(CategoryData.fromJson(v));
      });
      data = arr0;
    }
    message = json["message"]?.toString();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["totalRecord"] = totalRecord;
    data["isSuccess"] = isSuccess;
    data["errorMesssage"] = errorMesssage;
    if (this.data != null) {
      final v = this.data;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["Data"] = arr0;
    }
    data["message"] = message;
    return data;
  }
}
