import 'dart:convert';

import '../../../requestCache.dart';
import 'getRooms.dart';
import 'getRoomsResponse.dart';

class GetRoomsCache extends RequestCache<GetRoomsResponse> {
  GetRoomsCache({onUpdate}) : super(RequestCache.cacheHour, onUpdate) {
    start('MarianumMobile', 'wu-rooms');
  }

  @override
  Future<GetRoomsResponse> onLoad() => GetRooms().run();

  @override
  GetRoomsResponse onLocalData(String json) => GetRoomsResponse.fromJson(jsonDecode(json));

}
