using System.Text.Json.Serialization; namespace Lantean.QBitTorrentClient.Models { public record MainData { [JsonConstructor] public MainData( int responseId, bool fullUpdate, IReadOnlyDictionary? torrents, IReadOnlyList? torrentsRemoved, IReadOnlyDictionary? categories, IReadOnlyList? categoriesRemoved, IReadOnlyList? tags, IReadOnlyList? tagsRemoved, IReadOnlyDictionary> trackers, ServerState? serverState) { ResponseId = responseId; FullUpdate = fullUpdate; Torrents = torrents; TorrentsRemoved = torrentsRemoved; Categories = categories; CategoriesRemoved = categoriesRemoved; Tags = tags; TagsRemoved = tagsRemoved; Trackers = trackers; ServerState = serverState; } [JsonPropertyName("rid")] public int ResponseId { get; } [JsonPropertyName("full_update")] public bool FullUpdate { get; } [JsonPropertyName("torrents")] public IReadOnlyDictionary? Torrents { get; } [JsonPropertyName("torrents_removed")] public IReadOnlyList? TorrentsRemoved { get; } [JsonPropertyName("categories")] public IReadOnlyDictionary? Categories { get; } [JsonPropertyName("categories_removed")] public IReadOnlyList? CategoriesRemoved { get; } [JsonPropertyName("tags")] public IReadOnlyList? Tags { get; } [JsonPropertyName("tags_removed")] public IReadOnlyList? TagsRemoved { get; } [JsonPropertyName("trackers")] public IReadOnlyDictionary>? Trackers { get; } [JsonPropertyName("trackers_removed")] public IReadOnlyList? TrackersRemoved { get; } [JsonPropertyName("server_state")] public ServerState? ServerState { get; } } }