class UpdateInfo {
  bool needUpdate;
  LastVersion lastVersion;

  UpdateInfo({this.needUpdate, this.lastVersion});

  UpdateInfo.fromJson(Map<String, dynamic> json) {
    needUpdate = json['need_update'];
    lastVersion = json['last_version'] != null
        ? new LastVersion.fromJson(json['last_version'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['need_update'] = this.needUpdate;
    if (this.lastVersion != null) {
      data['last_version'] = this.lastVersion.toJson();
    }
    return data;
  }
}

class LastVersion {
  int id;
  String version;
  String downloadUrl;
  String detail;
  int fileSize;
  String createdAt;

  LastVersion(
      {this.id,
        this.version,
        this.downloadUrl,
        this.detail,
        this.fileSize,
        this.createdAt});

  LastVersion.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    version = json['version'];
    downloadUrl = json['download_url'];
    detail = json['detail'];
    fileSize = json['file_size'];
    createdAt = json['created_at'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['version'] = this.version;
    data['download_url'] = this.downloadUrl;
    data['detail'] = this.detail;
    data['file_size'] = this.fileSize;
    data['created_at'] = this.createdAt;
    return data;
  }
}