| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- namespace Abp.Notifications
- {
- /// <summary>
- /// Used to manage notification definitions.
- /// </summary>
- public interface INotificationDefinitionManager
- {
- /// <summary>
- /// Adds the specified notification definition.
- /// </summary>
- void Add(NotificationDefinition notificationDefinition);
- /// <summary>
- /// Gets a notification definition by name.
- /// Throws exception if there is no notification definition with given name.
- /// </summary>
- NotificationDefinition Get(string name);
- /// <summary>
- /// Gets a notification definition by name.
- /// Returns null if there is no notification definition with given name.
- /// </summary>
- NotificationDefinition GetOrNull(string name);
- /// <summary>
- /// Gets all notification definitions.
- /// </summary>
- IReadOnlyList<NotificationDefinition> GetAll();
- /// <summary>
- /// Checks if given notification (<see cref="name"/>) is available for given user.
- /// </summary>
- Task<bool> IsAvailableAsync(string name, UserIdentifier user);
- /// <summary>
- /// Gets all available notification definitions for given user.
- /// </summary>
- /// <param name="user">User.</param>
- Task<IReadOnlyList<NotificationDefinition>> GetAllAvailableAsync(UserIdentifier user);
- /// <summary>
- /// Remove notification with given name
- /// </summary>
- /// <param name="name"></param>
- void Remove(string name);
- }
- }
|