using Microsoft.Extensions.Logging; using Piwigo.Client.Contract; namespace Piwigo.Client; internal class SessionApi : ISessionApi { private readonly IPiwigoContext _context; private readonly ILogger _logger; public SessionApi(IPiwigoContext context, ILogger logger) { _context = context ?? throw new ArgumentNullException(nameof(context)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public Task LogoutAsync() { return _context.LogoutAsync(); } public Task LoginAsync() { return _context.LoginAsync(); } public async Task GetStatusAsync() { var typedResponse = await _context.PostAsync>(_logger, "pwg.session.getStatus"); return typedResponse.Result; } }