using System.Text.Json.Serialization; namespace WebDrop.Core; public sealed class WorkspaceChannel { [JsonPropertyName("chatEpoch")] public int ChatEpoch { get; set; } [JsonPropertyName("filesEpoch")] public int FilesEpoch { get; set; } [JsonPropertyName("chatHistory")] public bool ChatHistory { get; set; } = true; [JsonPropertyName("filesHistory")] public bool FilesHistory { get; set; } = true; [JsonPropertyName("fileBytes")] public long FileBytes { get; set; } [JsonPropertyName("id")] public required string Id { get; init; } [JsonPropertyName("name")] public required string Name { get; set; } [JsonPropertyName("createdAt")] public required long CreatedAt { get; init; } [JsonPropertyName("createdBy")] public required string CreatedBy { get; init; } [JsonPropertyName("groupId")] public string? GroupId { get; set; } } public sealed class WorkspaceGroup { [JsonPropertyName("id")] public required string Id { get; init; } [JsonPropertyName("name")] public required string Name { get; set; } [JsonPropertyName("createdAt")] public required long CreatedAt { get; init; } } public sealed class WorkspaceFolder { [JsonPropertyName("id")] public required string Id { get; init; } [JsonPropertyName("threadId")] public required string ThreadId { get; init; } [JsonPropertyName("parentId")] public string? ParentId { get; init; } [JsonPropertyName("name")] public required string Name { get; set; } } public sealed class WorkspaceLocation { [JsonPropertyName("itemId")] public required string ItemId { get; init; } [JsonPropertyName("threadId")] public required string ThreadId { get; init; } [JsonPropertyName("folderId")] public string? FolderId { get; init; } [JsonPropertyName("authorAccount")] public string? AuthorAccount { get; init; } } public sealed class WorkspaceState { [JsonPropertyName("defaultChannelId")] public string? DefaultChannelId { get; init; } [JsonPropertyName("revision")] public long Revision { get; set; } [JsonPropertyName("channels")] public List Channels { get; init; } = []; [JsonPropertyName("groups")] public List Groups { get; init; } = []; [JsonPropertyName("folders")] public List Folders { get; init; } = []; [JsonPropertyName("locations")] public List Locations { get; set; } = []; } [JsonSerializable(typeof(WorkspaceState))] [JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] public sealed partial class WorkspaceJson : JsonSerializerContext;