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(CancellationToken cancellationToken = default) { return _context.LogoutAsync(cancellationToken); } public Task LoginAsync(CancellationToken cancellationToken = default) { return _context.LoginAsync(cancellationToken); } public async Task GetStatusAsync(CancellationToken cancellationToken = default) { var typedResponse = await _context.PostAsync>(_logger, "pwg.session.getStatus", cancellationToken); return typedResponse.Result; } }