///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class CityData {
/*
{
  "CityId": 1,
  "CityName": "Hà Nội"
}
*/

  int? cityId;
  String? cityName;

  CityData({
    this.cityId,
    this.cityName,
  });
  CityData.fromJson(Map<String, dynamic> json) {
    cityId = json["CityId"]?.toInt();
    cityName = json["CityName"]?.toString();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["CityId"] = cityId;
    data["CityName"] = cityName;
    return data;
  }
}

class CityResponse {
/*
{
  "totalRecord": 0,
  "isSuccess": true,
  "errorMesssage": null,
  "Data": [
    {
      "CityId": 1,
      "CityName": "Hà Nội"
    }
  ],
  "message": null
}
*/

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

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