file scoped namespaces (#565)
This commit is contained in:
@@ -2,30 +2,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Synchronization
|
||||
namespace Wino.Core.Domain.Models.Synchronization;
|
||||
|
||||
public class CalendarSynchronizationOptions
|
||||
{
|
||||
public class CalendarSynchronizationOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique id of synchronization.
|
||||
/// </summary>
|
||||
public Guid Id { get; } = Guid.NewGuid();
|
||||
/// <summary>
|
||||
/// Unique id of synchronization.
|
||||
/// </summary>
|
||||
public Guid Id { get; } = Guid.NewGuid();
|
||||
|
||||
/// <summary>
|
||||
/// Account to execute synchronization for.
|
||||
/// </summary>
|
||||
public Guid AccountId { get; set; }
|
||||
/// <summary>
|
||||
/// Account to execute synchronization for.
|
||||
/// </summary>
|
||||
public Guid AccountId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of the synchronization to be performed.
|
||||
/// </summary>
|
||||
public CalendarSynchronizationType Type { get; set; }
|
||||
/// <summary>
|
||||
/// Type of the synchronization to be performed.
|
||||
/// </summary>
|
||||
public CalendarSynchronizationType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Calendar ids to synchronize.
|
||||
/// </summary>
|
||||
public List<Guid> SynchronizationCalendarIds { get; set; }
|
||||
/// <summary>
|
||||
/// Calendar ids to synchronize.
|
||||
/// </summary>
|
||||
public List<Guid> SynchronizationCalendarIds { get; set; }
|
||||
|
||||
public override string ToString() => $"Type: {Type}, Calendars: {(SynchronizationCalendarIds == null ? "All" : string.Join(",", SynchronizationCalendarIds))}";
|
||||
}
|
||||
public override string ToString() => $"Type: {Type}, Calendars: {(SynchronizationCalendarIds == null ? "All" : string.Join(",", SynchronizationCalendarIds))}";
|
||||
}
|
||||
|
||||
@@ -4,43 +4,42 @@ using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Synchronization
|
||||
namespace Wino.Core.Domain.Models.Synchronization;
|
||||
|
||||
public class CalendarSynchronizationResult
|
||||
{
|
||||
public class CalendarSynchronizationResult
|
||||
{
|
||||
public CalendarSynchronizationResult() { }
|
||||
public CalendarSynchronizationResult() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the new downloaded events from synchronization.
|
||||
/// Server will create notifications for these event.
|
||||
/// It's ignored in serialization. Client should not react to this.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IEnumerable<ICalendarItem> DownloadedEvents { get; set; } = [];
|
||||
/// <summary>
|
||||
/// Gets the new downloaded events from synchronization.
|
||||
/// Server will create notifications for these event.
|
||||
/// It's ignored in serialization. Client should not react to this.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IEnumerable<ICalendarItem> DownloadedEvents { get; set; } = [];
|
||||
|
||||
public ProfileInformation ProfileInformation { get; set; }
|
||||
public ProfileInformation ProfileInformation { get; set; }
|
||||
|
||||
public SynchronizationCompletedState CompletedState { get; set; }
|
||||
public SynchronizationCompletedState CompletedState { get; set; }
|
||||
|
||||
public static CalendarSynchronizationResult Empty => new() { CompletedState = SynchronizationCompletedState.Success };
|
||||
public static CalendarSynchronizationResult Empty => new() { CompletedState = SynchronizationCompletedState.Success };
|
||||
|
||||
// Mail synchronization
|
||||
public static CalendarSynchronizationResult Completed(IEnumerable<ICalendarItem> downloadedEvent)
|
||||
=> new()
|
||||
{
|
||||
DownloadedEvents = downloadedEvent,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
// Mail synchronization
|
||||
public static CalendarSynchronizationResult Completed(IEnumerable<ICalendarItem> downloadedEvent)
|
||||
=> new()
|
||||
{
|
||||
DownloadedEvents = downloadedEvent,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
|
||||
// Profile synchronization
|
||||
public static CalendarSynchronizationResult Completed(ProfileInformation profileInformation)
|
||||
=> new()
|
||||
{
|
||||
ProfileInformation = profileInformation,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
// Profile synchronization
|
||||
public static CalendarSynchronizationResult Completed(ProfileInformation profileInformation)
|
||||
=> new()
|
||||
{
|
||||
ProfileInformation = profileInformation,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
|
||||
public static CalendarSynchronizationResult Canceled => new() { CompletedState = SynchronizationCompletedState.Canceled };
|
||||
public static CalendarSynchronizationResult Failed => new() { CompletedState = SynchronizationCompletedState.Failed };
|
||||
}
|
||||
public static CalendarSynchronizationResult Canceled => new() { CompletedState = SynchronizationCompletedState.Canceled };
|
||||
public static CalendarSynchronizationResult Failed => new() { CompletedState = SynchronizationCompletedState.Failed };
|
||||
}
|
||||
|
||||
@@ -2,43 +2,42 @@
|
||||
using System.Collections.Generic;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Synchronization
|
||||
namespace Wino.Core.Domain.Models.Synchronization;
|
||||
|
||||
public class MailSynchronizationOptions
|
||||
{
|
||||
public class MailSynchronizationOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique id of synchronization.
|
||||
/// </summary>
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
/// <summary>
|
||||
/// Unique id of synchronization.
|
||||
/// </summary>
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
/// <summary>
|
||||
/// Account to execute synchronization for.
|
||||
/// </summary>
|
||||
public Guid AccountId { get; set; }
|
||||
/// <summary>
|
||||
/// Account to execute synchronization for.
|
||||
/// </summary>
|
||||
public Guid AccountId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of the synchronization to be performed.
|
||||
/// </summary>
|
||||
public MailSynchronizationType Type { get; set; }
|
||||
/// <summary>
|
||||
/// Type of the synchronization to be performed.
|
||||
/// </summary>
|
||||
public MailSynchronizationType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Collection of FolderId to perform SynchronizationType.Custom type sync.
|
||||
/// </summary>
|
||||
public List<Guid> SynchronizationFolderIds { get; set; }
|
||||
/// <summary>
|
||||
/// Collection of FolderId to perform SynchronizationType.Custom type sync.
|
||||
/// </summary>
|
||||
public List<Guid> SynchronizationFolderIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, additional folders like Sent,Drafts and Deleted will not be synchronized
|
||||
/// with InboxOnly and CustomFolders sync type.
|
||||
/// </summary>
|
||||
public bool ExcludeMustHaveFolders { get; set; }
|
||||
/// <summary>
|
||||
/// If true, additional folders like Sent,Drafts and Deleted will not be synchronized
|
||||
/// with InboxOnly and CustomFolders sync type.
|
||||
/// </summary>
|
||||
public bool ExcludeMustHaveFolders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When doing a linked inbox synchronization, we must ignore reporting completion to the caller for each folder.
|
||||
/// This Id will help tracking that. Id is unique, but this one can be the same for all sync requests
|
||||
/// inside the same linked inbox sync.
|
||||
/// </summary>
|
||||
public Guid? GroupedSynchronizationTrackingId { get; set; }
|
||||
/// <summary>
|
||||
/// When doing a linked inbox synchronization, we must ignore reporting completion to the caller for each folder.
|
||||
/// This Id will help tracking that. Id is unique, but this one can be the same for all sync requests
|
||||
/// inside the same linked inbox sync.
|
||||
/// </summary>
|
||||
public Guid? GroupedSynchronizationTrackingId { get; set; }
|
||||
|
||||
public override string ToString() => $"Type: {Type}";
|
||||
}
|
||||
public override string ToString() => $"Type: {Type}";
|
||||
}
|
||||
|
||||
@@ -4,43 +4,42 @@ using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
using Wino.Core.Domain.Models.MailItem;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Synchronization
|
||||
namespace Wino.Core.Domain.Models.Synchronization;
|
||||
|
||||
public class MailSynchronizationResult
|
||||
{
|
||||
public class MailSynchronizationResult
|
||||
{
|
||||
public MailSynchronizationResult() { }
|
||||
public MailSynchronizationResult() { }
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IEnumerable<IMailItem> DownloadedMessages { get; set; } = [];
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IEnumerable<IMailItem> DownloadedMessages { get; set; } = [];
|
||||
|
||||
public ProfileInformation ProfileInformation { get; set; }
|
||||
public ProfileInformation ProfileInformation { get; set; }
|
||||
|
||||
public SynchronizationCompletedState CompletedState { get; set; }
|
||||
public SynchronizationCompletedState CompletedState { get; set; }
|
||||
|
||||
public static MailSynchronizationResult Empty => new() { CompletedState = SynchronizationCompletedState.Success };
|
||||
public static MailSynchronizationResult Empty => new() { CompletedState = SynchronizationCompletedState.Success };
|
||||
|
||||
// Mail synchronization
|
||||
public static MailSynchronizationResult Completed(IEnumerable<IMailItem> downloadedMessages)
|
||||
=> new()
|
||||
{
|
||||
DownloadedMessages = downloadedMessages,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
// Mail synchronization
|
||||
public static MailSynchronizationResult Completed(IEnumerable<IMailItem> downloadedMessages)
|
||||
=> new()
|
||||
{
|
||||
DownloadedMessages = downloadedMessages,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
|
||||
// Profile synchronization
|
||||
public static MailSynchronizationResult Completed(ProfileInformation profileInformation)
|
||||
=> new()
|
||||
{
|
||||
ProfileInformation = profileInformation,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
// Profile synchronization
|
||||
public static MailSynchronizationResult Completed(ProfileInformation profileInformation)
|
||||
=> new()
|
||||
{
|
||||
ProfileInformation = profileInformation,
|
||||
CompletedState = SynchronizationCompletedState.Success
|
||||
};
|
||||
|
||||
public static MailSynchronizationResult Canceled => new() { CompletedState = SynchronizationCompletedState.Canceled };
|
||||
public static MailSynchronizationResult Failed => new() { CompletedState = SynchronizationCompletedState.Failed };
|
||||
}
|
||||
public static MailSynchronizationResult Canceled => new() { CompletedState = SynchronizationCompletedState.Canceled };
|
||||
public static MailSynchronizationResult Failed => new() { CompletedState = SynchronizationCompletedState.Failed };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user