///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class DistrictData {
/*
{
  "DistrictId": 1,
  "DistrictName": "Quận Ba Đình",
  "CityId": 1
}
*/

  int? districtId;
  String? districtName;
  int? cityId;

  DistrictData({
    this.districtId,
    this.districtName,
    this.cityId,
  });
  DistrictData.fromJson(Map<String, dynamic> json) {
    districtId = json["DistrictId"]?.toInt();
    districtName = json["DistrictName"]?.toString();
    cityId = json["CityId"]?.toInt();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["DistrictId"] = districtId;
    data["DistrictName"] = districtName;
    data["CityId"] = cityId;
    return data;
  }
}

class DistrictResponse {
/*
{
  "totalRecord": 0,
  "isSuccess": true,
  "errorMesssage": null,
  "Data": [
    {
      "DistrictId": 1,
      "DistrictName": "Quận Ba Đình",
      "CityId": 1
    }
  ],
  "message": null
}
*/

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

  DistrictResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.data,
    this.message,
  });
  DistrictResponse.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 = <DistrictData>[];
      v.forEach((v) {
        arr0.add(DistrictData.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;
  }
}
