using LANCommander.SDK.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; using LANCommander.SDK.Factories; namespace LANCommander.SDK.Services { public class LibraryClient(ApiRequestFactory apiRequestFactory) { public async Task> GetAsync() { var results = await apiRequestFactory .Create() .UseAuthenticationToken() .UseVersioning() .UseRoute("/api/Library") .GetAsync>(); return results ?? []; } public async Task AddToLibrary(Guid gameId) { return await apiRequestFactory .Create() .UseAuthenticationToken() .UseVersioning() .UseRoute($"/api/Library/AddToLibrary/{gameId}") .PostAsync(); } public async Task RemoveFromLibrary(Guid gameId) { return await apiRequestFactory .Create() .UseAuthenticationToken() .UseVersioning() .UseRoute($"/api/Library/RemoveFromLibrary/{gameId}") .PostAsync(); } public async Task RemoveFromLibrary(Guid gameId, Guid[] addonIds) { return await apiRequestFactory .Create() .UseAuthenticationToken() .UseVersioning() .UseRoute($"/api/Library/RemoveFromLibrary/{gameId}/addons") .AddBody(new GenericGuidsRequest { Guids = addonIds }) .PostAsync(); } } }