/*
 * @author dx
 * @date   2019-09-17
 **/
class ActivityReportEntity {
  String message;
  int error;
  int errorCode;
  Data data;

  ActivityReportEntity({this.message, this.error, this.errorCode, this.data});

  ActivityReportEntity.fromJson(Map<String, dynamic> json) {
    message = json['message'];
    error = json['error'];
    errorCode = json['error_code'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['message'] = this.message;
    data['error'] = this.error;
    data['error_code'] = this.errorCode;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  int surveyRecordId;
  String type;
  Report report;

  Data({this.surveyRecordId, this.type, this.report});

  Data.fromJson(Map<String, dynamic> json) {
    surveyRecordId = json['survey_record_id'];
    type = json['type'];
    report =
        json['report'] != null ? new Report.fromJson(json['report']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['survey_record_id'] = this.surveyRecordId;
    data['type'] = this.type;
    if (this.report != null) {
      data['report'] = this.report.toJson();
    }
    return data;
  }
}

class Report {
  Share share;
  List<Cards> cards;

  Report({this.share, this.cards});

  Report.fromJson(Map<String, dynamic> json) {
    share = json['share'] != null ? new Share.fromJson(json['share']) : null;
    if (json['cards'] != null) {
      cards = new List<Cards>();
      json['cards'].forEach((v) {
        cards.add(new Cards.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.share != null) {
      data['share'] = this.share.toJson();
    }
    if (this.cards != null) {
      data['cards'] = this.cards.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Share {
  double total_cost;
  double beat;
  double rank;
  String range;

  Share({this.total_cost, this.beat, this.rank, this.range});

  Share.fromJson(Map<String, dynamic> json) {
    total_cost = json['total_cost'];
    beat = json['beat'];
    rank = json['rank'];
    range = json['range'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total_cost'] = this.total_cost;
    data['beat'] = this.beat;
    data['rank'] = this.rank;
    data['range'] = this.range;
    return data;
  }
}

class Cards {
  int id;
  String name;
  String description;
  String guide;
  String protocol;
  List<Drafts> drafts;

  Cards(
      {this.id,
      this.name,
      this.description,
      this.guide,
      this.protocol,
      this.drafts});

  Cards.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    description = json['description'];
    guide = json['guide'];
    protocol = json['protocol'];
    if (json['drafts'] != null) {
      drafts = new List<Drafts>();
      json['drafts'].forEach((v) {
        drafts.add(new Drafts.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['description'] = this.description;
    data['guide'] = this.guide;
    data['protocol'] = this.protocol;
    if (this.drafts != null) {
      data['drafts'] = this.drafts.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Drafts {
  int id;
  Image image;

  Drafts({this.id, this.image});

  Drafts.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    image = json['image'] != null ? new Image.fromJson(json['image']) : null;
  }

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

class Image {
  String imageUrl;
  String videoUrl;
  int width;
  int height;

  Image({this.imageUrl, this.videoUrl, this.width, this.height});

  Image.fromJson(Map<String, dynamic> json) {
    imageUrl = json['image_url'];
    videoUrl = json['video_url'];
    width = json['width'];
    height = json['height'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['image_url'] = this.imageUrl;
    data['video_url'] = this.videoUrl;
    data['width'] = this.width;
    data['height'] = this.height;
    return data;
  }
}