using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DysonNetwork.Sphere.Chat.Realtime;
///
/// Interface for real-time communication services (like Cloudflare, Agora, Twilio, etc.)
///
public interface IRealtimeService
{
///
/// Service provider name
///
string ProviderName { get; }
///
/// Creates a new real-time session
///
/// The room identifier
/// Additional metadata to associate with the session
/// Session configuration data
Task CreateSessionAsync(Guid roomId, Dictionary metadata);
///
/// Ends an existing real-time session
///
/// The session identifier
/// The session configuration
Task EndSessionAsync(string sessionId, RealtimeSessionConfig config);
///
/// Gets a token for user to join the session
///
/// The user identifier
/// The session identifier
/// The user is the admin of session
/// User-specific token for the session
string GetUserToken(Account.Account account, string sessionId, bool isAdmin = false);
}
///
/// Common configuration object for real-time sessions
///
public class RealtimeSessionConfig
{
///
/// Service-specific session identifier
///
public string SessionId { get; set; } = null!;
///
/// Additional provider-specific configuration parameters
///
public Dictionary Parameters { get; set; } = new();
}