using System; using System.Collections.Generic; using System.Threading.Tasks; using Wino.Core.Domain.Entities; namespace Wino.Core.Domain.Interfaces { public interface IAccountService { /// /// Current IAuthenticator that should receive external authentication process to continue with. /// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator /// to continue process for token exchange. /// IAuthenticator ExternalAuthenticationAuthenticator { get; set; } /// /// Returns all local accounts. /// /// All local accounts Task> GetAccountsAsync(); /// /// Returns single MailAccount /// /// AccountId. Task GetAccountAsync(Guid accountId); /// /// Deletes all information about the account, including token information. /// /// MailAccount to be removed Task DeleteAccountAsync(MailAccount account); /// /// Returns the custom server information for the given account id. /// Task GetAccountCustomServerInformationAsync(Guid accountId); /// /// Updates the given account properties. /// Task UpdateAccountAsync(MailAccount account); /// /// Creates new account with the given server information if any. /// Also sets the account as Startup account if there are no accounts. /// Task CreateAccountAsync(MailAccount account, TokenInformation tokenInformation, CustomServerInformation customServerInformation); /// /// Fixed authentication errors for account by forcing interactive login. /// Task FixTokenIssuesAsync(Guid accountId); /// /// Removed the attention from an account. /// /// Account id to remove from Task ClearAccountAttentionAsync(Guid accountId); /// /// Updates the account synchronization identifier. /// For example: Gmail uses this identifier to keep track of the last synchronization. /// Update is ignored for Gmail if the new identifier is older than the current one. /// /// Identifier to update /// Current account synchronization modifier. Task UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier); Task RenameMergedAccountAsync(Guid mergedInboxId, string newName); Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable accountsToMerge); Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable linkedAccountIds); Task UnlinkMergedInboxAsync(Guid mergedInboxId); } }