using LANCommander.SDK.Models; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; using LANCommander.SDK.Exceptions; using LANCommander.SDK.Factories; namespace LANCommander.SDK.Services { public class DepotClient( ILogger logger, ApiRequestFactory apiRequestFactory) { public async Task GetAsync() { var results = await apiRequestFactory.Create() .UseAuthenticationToken() .UseVersioning() .UseRoute("/api/Depot") .GetAsync(); if (results == null) { logger?.LogDebug("Could not find any depot results"); throw new DepotNoResultsException("Did not find any depot results"); } return results; } public async Task GetGameAsync(Guid gameId) { return await apiRequestFactory .Create() .UseAuthenticationToken() .UseVersioning() .UseRoute($"/api/Depot/Games/{gameId}") .GetAsync(); } } }