///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class CategoryData {
/*
{
  "id": 1,
  "title": "",
  "color": ""
}
*/

  int? id;
  String? title;
  String? color;

  CategoryData({
    this.id,
    this.title,
    this.color,
  });
  CategoryData.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    title = json["title"]?.toString();
    color = json["color"]?.toString();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["title"] = title;
    data["color"] = color;
    return data;
  }
}

class ListCategoryResponse {
/*
{
  "totalRecord": 9,
  "isSuccess": true,
  "errorMesssage": null,
  "Data": [
    {
      "id": 1,
      "title": "",
      "color": ""
    }
  ],
  "message": null
}
*/

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

  ListCategoryResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.data,
    this.message,
  });
  ListCategoryResponse.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> map = Map<String, dynamic>();
    map["totalRecord"] = totalRecord;
    map["isSuccess"] = isSuccess;
    map["errorMesssage"] = errorMesssage;
    if (data != null) {
      final v = data;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      map["Data"] = arr0;
    }
    map["message"] = message;
    return map;
  }
}
