using System.Text.Json.Serialization; using KickWsClient.Converters; namespace KickWsClient.Models; public class PusherModels { public class BasePusherEventModel { /// /// Name of the event /// [JsonPropertyName("event")] public required string Event { get; set; } /// /// Stringified JSON payload /// [JsonPropertyName("data")] [JsonConverter(typeof(StringOrObjectConverter))] public required string Data { get; set; } /// /// Channel where event originates. Only included events where a channel is applicable /// [JsonPropertyName("channel")] public string? Channel { get; set; } } public class BasePusherRequestModel { /// /// Name of the event /// [JsonPropertyName("event")] public required string Event { get; set; } /// /// Data as object. It's only stringified for responses /// [JsonPropertyName("data")] public required object Data { get; set; } } public class PusherConnectionEstablishedEventModel { /// /// Internal socket ID /// [JsonPropertyName("socket_id")] public required string SocketId { get; set; } /// /// Timeout on no activity in seconds /// [JsonPropertyName("activity_timeout")] public int ActivityTimeout { get; set; } } public class PusherSubscribeRequestModel { /// /// Token to authenticate with, use an empty string for guest. /// [JsonPropertyName("auth")] public string Auth { get; set; } = ""; /// /// Channel you wish to subscribe to. 'channel.2515504' for stream events. 'chatrooms.2515504.v2' for chat where 2515504 is the channel ID /// [JsonPropertyName("channel")] public required string Channel { get; set; } } public class PusherUnsubscribeRequestModel { /// /// Channel you wish to unsubscribe from, e.g. 'channel.2515504' /// [JsonPropertyName("channel")] public required string Channel { get; set; } } }