using System.Collections.Generic; using System.Text.Json.Serialization; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Models.MailItem; namespace Wino.Core.Domain.Models.Synchronization { public class SynchronizationResult { public SynchronizationResult() { } /// /// Gets the new downloaded messages from synchronization. /// Server will create notifications for these messages. /// It's ignored in serialization. Client should not react to this. /// [JsonIgnore] public IEnumerable DownloadedMessages { get; set; } = new List(); public SynchronizationCompletedState CompletedState { get; set; } public static SynchronizationResult Empty => new() { CompletedState = SynchronizationCompletedState.Success }; public static SynchronizationResult Completed(IEnumerable downloadedMessages) => new() { DownloadedMessages = downloadedMessages, CompletedState = SynchronizationCompletedState.Success }; public static SynchronizationResult Canceled => new() { CompletedState = SynchronizationCompletedState.Canceled }; } }