class leaveApplicationLIstResponse {
  List<RequestList>? requestList;
  String? error;
  String? message;
  int? sessionExists;

  leaveApplicationLIstResponse(
      {this.requestList, this.error, this.message, this.sessionExists});

  leaveApplicationLIstResponse.fromJson(Map<String, dynamic> json) {
    if (json['request_list'] != null) {
      requestList = <RequestList>[];
      json['request_list'].forEach((v) {
        requestList!.add(new RequestList.fromJson(v));
      });
    }
    error = json['error'];
    message = json['message'];
    sessionExists = json['session_exists'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.requestList != null) {
      data['request_list'] = this.requestList!.map((v) => v.toJson()).toList();
    }
    data['error'] = this.error;
    data['message'] = this.message;
    data['session_exists'] = this.sessionExists;
    return data;
  }
}

class RequestList {
  String? id;
  String? appliedDate;
  String? fromPeriod;
  String? toPeriod;
  String? status;
  String? leaveType;


  RequestList(
      {this.id, this.appliedDate, this.fromPeriod, this.toPeriod, this.status});

  RequestList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    appliedDate = json['applied_date'];
    fromPeriod = json['from_period'];
    toPeriod = json['to_period'];
    status = json['status'];
    leaveType = json["leave_type"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['applied_date'] = this.appliedDate;
    data['from_period'] = this.fromPeriod;
    data['to_period'] = this.toPeriod;
    data['status'] = this.status;
    data["leave_type"] = this.leaveType;
    return data;
  }
}
