Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GrowActivityHandler"/> class.
 /// </summary>
 /// <param name="logger">Logger implementation to send logs to the logger service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="telemetryClient">The Application Insights telemetry client.</param>
 /// <param name="messagingExtensionHelper">Helper to send cards and display projects in messaging extension.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="userDetailProvider">Provider instance to work with user data.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for activity handler.</param>
 /// <param name="teamSkillStorageProvider">Team skill storage provider dependency injection.</param>
 /// <param name="projectStorageProvider">Project storage provider dependency injection.</param>
 /// <param name="projectSearchService">Search service helper to fetch projects based on filters and search criteria.</param>
 /// <param name="notificationHelper">Instance to send notifications to users.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage table.</param>
 public GrowActivityHandler(
     ILogger <GrowActivityHandler> logger,
     IStringLocalizer <Strings> localizer,
     TelemetryClient telemetryClient,
     IMessagingExtensionHelper messagingExtensionHelper,
     UserState userState,
     IUserDetailProvider userDetailProvider,
     IOptions <BotSettings> botOptions,
     ITeamSkillStorageProvider teamSkillStorageProvider,
     IProjectStorageProvider projectStorageProvider,
     IProjectSearchService projectSearchService,
     NotificationHelper notificationHelper,
     ITeamStorageProvider teamStorageProvider)
 {
     this.logger                   = logger;
     this.localizer                = localizer;
     this.telemetryClient          = telemetryClient;
     this.messagingExtensionHelper = messagingExtensionHelper;
     this.userState                = userState;
     this.userDetailProvider       = userDetailProvider;
     this.botOptions               = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.teamSkillStorageProvider = teamSkillStorageProvider;
     this.projectStorageProvider   = projectStorageProvider;
     this.projectSearchService     = projectSearchService;
     this.notificationHelper       = notificationHelper;
     this.teamStorageProvider      = teamStorageProvider;
 }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RewardAndRecognitionActivityHandler"/> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="localizer">The current cultures' string localizer.</param>
        /// <param name="telemetryClient">The application insights telemetry client. </param>
        /// <param name="options">The options.</param>
        /// <param name="telemetryOptions">Telemetry instrumentation key</param>
        /// <param name="configureAdminStorageProvider">Provider for fetching information about admin details from storage table.</param>
        /// <param name="teamStorageProvider">Provider for fetching information about team details from storage table.</param>
        /// <param name="awardsStorageProvider">Provider for fetching information about awards from storage table.</param>
        /// <param name="endorseDetailStorageProvider">Provider for fetching information about endorsement details from storage table.</param>
        /// <param name="rewardCycleStorageProvider">Provider for fetching information about active award cycle details from storage table.</param>
        /// <param name="nominateDetailSearchService">Provider to search nomination details in Azure search service.</param>
        /// <param name="botAdapter">Bot adapter.</param>
        /// <param name="microsoftAppCredentials">MicrosoftAppCredentials of bot.</param>
        public RewardAndRecognitionActivityHandler(
            ILogger <RewardAndRecognitionActivityHandler> logger,
            IStringLocalizer <Strings> localizer,
            TelemetryClient telemetryClient,
            IOptions <RewardAndRecognitionActivityHandlerOptions> options,
            IOptions <TelemetryOptions> telemetryOptions,
            IConfigureAdminStorageProvider configureAdminStorageProvider,
            ITeamStorageProvider teamStorageProvider,
            IAwardsStorageProvider awardsStorageProvider,
            IEndorseDetailStorageProvider endorseDetailStorageProvider,
            IRewardCycleStorageProvider rewardCycleStorageProvider,
            INominateDetailSearchService nominateDetailSearchService,
            BotFrameworkAdapter botAdapter,
            MicrosoftAppCredentials microsoftAppCredentials)
        {
            options          = options ?? throw new ArgumentNullException(nameof(options));
            telemetryOptions = telemetryOptions ?? throw new ArgumentNullException(nameof(telemetryOptions));

            this.logger                        = logger;
            this.localizer                     = localizer;
            this.telemetryClient               = telemetryClient;
            this.options                       = options;
            this.instrumentationKey            = telemetryOptions.Value.InstrumentationKey;
            this.appBaseUrl                    = this.options.Value.AppBaseUri;
            this.configureAdminStorageProvider = configureAdminStorageProvider;
            this.teamStorageProvider           = teamStorageProvider;
            this.awardsStorageProvider         = awardsStorageProvider;
            this.endorseDetailStorageProvider  = endorseDetailStorageProvider;
            this.rewardCycleStorageProvider    = rewardCycleStorageProvider;
            this.nominateDetailSearchService   = nominateDetailSearchService;
            this.botAdapter                    = botAdapter;
            this.microsoftAppCredentials       = microsoftAppCredentials;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationController"/> class.
 /// </summary>
 /// <param name="adapter">bot adapter.</param>
 /// <param name="configuration">configuration.</param>
 /// <param name="logger">Sends logs to the Application Insights service.</param>
 /// <param name="teamStorageProvider">Store or update teams details in Azure table storage.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 public NotificationController(IBotFrameworkHttpAdapter adapter, IConfiguration configuration, ILogger <NotificationController> logger, ITeamStorageProvider teamStorageProvider, IStringLocalizer <Strings> localizer)
 {
     this.adapter             = adapter;
     this.configuration       = configuration;
     this.logger              = logger;
     this.teamStorageProvider = teamStorageProvider;
     this.localizer           = localizer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationController"/> class.
 /// </summary>
 /// <param name="adapter">bot adapter.</param>
 /// <param name="botSettingsOptions">Bot settings options.</param>
 /// <param name="logger">Provider to store logs in Azure Application Insights.</param>
 /// <param name="teamStorageProvider">Store or update teams details in Azure table storage.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="microsoftAppCredentials">MicrosoftAppCredentials of bot.</param>
 public NotificationController(IBotFrameworkHttpAdapter adapter, IOptions <RewardAndRecognitionActivityHandlerOptions> botSettingsOptions, ILogger <NotificationController> logger, ITeamStorageProvider teamStorageProvider, IStringLocalizer <Strings> localizer, MicrosoftAppCredentials microsoftAppCredentials)
 {
     this.adapter                 = adapter;
     this.botSettingsOptions      = botSettingsOptions;
     this.logger                  = logger;
     this.teamStorageProvider     = teamStorageProvider;
     this.localizer               = localizer;
     this.microsoftAppCredentials = microsoftAppCredentials;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamsInfoHelper"/> class.
 /// </summary>
 /// <param name="botAdapter">Bot adapter.</param>
 /// <param name="teamStorageProvider">Provider to fetch team details from Azure Storage.</param>
 /// <param name="microsoftAppCredentials">Microsoft application credentials.</param>
 /// <param name="logger">Logger implementation to send logs to the logger service.</param>
 public TeamsInfoHelper(
     IBotFrameworkHttpAdapter botAdapter,
     ITeamStorageProvider teamStorageProvider,
     MicrosoftAppCredentials microsoftAppCredentials,
     ILogger<TeamsInfoHelper> logger)
 {
     this.botAdapter = botAdapter;
     this.teamStorageProvider = teamStorageProvider;
     this.microsoftAppCredentials = microsoftAppCredentials;
     this.logger = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamsInfoHelper"/> class.
 /// </summary>
 /// <param name="botAdapter">Bot adapter.</param>
 /// <param name="teamStorageProvider">Provider to fetch team details from Azure Table Storage.</param>
 /// <param name="microsoftAppCredentials">Microsoft application credentials.</param>
 /// <param name="logger">Logger implementation to send logs to the logger service.</param>
 public TeamsInfoHelper(
     IBotFrameworkHttpAdapter botAdapter,
     ITeamStorageProvider teamStorageProvider,
     MicrosoftAppCredentials microsoftAppCredentials,
     ILogger <TeamsInfoHelper> logger)
 {
     this.botAdapter              = botAdapter ?? throw new ArgumentNullException(nameof(botAdapter));
     this.teamStorageProvider     = teamStorageProvider ?? throw new ArgumentNullException(nameof(teamStorageProvider));
     this.microsoftAppCredentials = microsoftAppCredentials;
     this.logger = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigureAdminController"/> class.
 /// </summary>
 /// <param name="logger">Instance to send logs to the application insights service.</param>
 /// <param name="botAdapter">Reward and Recognition bot adapter.</param>
 /// <param name="microsoftAppCredentials">Microsoft Application credentials for Bot/ME.</param>
 /// <param name="storageProvider">Provider to store admin details in Azure Table Storage.</param>
 /// <param name="teamStorageProvider">Store or update teams details in Azure table storage.</param>
 public ConfigureAdminController(
     ILogger <ConfigureAdminController> logger,
     BotFrameworkAdapter botAdapter,
     MicrosoftAppCredentials microsoftAppCredentials,
     IConfigureAdminStorageProvider storageProvider,
     ITeamStorageProvider teamStorageProvider)
     : base()
 {
     this.logger              = logger;
     this.botAdapter          = botAdapter;
     this.teamStorageProvider = teamStorageProvider;
     this.appId           = microsoftAppCredentials != null ? microsoftAppCredentials.MicrosoftAppId : throw new ArgumentNullException(nameof(microsoftAppCredentials));
     this.storageProvider = storageProvider;
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DigestNotificationHelper"/> class.
 /// </summary>
 /// <param name="logger">Logger implementation to send logs to the logger service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="adapter">Bot adapter.</param>
 /// <param name="teamPreferenceStorageProvider">Storage provider for team preference.</param>
 /// <param name="teamIdeaSearchService">The team idea search service dependency injection.</param>
 /// <param name="teamIdeaStorageHelper">Team idea storage helper dependency injection.</param>
 /// <param name="teamStorageProvider">Team storage provider dependency injection.</param>
 public DigestNotificationHelper(
     ILogger <DigestNotificationHelper> logger,
     IStringLocalizer <Strings> localizer,
     IOptions <BotSettings> botOptions,
     IBotFrameworkHttpAdapter adapter,
     ITeamPreferenceStorageProvider teamPreferenceStorageProvider,
     IIdeaSearchService teamIdeaSearchService,
     IIdeaStorageHelper teamIdeaStorageHelper,
     ITeamStorageProvider teamStorageProvider)
 {
     this.logger     = logger;
     this.localizer  = localizer;
     this.botOptions = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.adapter    = adapter;
     this.teamPreferenceStorageProvider = teamPreferenceStorageProvider;
     this.teamIdeaSearchService         = teamIdeaSearchService;
     this.teamIdeaStorageHelper         = teamIdeaStorageHelper;
     this.teamStorageProvider           = teamStorageProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationHelper"/> class.
 /// </summary>
 /// <param name="logger">Logger implementation to send logs to the logger service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="storageProvider">Storage provider for Introduction storage.</param>
 /// <param name="userStorageProvider">User Storage provider for Introduction storage.</param>
 /// <param name="sharePointOptions">A set of key/value pair configuration properties for SharePoint.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 /// <param name="notificationCardHelper">Helper for working with bot notification card.</param>
 public NotificationHelper(
     IIntroductionStorageProvider storageProvider,
     IUserStorageProvider userStorageProvider,
     ILogger <NotificationHelper> logger,
     IStringLocalizer <Strings> localizer,
     IOptions <BotOptions> botOptions,
     IOptions <SharePointSettings> sharePointOptions,
     ITeamStorageProvider teamStorageProvider,
     INotificationCardHelper notificationCardHelper)
 {
     this.introductionStorageProvider = storageProvider;
     this.userStorageProvider         = userStorageProvider;
     this.logger                 = logger;
     this.localizer              = localizer;
     this.botOptions             = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.sharePointOptions      = sharePointOptions ?? throw new ArgumentNullException(nameof(sharePointOptions));
     this.teamStorageProvider    = teamStorageProvider;
     this.notificationCardHelper = notificationCardHelper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationHelper"/> class.
 /// </summary>
 /// <param name="rewardCycleStorageProvider">Reward cycle storage provider.</param>
 /// <param name="awardsStorageProvider">Award storage provider.</param>
 /// <param name="teamStorageProvider">Teams storage provider.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="options">A set of key/value application configuration properties.</param>
 /// <param name="adapter">Bot adapter.</param>
 /// <param name="microsoftAppCredentials">MicrosoftAppCredentials of bot.</param>
 public NotificationHelper(
     IRewardCycleStorageProvider rewardCycleStorageProvider,
     ITeamStorageProvider teamStorageProvider,
     IAwardsStorageProvider awardsStorageProvider,
     ILogger <RewardCycleHelper> logger,
     IStringLocalizer <Strings> localizer,
     IOptions <RewardAndRecognitionActivityHandlerOptions> options,
     IBotFrameworkHttpAdapter adapter,
     MicrosoftAppCredentials microsoftAppCredentials)
 {
     this.rewardCycleStorageProvider = rewardCycleStorageProvider;
     this.logger    = logger;
     this.localizer = localizer;
     this.options   = options ?? throw new ArgumentNullException(nameof(options));
     this.adapter   = adapter;
     this.microsoftAppCredentials = microsoftAppCredentials;
     this.awardsStorageProvider   = awardsStorageProvider;
     this.teamStorageProvider     = teamStorageProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityHandler{T}"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="localizer">The current culture's string localizer.</param>
 /// <param name="telemetryClient">Instance of telemetry client. </param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="adapter">Bot adapter used to handle bot framework HTTP requests.</param>
 /// <param name="conversationState">State management object for maintaining conversation state.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="storageOptions">A set of key/value application configuration properties for storage.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 /// <param name="userStorageProvider">Provider for fetching information about user details from storage.</param>
 /// <param name="learningPlanHelper">Instance of learning plan helper.</param>
 /// <param name="introductionStorageProvider">Provider for fetching information about new hire introduction details from storage.</param>
 /// <param name="tokenHelper">Helper for JWT token generation and validation.</param>
 /// <param name="activityHelper">Helper for working with bot activity handler.</param>
 /// <param name="notificationCardHelper">Helper for working with bot notification card.</param>
 /// <param name="introductionCardHelper">Helper for working with introduction cards.</param>
 /// <param name="sharePointOptions">A set of key/value application configuration properties for SharePoint.</param>
 /// <param name="dialog">Base class for all bot dialogs.</param>
 public ActivityHandler(
     ILogger <ActivityHandler> logger,
     IStringLocalizer <Strings> localizer,
     TelemetryClient telemetryClient,
     UserState userState,
     IBotFrameworkHttpAdapter adapter,
     ConversationState conversationState,
     IOptions <BotOptions> botOptions,
     IOptions <StorageSettings> storageOptions,
     ITeamStorageProvider teamStorageProvider,
     IUserStorageProvider userStorageProvider,
     ILearningPlanHelper learningPlanHelper,
     IIntroductionStorageProvider introductionStorageProvider,
     ITokenHelper tokenHelper,
     IActivityHelper activityHelper,
     INotificationCardHelper notificationCardHelper,
     IIntroductionCardHelper introductionCardHelper,
     IOptions <SharePointSettings> sharePointOptions,
     T dialog)
 {
     this.logger                      = logger;
     this.localizer                   = localizer;
     this.telemetryClient             = telemetryClient;
     this.userState                   = userState;
     this.adapter                     = adapter;
     this.conversationState           = conversationState;
     this.botOptions                  = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.storageOptions              = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions));
     this.teamStorageProvider         = teamStorageProvider;
     this.userStorageProvider         = userStorageProvider;
     this.learningPlanHelper          = learningPlanHelper;
     this.introductionStorageProvider = introductionStorageProvider;
     this.tokenHelper                 = tokenHelper;
     this.activityHelper              = activityHelper;
     this.notificationCardHelper      = notificationCardHelper;
     this.introductionCardHelper      = introductionCardHelper;
     this.sharePointOptions           = sharePointOptions ?? throw new ArgumentNullException(nameof(sharePointOptions));
     this.dialog                      = dialog;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SubmitIdeaActivityHandler"/> class.
 /// </summary>
 /// <param name="logger">Instance to send logs to the logger service.</param>
 /// <param name="localizer">The current cultures' string localizer.</param>
 /// <param name="telemetryClient">The Application Insights telemetry client.</param>
 /// <param name="messagingExtensionHelper">Messaging Extension helper dependency injection.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="teamPreferenceStorageHelper">Team preference storage helper dependency injection.</param>
 /// <param name="teamPreferenceStorageProvider">Team preference storage provider dependency injection.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for activity handler.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 public SubmitIdeaActivityHandler(
     ILogger <SubmitIdeaActivityHandler> logger,
     IStringLocalizer <Strings> localizer,
     TelemetryClient telemetryClient,
     IMessagingExtensionHelper messagingExtensionHelper,
     UserState userState,
     ITeamPreferenceStorageHelper teamPreferenceStorageHelper,
     ITeamPreferenceStorageProvider teamPreferenceStorageProvider,
     IOptions <BotSettings> botOptions,
     ITeamStorageProvider teamStorageProvider)
 {
     this.logger                        = logger;
     this.localizer                     = localizer;
     this.telemetryClient               = telemetryClient;
     this.messagingExtensionHelper      = messagingExtensionHelper;
     this.userState                     = userState;
     this.teamPreferenceStorageHelper   = teamPreferenceStorageHelper;
     this.teamPreferenceStorageProvider = teamPreferenceStorageProvider;
     this.botOptions                    = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.curatorTeamId                 = botOptions.Value.CuratorTeamId;
     this.teamStorageProvider           = teamStorageProvider;
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityHelper{T}"/> class.
 /// </summary>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="teamStorageProvider">Provider for fetching information about team details from storage.</param>
 /// <param name="localizer">The current culture's string localizer.</param>
 /// <param name="dialog">Base class for all bot dialogs.</param>
 /// <param name="conversationState">State management object for maintaining conversation state.</param>
 /// <param name="teamMembershipHelper">Helper for team operations with Microsoft Graph API.</param>
 /// <param name="userProfileGraphApiHelper">Helper for user profile operations with Microsoft Graph API.</param>
 /// <param name="introductionStorageProvider">Provider for fetching information about new joiner introduction details from storage.</param>
 /// <param name="sharePointHelper">Helper for working with SharePoint.</param>
 /// <param name="introductionCardHelper">Helper for working with introduction cards.</param>
 /// <param name="graphUtility">Instance of Microsoft Graph utility helper.</param>
 /// <param name="welcomeCardFactory">Factory for working with welcome card attachments.</param>
 /// <param name="botOptions">A set of key/value application configuration properties for bot.</param>
 /// <param name="userStorageProvider">Provider for fetching information about user details from storage.</param>
 /// <param name="securityGroupSettings"> A set of key/value application configuration properties for AAD security group settings.</param>
 /// <param name="feedbackProvider">Provider for fetching information about new joiner feedbacks from storage.</param>
 /// <param name="imageUploadProvider">Provider for uploading user image to blob storage.</param>
 public ActivityHelper(
     ILogger <ActivityHelper <T> > logger,
     UserState userState,
     ITeamStorageProvider teamStorageProvider,
     IStringLocalizer <Strings> localizer,
     T dialog,
     ConversationState conversationState,
     ITeamMembership teamMembershipHelper,
     IUserProfile userProfileGraphApiHelper,
     IIntroductionStorageProvider introductionStorageProvider,
     ISharePointHelper sharePointHelper,
     IIntroductionCardHelper introductionCardHelper,
     IGraphUtilityHelper graphUtility,
     IWelcomeCardFactory welcomeCardFactory,
     IOptions <BotOptions> botOptions,
     IUserStorageProvider userStorageProvider,
     IOptions <AadSecurityGroupSettings> securityGroupSettings,
     IFeedbackProvider feedbackProvider,
     IImageUploadProvider imageUploadProvider)
 {
     this.logger                      = logger;
     this.userState                   = userState;
     this.teamStorageProvider         = teamStorageProvider;
     this.localizer                   = localizer;
     this.dialog                      = dialog;
     this.conversationState           = conversationState;
     this.teamOperationGraphApiHelper = teamMembershipHelper;
     this.userProfileGraphApiHelper   = userProfileGraphApiHelper;
     this.introductionStorageProvider = introductionStorageProvider;
     this.sharePointHelper            = sharePointHelper;
     this.introductionCardHelper      = introductionCardHelper;
     this.graphUtility                = graphUtility;
     this.welcomeCardFactory          = welcomeCardFactory;
     this.botOptions                  = botOptions ?? throw new ArgumentNullException(nameof(botOptions));
     this.userStorageProvider         = userStorageProvider;
     this.securityGroupSettings       = securityGroupSettings ?? throw new ArgumentNullException(nameof(securityGroupSettings));
     this.feedbackProvider            = feedbackProvider;
     this.imageUploadProvider         = imageUploadProvider;
 }