class SurveyModel {
  int? surveyId;
  String? referenceNo;
  String? title;
  String? description;
  List<Questions>? questions;
  bool? isActive;
  dynamic pageSize;
  dynamic pageNo;
  dynamic languageId;

  String? descriptionAr;
  String? titleAr;

  SurveyModel({this.surveyId, this.referenceNo, this.title,this.titleAr, this.description, this.descriptionAr, this.questions, this.isActive, this.pageSize, this.pageNo, this.languageId});

  SurveyModel.fromJson(Map<String, dynamic> json) {
    surveyId = json['surveyId'];
    referenceNo = json['referenceNo'];
    title = json['title'];
    titleAr = json['titleAr'];
    description = json['description'];
    descriptionAr = json['descriptionAr'];
    if (json['questions'] != null) {
      questions = <Questions>[];
      json['questions'].forEach((v) {
        questions!.add(new Questions.fromJson(v));
      });
    }
    isActive = json['isActive'];
    pageSize = json['pageSize'];
    pageNo = json['pageNo'];
    languageId = json['languageId'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = new Map<String, dynamic>();
    data['surveyId'] = this.surveyId;
    data['referenceNo'] = this.referenceNo;
    data['title'] = this.title;
    data['titleAr'] = this.titleAr;
    data['description'] = this.description;
    data['descriptionAr'] = this.descriptionAr;
    if (this.questions != null) {
      data['questions'] = this.questions!.map((v) => v.toJson()).toList();
    }
    data['isActive'] = this.isActive;
    data['pageSize'] = this.pageSize;
    data['pageNo'] = this.pageNo;
    data['languageId'] = this.languageId;
    return data;
  }
}

class Questions {
  int? questionId;
  String? title;
  String? titleAr;
  bool? isRequired;
  String? type;
  int? sequenceNo;
  dynamic surveyId;
  List<Options>? options;
  dynamic rspPercentage;
  dynamic isActive;
  dynamic pageSize;
  dynamic pageNo;
  dynamic languageId;

  Questions({this.questionId, this.title, this.titleAr, this.isRequired, this.type, this.sequenceNo, this.surveyId, this.options, this.rspPercentage, this.isActive, this.pageSize, this.pageNo, this.languageId});

  Questions.fromJson(Map<String, dynamic> json) {
    questionId = json['questionId'];
    title = json['title'];
    titleAr = json['titleAr'];
    isRequired = json['isRequired'];
    type = json['type'];
    sequenceNo = json['sequenceNo'];
    surveyId = json['surveyId'];
    if (json['options'] != null) {
      options = <Options>[];
      json['options'].forEach((v) {
        options!.add(new Options.fromJson(v));
      });
    }
    rspPercentage = json['rspPercentage'];
    isActive = json['isActive'];
    pageSize = json['pageSize'];
    pageNo = json['pageNo'];
    languageId = json['languageId'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = new Map<String, dynamic>();
    data['questionId'] = this.questionId;
    data['title'] = this.title;
    data['titleAr'] = this.titleAr;
    data['isRequired'] = this.isRequired;
    data['type'] = this.type;
    data['sequenceNo'] = this.sequenceNo;
    data['surveyId'] = this.surveyId;
    if (this.options != null) {
      data['options'] = this.options!.map((v) => v.toJson()).toList();
    }
    data['rspPercentage'] = this.rspPercentage;
    data['isActive'] = this.isActive;
    data['pageSize'] = this.pageSize;
    data['pageNo'] = this.pageNo;
    data['languageId'] = this.languageId;
    return data;
  }
}

class Options {
  int? optionId;
  String? title;
  String? titleAr;
  bool? isCommentsRequired;
  int? sequenceNo;
  int? questionId;
  dynamic rspPercentage;
  dynamic count;
  dynamic isActive;
  dynamic pageSize;
  dynamic pageNo;
  dynamic languageId;

  Options({this.optionId, this.title,this.titleAr, this.isCommentsRequired, this.sequenceNo, this.questionId, this.rspPercentage, this.count, this.isActive, this.pageSize, this.pageNo, this.languageId});

  Options.fromJson(Map<String, dynamic> json) {
    optionId = json['optionId'];
    title = json['title'];
    titleAr = json['titleAr'];
    isCommentsRequired = json['isCommentsRequired'];
    sequenceNo = json['sequenceNo'];
    questionId = json['questionId'];
    rspPercentage = json['rspPercentage'];
    count = json['count'];
    isActive = json['isActive'];
    pageSize = json['pageSize'];
    pageNo = json['pageNo'];
    languageId = json['languageId'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = new Map<String, dynamic>();
    data['optionId'] = this.optionId;
    data['title'] = this.title;
    data['titleAr'] = this.titleAr;
    data['isCommentsRequired'] = this.isCommentsRequired;
    data['sequenceNo'] = this.sequenceNo;
    data['questionId'] = this.questionId;
    data['rspPercentage'] = this.rspPercentage;
    data['count'] = this.count;
    data['isActive'] = this.isActive;
    data['pageSize'] = this.pageSize;
    data['pageNo'] = this.pageNo;
    data['languageId'] = this.languageId;
    return data;
  }
}
