/// <summary>
 /// Initializes a new instance of the <see cref="GroupDataController"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository instance.</param>
 /// <param name="groupsService">Microsoft Graph service instance.</param>
 public GroupDataController(
     INotificationDataRepository notificationDataRepository,
     IGroupsService groupsService)
 {
     this.notificationDataRepository = notificationDataRepository;
     this.groupsService = groupsService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SendBatchMessagesActivity"/> class.
 /// </summary>
 /// <param name="sendQueue">Send queue service.</param>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 public SendBatchMessagesActivity(
     ISendQueue sendQueue,
     INotificationDataRepository notificationDataRepository)
 {
     this.sendQueue = sendQueue ?? throw new ArgumentNullException(nameof(sendQueue));
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateNotificationDataService"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">The notification data repository.</param>
 /// <param name="httpClientFactory">The HTTP client factory.</param>
 public UpdateNotificationDataService(
     INotificationDataRepository notificationDataRepository,
     IHttpClientFactory httpClientFactory)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.httpClientFactory          = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
 }
        /// <summary>
        /// Create a new draft notification.
        /// </summary>
        /// <param name="notificationRepository">The notification repository.</param>
        /// <param name="notification">Draft Notification model class instance passed in from Web API.</param>
        /// <param name="userName">Name of the user who is running the application.</param>
        /// <returns>The newly created notification's id.</returns>
        public static async Task <string> CreateDraftNotificationAsync(
            this INotificationDataRepository notificationRepository,
            DraftNotification notification,
            string userName)
        {
            var newId = notificationRepository.TableRowKeyGenerator.CreateNewKeyOrderingOldestToMostRecent();

            var notificationEntity = new NotificationDataEntity
            {
                PartitionKey = NotificationDataTableNames.DraftNotificationsPartition,
                RowKey       = newId,
                Id           = newId,
                Title        = notification.Title,
                ImageLink    = notification.ImageLink,
                Summary      = notification.Summary,
                Author       = notification.Author,
                ButtonTitle  = notification.ButtonTitle,
                ButtonLink   = notification.ButtonLink,
                CreatedBy    = userName,
                CreatedDate  = DateTime.UtcNow,
                IsDraft      = true,
                Teams        = notification.Teams,
                Rosters      = notification.Rosters,
                Groups       = notification.Groups,
                AllUsers     = notification.AllUsers,
            };

            await notificationRepository.CreateOrUpdateAsync(notificationEntity);

            return(newId);
        }
Example #5
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));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupDataController"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository instance.</param>
 /// <param name="groupsService">Microsoft Graph service instance.</param>
 public GroupDataController(
     INotificationDataRepository notificationDataRepository,
     IGroupsService groupsService)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.groupsService = groupsService ?? throw new ArgumentNullException(nameof(groupsService));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HandleFailureActivity"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 /// <param name="localizer">Localization service.</param>
 public HandleFailureActivity(
     INotificationDataRepository notificationDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Example #8
0
 /// <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)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.exportDataRepository       = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationService"/> class.
 /// </summary>
 /// <param name="globalSendingNotificationDataRepository">The global sending notification data repository.</param>
 /// <param name="sentNotificationDataRepository">The sent notification data repository.</param>
 /// <param name="notificationDataRepository">The notification data repository.</param>
 public NotificationService(
     IGlobalSendingNotificationDataRepository globalSendingNotificationDataRepository,
     ISentNotificationDataRepository sentNotificationDataRepository,
     INotificationDataRepository notificationDataRepository)
 {
     this.globalSendingNotificationDataRepository = globalSendingNotificationDataRepository ?? throw new ArgumentNullException(nameof(globalSendingNotificationDataRepository));
     this.sentNotificationDataRepository          = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataAggregationTriggerActivity"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 /// <param name="dataQueue">The data queue.</param>
 /// <param name="options">The data queue message options.</param>
 public DataAggregationTriggerActivity(
     INotificationDataRepository notificationDataRepository,
     IDataQueue dataQueue,
     IOptions <DataQueueMessageOptions> options)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.dataQueue             = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue));
     this.messageDelayInSeconds = options?.Value?.MessageDelayInSeconds ?? throw new ArgumentNullException(nameof(options));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SendMessageScheduler"/> class.
 /// </summary>
 /// <param name="logger">system logger.</param>
 /// <param name="factory">factory.</param>
 public SendMessageScheduler(ILogger <SendMessageScheduler> logger, IServiceScopeFactory factory)
 {
     this.smslogger = logger;
     this.notificationDataRepository     = factory.CreateScope().ServiceProvider.GetRequiredService <INotificationDataRepository>();
     this.sentNotificationDataRepository = factory.CreateScope().ServiceProvider.GetRequiredService <ISentNotificationDataRepository>();
     this.prepareToSendQueue             = factory.CreateScope().ServiceProvider.GetRequiredService <IPrepareToSendQueue>();
     this.dataQueue = factory.CreateScope().ServiceProvider.GetRequiredService <IDataQueue>();
     this.forceCompleteMessageDelayInSeconds = 86400;
 }
 /// <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));
 }
Example #13
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;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueScheduledMessage"/> class.
        /// </summary>
        /// <param name="notificationDataRepository">Notification data repository.</param>
        /// <param name="prepareToSendQueue">Prepare to send queue service.</param>
        /// <param name="dataQueue">data queue service.</param>
        /// <param name="dataQueueMessageOptions">data que message option service.</param>
        public QueueScheduledMessage(
            INotificationDataRepository notificationDataRepository, IPrepareToSendQueue prepareToSendQueue, IDataQueue dataQueue, IOptions <DataQueueMessageOptions> dataQueueMessageOptions)
        {
            if (dataQueueMessageOptions is null)
            {
                throw new ArgumentNullException(nameof(dataQueueMessageOptions));
            }

            this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
            this.prepareToSendQueue         = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue));
            this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue));
            this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds;
        }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SyncAllUsersActivity"/> class.
 /// </summary>
 /// <param name="userDataRepository">User Data repository.</param>
 /// <param name="sentNotificationDataRepository">Sent notification data repository.</param>
 /// <param name="usersService">Users service.</param>
 /// <param name="notificationDataRepository">Notification data entity repository.</param>
 /// <param name="localizer">Localization service.</param>
 public SyncAllUsersActivity(
     IUserDataRepository userDataRepository,
     ISentNotificationDataRepository sentNotificationDataRepository,
     IUsersService usersService,
     INotificationDataRepository notificationDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.userDataRepository             = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
     this.usersService = usersService ?? throw new ArgumentNullException(nameof(usersService));
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DistributionListDataRepository"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">The notification service.</param>
 /// <param name="logger">The logging service.</param>
 /// <param name="repositoryOptions">Options used to create the repository.</param>
 /// <param name="tableRowKeyGenerator">Table row key generator service.</param>
 public DistributionListDataRepository(
     INotificationDataRepository notificationDataRepository,
     ILogger <DistributionListDataRepository> logger,
     IOptions <RepositoryOptions> repositoryOptions,
     TableRowKeyGenerator tableRowKeyGenerator)
     : base(
         logger,
         storageAccountConnectionString: repositoryOptions.Value.StorageAccountConnectionString,
         tableName: DistributionListDataTableNames.TableName,
         defaultPartitionKey: DistributionListDataTableNames.DistributionListPartition,
         ensureTableExists: repositoryOptions.Value.EnsureTableExists)
 {
     this.TableRowKeyGenerator = tableRowKeyGenerator;
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SentNotificationDataRepository"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">The notification service.</param>
 /// <param name="logger">The logging service.</param>
 /// <param name="repositoryOptions">Options used to create the repository.</param>
 public SentNotificationDataRepository(
     INotificationDataRepository notificationDataRepository,
     ILogger <SentNotificationDataRepository> logger,
     IOptions <RepositoryOptions> repositoryOptions)
     : base(
         logger,
         storageAccountConnectionString: repositoryOptions.Value.StorageAccountConnectionString,
         tableName: SentNotificationDataTableNames.TableName,
         defaultPartitionKey: SentNotificationDataTableNames.DefaultPartition,
         ensureTableExists: repositoryOptions.Value.EnsureTableExists)
 {
     // this.messageService = messageService ?? throw new ArgumentNullException(nameof(messageService));
     // this.messageService = messageService;
 }
 /// <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="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="UploadActivityAll"/> class.
 /// </summary>
 /// <param name="repositoryOptions">the repository options.</param>
 /// <param name="userDataStream">the user data stream.</param>
 /// <param name="localizer">Localization service.</param>
 /// <param name="notificationDataRepository">notificationDataRepository.</param>
 /// <param name="sentNotificationDataRepstry">sentNotificationDataRepstry.</param>
 /// <param name="channelDataRepository">Channel data repository service that deals with the table storage in azure.</param>
 public UploadActivityAll(
     IOptions <RepositoryOptions> repositoryOptions,
     IDataStreamFacade userDataStream,
     IStringLocalizer <Strings> localizer,
     INotificationDataRepository notificationDataRepository,
     ISentNotificationDataRepository sentNotificationDataRepstry,
     IChannelDataRepository channelDataRepository)
 {
     this.storageConnectionString = repositoryOptions.Value.StorageAccountConnectionString;
     this.userDataStream          = userDataStream;
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
     this.notificationDataRepository  = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.sentNotificationDataRepstry = sentNotificationDataRepstry ?? throw new ArgumentNullException(nameof(sentNotificationDataRepstry));
     this.channelDataRepository       = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository));
 }
Example #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataFunction"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">The notification data repository.</param>
 /// <param name="aggregateSentNotificationDataService">The service to aggregate the Sent
 /// Notification Data results.</param>
 /// <param name="updateNotificationDataService">The service to update the notification totals.</param>
 /// <param name="dataQueue">The data queue.</param>
 /// <param name="dataQueueMessageOptions">The data queue message options.</param>
 public DataFunction(
     INotificationDataRepository notificationDataRepository,
     AggregateSentNotificationDataService aggregateSentNotificationDataService,
     UpdateNotificationDataService updateNotificationDataService,
     IDataQueue dataQueue,
     IOptions <DataQueueMessageOptions> dataQueueMessageOptions)
 {
     this.notificationDataRepository           = notificationDataRepository;
     this.aggregateSentNotificationDataService = aggregateSentNotificationDataService;
     this.updateNotificationDataService        = updateNotificationDataService;
     this.dataQueue = dataQueue;
     this.firstTenMinutesRequeueMessageDelayInSeconds =
         dataQueueMessageOptions.Value.FirstTenMinutesRequeueMessageDelayInSeconds;
     this.requeueMessageDelayInSeconds =
         dataQueueMessageOptions.Value.RequeueMessageDelayInSeconds;
 }
 /// <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));
 }
Example #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SendFileCardActivity"/> class.
 /// </summary>
 /// <param name="botOptions">the bot options.</param>
 /// <param name="botAdapter">the users service.</param>
 /// <param name="userDataRepository">the user data repository.</param>
 /// <param name="conversationService">The create author conversation service.</param>
 /// <param name="options">Teams conversation options.</param>
 /// <param name="notificationDataRepository">Notification data entity repository.</param>
 /// <param name="localizer">Localization service.</param>
 public SendFileCardActivity(
     IOptions <BotOptions> botOptions,
     ICCBotFrameworkHttpAdapter botAdapter,
     IUserDataRepository userDataRepository,
     IConversationService conversationService,
     IOptions <TeamsConversationOptions> options,
     INotificationDataRepository notificationDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.botAdapter                 = botAdapter ?? throw new ArgumentNullException(nameof(botAdapter));
     this.authorAppId                = botOptions?.Value?.AuthorAppId ?? throw new ArgumentNullException(nameof(botOptions));
     this.userDataRepository         = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.conversationService        = conversationService ?? throw new ArgumentNullException(nameof(conversationService));
     this.options                    = options?.Value ?? throw new ArgumentNullException(nameof(options));
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.localizer                  = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Example #24
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="AuthorTeamsActivityHandler"/> class.
 /// </summary>
 /// <param name="teamsFileUpload">File upload service.</param>
 /// <param name="userDataService">User data service.</param>
 /// <param name="appSettingsService">App Settings service.</param>
 /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param>
 /// <param name="channelDataRepository">ChannelDataRepository.</param>
 /// <param name="adaptiveCardCreator">adaptiveCardCreator .</param>
 /// <param name="templateDataRepository">templateD ataRepository.</param>
 /// <param name="localizer">Localization service.</param>
 public AuthorTeamsActivityHandler(
     TeamsFileUpload teamsFileUpload,
     IUserDataService userDataService,
     IAppSettingsService appSettingsService,
     INotificationDataRepository notificationDataRepository,
     IChannelDataRepository channelDataRepository,
     AdaptiveCardCreator adaptiveCardCreator,
     ITemplateDataRepository templateDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.userDataService            = userDataService ?? throw new ArgumentNullException(nameof(userDataService));
     this.teamsFileUpload            = teamsFileUpload ?? throw new ArgumentNullException(nameof(teamsFileUpload));
     this.appSettingsService         = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.adaptiveCardCreator        = adaptiveCardCreator ?? throw new ArgumentNullException(nameof(adaptiveCardCreator));
     this.templateDataRepository     = templateDataRepository ?? throw new ArgumentNullException(nameof(templateDataRepository));
     this.channelDataRepository      = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository));
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Example #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamsConversationActivity"/> class.
 /// </summary>
 /// <param name="conversationService">The create user conversation service.</param>
 /// <param name="sentNotificationDataRepository">The sent notification data repository.</param>
 /// <param name="userDataRepository">The user data repository.</param>
 /// <param name="notificationDataRepository">Notification data entity repository.</param>
 /// <param name="appManagerService">App manager service.</param>
 /// <param name="chatsService">Chats service.</param>
 /// <param name="appSettingsService">App Settings service.</param>
 /// <param name="options">Teams conversation options.</param>
 /// <param name="localizer">Localization service.</param>
 public TeamsConversationActivity(
     IConversationService conversationService,
     ISentNotificationDataRepository sentNotificationDataRepository,
     IUserDataRepository userDataRepository,
     INotificationDataRepository notificationDataRepository,
     IAppManagerService appManagerService,
     IChatsService chatsService,
     IAppSettingsService appSettingsService,
     IOptions <TeamsConversationOptions> options,
     IStringLocalizer <Strings> localizer)
 {
     this.conversationService            = conversationService ?? throw new ArgumentNullException(nameof(conversationService));
     this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
     this.userDataRepository             = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.notificationDataRepository     = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.appManagerService  = appManagerService ?? throw new ArgumentNullException(nameof(appManagerService));
     this.chatsService       = chatsService ?? throw new ArgumentNullException(nameof(chatsService));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
     this.options            = options?.Value ?? throw new ArgumentNullException(nameof(options));
     this.localizer          = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Example #27
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="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));
 }
Example #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateNotificationStatusActivity"/> class.
 /// </summary>
 /// <param name="notificationRepository">Notification data repository.</param>
 public UpdateNotificationStatusActivity(INotificationDataRepository notificationRepository)
 {
     this.notificationRepository = notificationRepository ?? throw new ArgumentNullException(nameof(notificationRepository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateNotificationDataService"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">The notification data repository.</param>
 public UpdateNotificationDataService(
     INotificationDataRepository notificationDataRepository)
 {
     this.notificationDataRepository = notificationDataRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PrepareToSendFunction"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 public PrepareToSendFunction(
     INotificationDataRepository notificationDataRepository)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
 }