class OfflineTemporaryPassword {
  dynamic effectiveTime;
  dynamic invalidTime;
  dynamic offlineTempPassword;
  dynamic offlineTempPasswordId;
  dynamic offlineTempPasswordName;

  OfflineTemporaryPassword({
    required this.effectiveTime,
    required this.invalidTime,
    required this.offlineTempPassword,
    required this.offlineTempPasswordId,
    required this.offlineTempPasswordName,
  });

  factory OfflineTemporaryPassword.fromJson(Map<String, dynamic> json) {
    return OfflineTemporaryPassword(
      effectiveTime: json['effective_time'],
      invalidTime: json['invalid_time'],
      offlineTempPassword: json['offline_temp_password'],
      offlineTempPasswordId: json['offline_temp_password_id'],
      offlineTempPasswordName: json['offline_temp_password_name'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'effective_time': effectiveTime,
      'invalid_time': invalidTime,
      'offline_temp_password': offlineTempPassword,
      'offline_temp_password_id': offlineTempPasswordId,
      'offline_temp_password_name': offlineTempPasswordName,
    };
  }
}

class ApiResponse {
  int statusCode;
  bool success;
  String message;
  OfflineTemporaryPassword data;

  ApiResponse({
    required this.statusCode,
    required this.success,
    required this.message,
    required this.data,
  });

  factory ApiResponse.fromJson(Map<String, dynamic> json) {
    return ApiResponse(
      statusCode: json['statusCode'],
      success: json['success'],
      message: json['message'],
      data: OfflineTemporaryPassword.fromJson(json['data']['result']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'statusCode': statusCode,
      'success': success,
      'message': message,
      'data': {
        'result': data.toJson(),
      },
    };
  }
}
