///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class NewsData {
/*
{
  "id": 1,
  "thumb": "",
  "content": "",
  "url": ""
}
*/

  int? id;
  String? thumb;
  String? content;
  String? url;

  NewsData({
    this.id,
    this.thumb,
    this.content,
    this.url,
  });
  NewsData.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    thumb = json["thumb"]?.toString();
    content = json["content"]?.toString();
    url = json["url"]?.toString();
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["thumb"] = thumb;
    data["content"] = content;
    data["url"] = url;
    return data;
  }
}

class NewsResponse {
/*
{
  "status": "",
  "messages": "success",
  "data": [
    {
      "id": 1,
      "thumb": "",
      "content": "",
      "url": ""
    }
  ]
}
*/

  String? status;
  String? messages;
  List<NewsData>? data;

  NewsResponse({
    this.status,
    this.messages,
    this.data,
  });
  NewsResponse.fromJson(Map<String, dynamic> json) {
    status = json["status"]?.toString();
    messages = json["messages"]?.toString();
    if (json["data"] != null) {
      final v = json["data"];
      final arr0 = <NewsData>[];
      v.forEach((v) {
        arr0.add(NewsData.fromJson(v));
      });
      this.data = arr0;
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["status"] = status;
    data["messages"] = messages;
    if (this.data != null) {
      final v = this.data;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["data"] = arr0;
    }
    return data;
  }
}
