import 'package:{{ name }}/converters/APIResponse.dart';
import 'package:{{ name }}/services/UsersProvider.dart';
import 'package:dio/dio.dart';
import 'package:meta/meta.dart';

import 'package:{{ name }}/models/User.dart';

class UserRepository {
  RestClient api = RestClient(Dio());

  Future<APIResponse<List<User>>> getUsers(){
    return api.getUsers();
  }

  Future<APIResponse<User>> getUser({
    @required String id
  }){
    return api.getUser(id);
  }

  Future<APIResponse<User>> createUser({
    @required User user
  }){
    return api.createUser(user);
  }

  Future<APIResponse<User>> updateUser({
    @required String id,
    @required User user
  }){
    return api.updateUser(id, user);
  }

  Future<String> deleteUser({
    @required String id
  }){
    return api.deleteUser(id);
  }

}