import 'package:dio/dio.dart';

import '../api/questia_api.dart';
import 'questia_repository.dart';

class QuestiaRepositoryImpl implements QuestiaRepository {
  final QuestiaApi _api;

  QuestiaRepositoryImpl(this._api);

  @override
  Future<Response<T>> get<T>(
    String path, {
    Map<String, dynamic>? queryParameters,
  }) {
    return _api.get<T>(path, queryParameters: queryParameters);
  }

  @override
  Future<Response<T>> post<T>(
    String path, {
    dynamic body,
    Map<String, dynamic>? queryParameters,
  }) {
    return _api.post<T>(path, data: body, queryParameters: queryParameters);
  }

  @override
  Future<Response<T>> put<T>(
    String path, {
    dynamic body,
    Map<String, dynamic>? queryParameters,
  }) {
    return _api.put<T>(path, data: body, queryParameters: queryParameters);
  }

  @override
  Future<Response<T>> delete<T>(
    String path, {
    dynamic body,
    Map<String, dynamic>? queryParameters,
  }) {
    return _api.delete<T>(path, data: body, queryParameters: queryParameters);
  }
}
