namespace Extrudex.Domain.Interfaces; /// /// Client interface for communicating with Moonraker REST API endpoints /// on Klipper-based printers (e.g., Elegoo Centauri Carbon). /// Used to retrieve filament usage data, print job status, and /// remaining spool weight from the printer. /// public interface IMoonrakerClient { /// /// Fetches the current filament usage data from the Moonraker server. /// Returns a dictionary of usage metrics reported by the printer. /// /// The printer's hostname or IP address. /// The Moonraker API port (default: 7125). /// Optional API key for authentication. /// Cancellation token for the HTTP request. /// A dictionary of usage metric names to their decimal values. Task> GetFilamentUsageAsync( string hostnameOrIp, int port, string? apiKey, CancellationToken cancellationToken = default); /// /// Checks whether the Moonraker server is reachable and responding. /// /// The printer's hostname or IP address. /// The Moonraker API port (default: 7125). /// Optional API key for authentication. /// Cancellation token for the HTTP request. /// true if the server responded successfully; otherwise false. Task IsReachableAsync( string hostnameOrIp, int port, string? apiKey, CancellationToken cancellationToken = default); }