Untitled

mail@pastecode.io avatar
unknown
json
2 years ago
3.6 kB
14
Indexable
Never
class LeaveListModel {
  bool? status;
  String? message;
  LeaveListResponse? response;
  double? generated;
  int? tokenExpire;
  int? serverTime;

  LeaveListModel({
    this.status,
    this.message,
    this.response,
    this.generated,
    this.tokenExpire,
    this.serverTime,
  });

  LeaveListModel.fromJson(Map<String, dynamic> json) {
    status = json['status'] as bool?;
    message = json['message'] as String?;
    response = (json['response'] as Map<String, dynamic>?) != null
        ? LeaveListResponse.fromJson(json['response'] as Map<String, dynamic>)
        : null;
    generated = json['generated'] as double?;
    tokenExpire = json['tokenExpire'] as int?;
    serverTime = json['serverTime'] as int?;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json['status'] = status;
    json['message'] = message;
    json['response'] = response?.toJson();
    json['generated'] = generated;
    json['tokenExpire'] = tokenExpire;
    json['serverTime'] = serverTime;
    return json;
  }
}

class LeaveListResponse {
  int? total;
  List<LeaveListResponse>? result;

  LeaveListResponse({
    this.total,
    this.result,
  });

  LeaveListResponse.fromJson(Map<String, dynamic> json) {
    total = json['total'] as int?;
    result = (json['result'] as List?)
        ?.map((dynamic e) =>
            LeaveListResponse.fromJson(e as Map<String, dynamic>))
        .toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json['total'] = total;
    json['result'] = result?.map((e) => e.toJson()).toList();
    return json;
  }
}

class LeaveListResult {
  int? paidLeaveId;
  String? paidLeaveUuid;
  String? paidLeaveEmployeeUuid;
  String? paidLeaveEmployeeNip;
  String? paidLeaveEmployeeFullName;
  String? paidLeaveTypeUuid;
  String? paidLeaveTypeName;
  String? hirarki;
  int? levels;
  int? jumlahHari;

  LeaveListResult({
    this.paidLeaveId,
    this.paidLeaveUuid,
    this.paidLeaveEmployeeUuid,
    this.paidLeaveEmployeeNip,
    this.paidLeaveEmployeeFullName,
    this.paidLeaveTypeUuid,
    this.paidLeaveTypeName,
    this.hirarki,
    this.levels,
    this.jumlahHari,
  });

  LeaveListResult.fromJson(Map<String, dynamic> json) {
    paidLeaveId = json['paid_leave_id'] as int?;
    paidLeaveUuid = json['paid_leave_uuid'] as String?;
    paidLeaveEmployeeUuid = json['paid_leave_employee_uuid'] as String?;
    paidLeaveEmployeeNip = json['paid_leave_employee_nip'] as String?;
    paidLeaveEmployeeFullName =
        json['paid_leave_employee_full_name'] as String?;
    paidLeaveTypeUuid = json['paid_leave_type_uuid'] as String?;
    paidLeaveTypeName = json['paid_leave_type_name'] as String?;
    hirarki = json['hirarki'] as String?;
    levels = json['levels'] as int?;
    jumlahHari = json['jumlah_hari'] as int?;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json['paid_leave_id'] = paidLeaveId;
    json['paid_leave_uuid'] = paidLeaveUuid;
    json['paid_leave_employee_uuid'] = paidLeaveEmployeeUuid;
    json['paid_leave_employee_nip'] = paidLeaveEmployeeNip;
    json['paid_leave_employee_full_name'] = paidLeaveEmployeeFullName;
    json['paid_leave_type_uuid'] = paidLeaveTypeUuid;
    json['paid_leave_type_name'] = paidLeaveTypeName;
    json['hirarki'] = hirarki;
    json['levels'] = levels;
    json['jumlah_hari'] = jumlahHari;
    return json;
  }
}