/// <summary> /// Initializes a new instance of the <see cref="SentNotificationsController"/> class. /// </summary> /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param> /// <param name="sentNotificationDataRepository">Sent notification data repository.</param> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="prepareToSendQueue">The service bus queue for preparing to send notifications.</param> /// <param name="dataQueue">The service bus queue for the data queue.</param> /// <param name="dataQueueMessageOptions">The options for the data queue messages.</param> /// <param name="groupsService">The groups service.</param> /// <param name="exportDataRepository">The Export data repository instance.</param> /// <param name="appCatalogService">App catalog service.</param> /// <param name="appSettingsService">App settings service.</param> /// <param name="userAppOptions">User app options.</param> /// <param name="loggerFactory">The logger factory.</param> public SentNotificationsController( INotificationDataRepository notificationDataRepository, ISentNotificationDataRepository sentNotificationDataRepository, ITeamDataRepository teamDataRepository, IPrepareToSendQueue prepareToSendQueue, IDataQueue dataQueue, IOptions <DataQueueMessageOptions> dataQueueMessageOptions, IGroupsService groupsService, IExportDataRepository exportDataRepository, IAppCatalogService appCatalogService, IAppSettingsService appSettingsService, IOptions <UserAppOptions> userAppOptions, ILoggerFactory loggerFactory) { if (dataQueueMessageOptions is null) { throw new ArgumentNullException(nameof(dataQueueMessageOptions)); } this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.prepareToSendQueue = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue)); this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue)); this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds; this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService)); this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository)); this.appCatalogService = appCatalogService ?? throw new ArgumentNullException(nameof(appCatalogService)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); this.userAppOptions = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions)); this.logger = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory)); }
/// <summary> /// Initializes a new instance of the <see cref="TeamsDataCapture"/> class. /// </summary> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="userDataService">User data service instance.</param> /// <param name="appSettingsService">App Settings service.</param> public TeamsDataCapture( ITeamDataRepository teamDataRepository, IUserDataService userDataService, IAppSettingsService appSettingsService) { this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.userDataService = userDataService ?? throw new ArgumentNullException(nameof(userDataService)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="DataStreamFacade"/> class. /// </summary> /// <param name="sentNotificationDataRepository">the sent notification data repository.</param> /// <param name="teamDataRepository">the team data repository.</param> /// <param name="usersService">the users service.</param> /// <param name="localizer">Localization service.</param> public DataStreamFacade( ISentNotificationDataRepository sentNotificationDataRepository, ITeamDataRepository teamDataRepository, IUsersService usersService, IStringLocalizer <Strings> localizer) { this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.usersService = usersService ?? throw new ArgumentNullException(nameof(usersService)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); }
/// <summary> /// Initializes a new instance of the <see cref="SyncTeamsActivity"/> class. /// </summary> /// <param name="teamDataRepository">Team Data repository.</param> /// <param name="sentNotificationDataRepository">Sent notification data repository.</param> /// <param name="localizer">Localization service.</param> /// <param name="notificationDataRepository">Notification data entity repository.</param> public SyncTeamsActivity( ITeamDataRepository teamDataRepository, ISentNotificationDataRepository sentNotificationDataRepository, IStringLocalizer <Strings> localizer, INotificationDataRepository notificationDataRepository) { this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); }
/// <summary> /// Add channel data in Table Storage. /// </summary> /// <param name="teamDataRepository">The team data repository.</param> /// <param name="activity">Bot conversation update activity instance.</param> /// <returns>A task that represents the work queued to execute.</returns> public static async Task SaveTeamDataAsync( this ITeamDataRepository teamDataRepository, IConversationUpdateActivity activity) { var teamDataEntity = TeamDataRepositoryExtensions.ParseTeamData(activity); if (teamDataEntity != null) { await teamDataRepository.CreateOrUpdateAsync(teamDataEntity); } }
/// <summary> /// Initializes a new instance of the <see cref="SentNotificationsController"/> class. /// </summary> /// <param name="channelDataRepository">Channel data repository service that deals with the table storage in azure.</param> /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param> /// <param name="sentNotificationDataRepository">Sent notification data repository.</param> /// <param name="sentNotificationUpdateDataRepository">Sent update notification data repository.</param> /// <param name="sentNotificationDataRepstry">Sent notification data repository to Get Likes.</param> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="distributionListDataRepository">DistributionList data repository instance.</param> /// <param name="prepareToSendQueue">The service bus queue for preparing to send notifications.</param> /// <param name="sendQueue">The service bus queue for the send queue.</param> /// <param name="dataQueue">The service bus queue for the data queue.</param> /// <param name="dataQueueMessageOptions">The options for the data queue messages.</param> /// <param name="groupsService">The groups service.</param> /// <param name="memberService">The meber info service.</param> /// <param name="reactionService">The reaction of message service.</param> /// <param name="exportDataRepository">The Export data repository instance.</param> /// <param name="appCatalogService">App catalog service.</param> /// <param name="appSettingsService">App settings service.</param> /// <param name="userAppOptions">User app options.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="configuration">The Configuration.</param> /// <param name="botOptions">bot options.</param> public SentNotificationsController( IChannelDataRepository channelDataRepository, INotificationDataRepository notificationDataRepository, ISentUpdateandDeleteNotificationDataRepository sentNotificationDataRepository, ISentUpdateDataRepository sentNotificationUpdateDataRepository, ISentNotificationDataRepository sentNotificationDataRepstry, ITeamDataRepository teamDataRepository, IDistributionListDataRepository distributionListDataRepository, IPrepareToSendQueue prepareToSendQueue, ISendQueue sendQueue, IDataQueue dataQueue, IOptions <DataQueueMessageOptions> dataQueueMessageOptions, IGroupsService groupsService, IMessageReactionService reactionService, ITeamMembersService memberService, IExportDataRepository exportDataRepository, IAppCatalogService appCatalogService, IAppSettingsService appSettingsService, IOptions <UserAppOptions> userAppOptions, ILoggerFactory loggerFactory, IConfiguration configuration, IOptions <BotOptions> botOptions) { if (dataQueueMessageOptions is null) { throw new ArgumentNullException(nameof(dataQueueMessageOptions)); } var options = botOptions ?? throw new ArgumentNullException(nameof(botOptions)); this.channelDataRepository = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository)); this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.sentNotificationUpdateDataRepository = sentNotificationUpdateDataRepository ?? throw new ArgumentException(nameof(sentNotificationUpdateDataRepository)); this.sentNotificationDataRepstry = sentNotificationDataRepstry ?? throw new ArgumentNullException(nameof(sentNotificationDataRepstry)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.distributionListDataRepository = distributionListDataRepository ?? throw new ArgumentNullException(nameof(distributionListDataRepository)); this.prepareToSendQueue = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue)); this.sendQueue = sendQueue ?? throw new ArgumentNullException(nameof(sendQueue)); this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue)); this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds; this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService)); this.reactionService = reactionService ?? throw new ArgumentNullException(nameof(reactionService)); this.memberService = memberService ?? throw new ArgumentNullException(nameof(memberService)); this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository)); this.appCatalogService = appCatalogService ?? throw new ArgumentNullException(nameof(appCatalogService)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); this.userAppOptions = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions)); this.logger = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory)); this.account = string.Empty; this.configuration = configuration; }
/// <summary> /// Initializes a new instance of the <see cref="SyncTeamMembersActivity"/> class. /// </summary> /// <param name="teamDataRepository">Team Data repository.</param> /// <param name="memberService">Teams member service.</param> /// <param name="notificationDataRepository">Notification data repository.</param> /// <param name="sentNotificationDataRepository">Sent notification data repository.</param> /// <param name="localizer">Localization service.</param> /// <param name="userDataRepository">User Data repository.</param> public SyncTeamMembersActivity( ITeamDataRepository teamDataRepository, ITeamMembersService memberService, INotificationDataRepository notificationDataRepository, ISentNotificationDataRepository sentNotificationDataRepository, IStringLocalizer <Strings> localizer, IUserDataRepository userDataRepository) { this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.memberService = memberService ?? throw new ArgumentNullException(nameof(memberService)); this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository)); }
/// <summary> /// Initializes a new instance of the <see cref="DraftNotificationsController"/> class. /// </summary> /// <param name="notificationDataRepository">Notification data repository instance.</param> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="draftNotificationPreviewService">Draft notification preview service.</param> /// <param name="appSettingsService">App Settings service.</param> /// <param name="localizer">Localization service.</param> /// <param name="groupsService">group service.</param> public DraftNotificationsController( INotificationDataRepository notificationDataRepository, ITeamDataRepository teamDataRepository, DraftNotificationPreviewService draftNotificationPreviewService, IAppSettingsService appSettingsService, IStringLocalizer <Strings> localizer, IGroupsService groupsService) { this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.draftNotificationPreviewService = draftNotificationPreviewService ?? throw new ArgumentNullException(nameof(draftNotificationPreviewService)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="ExportFunction"/> class. /// </summary> /// <param name="notificationDataRepository">Notification data repository.</param> /// <param name="exportDataRepository">Export data repository.</param> /// <param name="localizer">Localization service.</param> public ExportFunction( INotificationDataRepository notificationDataRepository, IExportDataRepository exportDataRepository, IStringLocalizer <Strings> localizer, ITeamMembersService memberService, IUserDataRepository userDataRepository, ITeamDataRepository teamDataRepository ) { this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.memberService = memberService ?? throw new ArgumentNullException(nameof(memberService)); this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); }
/// <summary> /// Remove channel data in table storage. /// </summary> /// <param name="teamDataRepository">The team data repository.</param> /// <param name="activity">Bot conversation update activity instance.</param> /// <returns>A task that represents the work queued to execute.</returns> public static async Task RemoveTeamDataAsync( this ITeamDataRepository teamDataRepository, IConversationUpdateActivity activity) { var teamDataEntity = TeamDataRepositoryExtensions.ParseTeamData(activity); if (teamDataEntity != null) { var found = await teamDataRepository.GetAsync(TeamDataTableNames.TeamDataPartition, teamDataEntity.TeamId); if (found != null) { await teamDataRepository.DeleteAsync(found); } } }
/// <summary> /// Initializes a new instance of the <see cref="ExportController"/> class. /// </summary> /// <param name="sentNotificationDataRepository">SentNotification data repository instance.</param> /// <param name="exportDataRepository">Export data repository instance.</param> /// <param name="userDataRepository">User data repository instance.</param> /// <param name="exportQueue">The service bus queue for the export queue.</param> /// <param name="memberService">Teams member service.</param> /// <param name="teamDataRepository">Team data reporsitory.</param> /// <param name="appSettingsService">App Settings service.</param> public ExportController( ISentNotificationDataRepository sentNotificationDataRepository, IExportDataRepository exportDataRepository, IUserDataRepository userDataRepository, IExportQueue exportQueue, ITeamMembersService memberService, ITeamDataRepository teamDataRepository, IAppSettingsService appSettingsService) { this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository)); this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository)); this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository)); this.exportQueue = exportQueue ?? throw new ArgumentNullException(nameof(exportQueue)); this.memberService = memberService ?? throw new ArgumentNullException(nameof(memberService)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="DraftNotificationsController"/> class. /// </summary> /// <param name="notificationDataRepository">Notification data repository instance.</param> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="draftNotificationPreviewService">Draft notification preview service.</param> /// <param name="appSettingsService">App Settings service.</param> /// <param name="localizer">Localization service.</param> /// <param name="groupsService">group service.</param> /// <param name="storageClientFactory">Storage Library</param> public DraftNotificationsController( INotificationDataRepository notificationDataRepository, ITeamDataRepository teamDataRepository, IDraftNotificationPreviewService draftNotificationPreviewService, IAppSettingsService appSettingsService, IStringLocalizer <Strings> localizer, IGroupsService groupsService, IStorageClientFactory storageClientFactory, IOptions <UserAppOptions> userAppOptions) { this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.draftNotificationPreviewService = draftNotificationPreviewService ?? throw new ArgumentNullException(nameof(draftNotificationPreviewService)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService)); this.storageClientFactory = storageClientFactory ?? throw new ArgumentNullException(nameof(storageClientFactory)); this.userAppOptions = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="DraftNotificationsController"/> class. /// </summary> /// <param name="notificationDataRepository">Notification data repository instance.</param> /// <param name="teamDataRepository">Team data repository instance.</param> /// <param name="distributionListDataRepository">DistributionList data repository instance.</param> /// <param name="draftNotificationPreviewService">Draft notification preview service.</param> /// <param name="appSettingsService">App Settings service.</param> /// <param name="localizer">Localization service.</param> /// <param name="configuration">The Configuration.</param> /// <param name="groupsService">group service.</param> public DraftNotificationsController( IChannelDataRepository channelDataRepository, INotificationDataRepository notificationDataRepository, ITeamDataRepository teamDataRepository, IDistributionListDataRepository distributionListDataRepository, DraftNotificationPreviewService draftNotificationPreviewService, IAppSettingsService appSettingsService, IStringLocalizer <Strings> localizer, IConfiguration configuration, IGroupsService groupsService, ILoggerFactory loggerFactory) { this.channelDataRepository = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository)); this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository)); this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); this.distributionListDataRepository = distributionListDataRepository ?? throw new ArgumentNullException(nameof(distributionListDataRepository)); this.draftNotificationPreviewService = draftNotificationPreviewService ?? throw new ArgumentNullException(nameof(draftNotificationPreviewService)); this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService)); this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService)); this.configuration = configuration; this.logger = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory)); }
/// <summary> /// Initializes a new instance of the <see cref="TeamDataController"/> class. /// </summary> /// <param name="teamDataRepository">Team data repository instance.</param> public TeamDataController(ITeamDataRepository teamDataRepository) { this.teamDataRepository = teamDataRepository; }
/// <summary> /// Initializes a new instance of the <see cref="TeamDataController"/> class. /// </summary> /// <param name="teamDataRepository">Team data repository instance.</param> public TeamDataController(ITeamDataRepository teamDataRepository) { this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository)); }