Esempio n. 1
0
        /// <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));
        }
Esempio n. 2
0
        /// <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;
        }
Esempio n. 3
0
 /// <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="OptionsController"/> class.
 /// </summary>
 /// <param name="userAppOptions">the user app options.</param>
 public OptionsController(IOptions <UserAppOptions> userAppOptions)
 {
     this.userAppOptions = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions));
 }