using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Yavsc.Abstract.Streaming;
/// The lifecycle of a retained live broadcast.
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum PodcastState { Live, Completed, Interrupted }
/// Creates an authenticated live broadcast with a retained replay.
public sealed record CreatePodcastRequest
{
[Required, StringLength(160, MinimumLength = 1)]
public required string Title { get; init; }
}
/// A broadcast available to authenticated listeners.
public sealed record PodcastResponse(
Guid Id, string Title, string OwnerId, string OwnerName,
DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt, PodcastState State,
int SegmentCount, long Bytes, double DurationSeconds);
/// An independently decodable MPEG-TS HLS segment.
public sealed record PodcastSegmentResponse(int Sequence, double DurationSeconds, int Bytes);
/// The ordered, committed segments of a live broadcast or replay.
public sealed record PodcastManifestResponse(
PodcastResponse Podcast, IReadOnlyList Segments);