class Questionnaire { int? questionnaireId; int? surveySubmissionId; SurveyType? surveyType; String? surveyName; String? surveyDescription; ServiceRequestDetails? serviceRequestDetails; List? surveyQuestions; Questionnaire({this.questionnaireId, this.surveySubmissionId, this.surveyType, this.surveyName, this.surveyDescription, this.serviceRequestDetails, this.surveyQuestions}); Questionnaire.fromJson(Map json) { questionnaireId = json['questionnaireId']; surveySubmissionId = json['surveySubmissionId']; surveyType = json['surveyType'] != null ? new SurveyType.fromJson(json['surveyType']) : null; surveyName = json['surveyName']; surveyDescription = json['surveyDescription']; serviceRequestDetails = json['serviceRequestDetails'] != null ? new ServiceRequestDetails.fromJson(json['serviceRequestDetails']) : null; if (json['surveyQuestions'] != null) { surveyQuestions = []; json['surveyQuestions'].forEach((v) { surveyQuestions!.add(new SurveyQuestions.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['questionnaireId'] = this.questionnaireId; data['surveySubmissionId'] = this.surveySubmissionId; if (this.surveyType != null) { data['surveyType'] = this.surveyType!.toJson(); } data['surveyName'] = this.surveyName; data['surveyDescription'] = this.surveyDescription; if (this.serviceRequestDetails != null) { data['serviceRequestDetails'] = this.serviceRequestDetails!.toJson(); } if (this.surveyQuestions != null) { data['surveyQuestions'] = this.surveyQuestions!.map((v) => v.toJson()).toList(); } return data; } } class SurveyType { int? id; String? name; int? value; SurveyType({this.id, this.name, this.value}); SurveyType.fromJson(Map json) { id = json['id']; name = json['name']; value = json['value']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['name'] = this.name; data['value'] = this.value; return data; } } class ServiceRequestDetails { int? serviceRequestTypeId; String? serviceRequestType; String? serviceRequestNo; ServiceRequestDetails({this.serviceRequestTypeId, this.serviceRequestType, this.serviceRequestNo}); ServiceRequestDetails.fromJson(Map json) { serviceRequestTypeId = json['serviceRequestTypeId']; serviceRequestType = json['serviceRequestType']; serviceRequestNo = json['serviceRequestNo']; } Map toJson() { final Map data = new Map(); data['serviceRequestTypeId'] = this.serviceRequestTypeId; data['serviceRequestType'] = this.serviceRequestType; data['serviceRequestNo'] = this.serviceRequestNo; return data; } } class SurveyQuestions { int? questionId; String? questionText; SurveyType? questionType; bool? isMandatory; List? surveyAnswerOptions; SurveyQuestions({this.questionId, this.questionText, this.questionType, this.surveyAnswerOptions, this.isMandatory}); SurveyQuestions.fromJson(Map json) { questionId = json['questionId']; questionText = json['questionText']; isMandatory = json['isMandatory']; questionType = json['questionType'] != null ? new SurveyType.fromJson(json['questionType']) : null; if (json['surveyAnswerOptions'] != null) { surveyAnswerOptions = []; json['surveyAnswerOptions'].forEach((v) { surveyAnswerOptions!.add(new SurveyAnswerOptions.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['questionId'] = this.questionId; data['questionText'] = this.questionText; data['isMandatory'] = this.isMandatory; if (this.questionType != null) { data['questionType'] = this.questionType!.toJson(); } if (this.surveyAnswerOptions != null) { data['surveyAnswerOptions'] = this.surveyAnswerOptions!.map((v) => v.toJson()).toList(); } return data; } } class SurveyAnswerOptions { int? optionId; String? optionText; int? displayOrder; SurveyAnswerOptions({this.optionId, this.optionText, this.displayOrder}); SurveyAnswerOptions.fromJson(Map json) { optionId = json['optionId']; optionText = json['optionText']; displayOrder = json['displayOrder']; } Map toJson() { final Map data = new Map(); data['optionId'] = this.optionId; data['optionText'] = this.optionText; data['displayOrder'] = this.displayOrder; return data; } } class SurveyAnswers { int? questionId; int? surveyAnswerOptionId; String? surveyAnswerText; int? surveyAnswerRating; SurveyAnswers({this.questionId, this.surveyAnswerOptionId, this.surveyAnswerText, this.surveyAnswerRating}); SurveyAnswers.fromJson(Map json) { questionId = json['questionId']; surveyAnswerOptionId = json['surveyAnswerOptionId']; surveyAnswerText = json['surveyAnswerText']; surveyAnswerRating = json['surveyAnswerRating']; } Map toJson() { final Map data = new Map(); data['questionId'] = this.questionId; data['surveyAnswerOptionId'] = this.surveyAnswerOptionId; data['surveyAnswerText'] = this.surveyAnswerText; data['surveyAnswerRating'] = this.surveyAnswerRating; return data; } }