예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExchangeSyncHelper"/> class.
 /// </summary>
 /// <param name="roomCollectionStorageProvider">Storage provider to perform insert, update and delete operations on RoomCollection table.</param>
 /// <param name="favoriteStorageProvider">Storage provider to perform delete operation on UserFavorites table.</param>
 /// <param name="apiHelper">Api helper service for making post and get calls to Graph.</param>
 /// <param name="telemetryClient">Telemetry service to log events and errors.</param>
 /// <param name="confidentialClientApplication">Used to get application access token.</param>
 /// <param name="searchService">Search service for searching room/building as per user input.</param>
 public ExchangeSyncHelper(IRoomCollectionStorageProvider roomCollectionStorageProvider, IFavoriteStorageProvider favoriteStorageProvider, IGraphApiHelper apiHelper, TelemetryClient telemetryClient, IConfidentialClientApplication confidentialClientApplication, ISearchService searchService)
 {
     this.searchService = searchService;
     this.roomCollectionStorageProvider = roomCollectionStorageProvider;
     this.favoriteStorageProvider       = favoriteStorageProvider;
     this.apiHelper       = apiHelper;
     this.telemetryClient = telemetryClient;
     this.confidentialClientApplication = confidentialClientApplication;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelHelper"/> class.
 /// </summary>
 /// <param name="microsoftAppCredentials">App Credentials.</param>
 /// <param name="optionsAccessor">A set of key/value application configuration properties for Group activities bot.</param>
 /// <param name="groupActivityStorageHelper">Helper for storing group activity details in azure table storage.</param>
 /// <param name="graphApiHelper">Helper for accessing Microsoft Graph API.</param>
 /// <param name="groupNotificationStorageHelper">Helper for sending notification in channel.</param>
 /// <param name="backgroundTaskWrapper">Instance for background task wrapper.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 public ChannelHelper(ILogger <ChannelHelper> logger, IOptionsMonitor <BotAppSetting> optionsAccessor, IGroupNotificationStorageHelper groupNotificationStorageHelper, IGroupActivityStorageHelper groupActivityStorageHelper, IGraphApiHelper graphApiHelper, MicrosoftAppCredentials microsoftAppCredentials, BackgroundTaskWrapper backgroundTaskWrapper)
 {
     this.options        = optionsAccessor.CurrentValue;
     this.graphApiHelper = graphApiHelper;
     this.logger         = logger;
     this.groupNotificationStorageHelper = groupNotificationStorageHelper;
     this.groupActivityStorageHelper     = groupActivityStorageHelper;
     this.tenantId = this.options.TenantId;
     this.microsoftAppCredentials = microsoftAppCredentials;
     this.taskWrapper             = backgroundTaskWrapper;
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExpertFinderBot"/> class.
        /// </summary>
        /// <param name="conversationState">State management object for maintaining conversation state.</param>
        /// <param name="userState">State management object for maintaining user conversation state.</param>
        /// <param name="rootDialog">Root dialog.</param>
        /// <param name="graphApiHelper">Helper for working with Microsoft Graph API.</param>
        /// <param name="tokenHelper">Helper for JWT token generation and validation.</param>
        /// <param name="sharePointApiHelper">Helper object for working with SharePoint REST API.</param>
        /// <param name="botSettings">A set of key/value application configuration properties for Expert Finder bot.</param>
        /// <param name="customTokenHelper">Helper for AAD token generation.</param>
        /// <param name="logger">Instance to send logs to the Application Insights service.</param>
        public ExpertFinderBot(ConversationState conversationState, UserState userState, MainDialog rootDialog, IGraphApiHelper graphApiHelper, ITokenHelper tokenHelper, ISharePointApiHelper sharePointApiHelper, ICustomTokenHelper customTokenHelper, IOptionsMonitor <BotSettings> botSettings, ILogger <ExpertFinderBot> logger)
        {
            this.conversationState   = conversationState;
            this.userState           = userState;
            this.rootDialog          = rootDialog;
            this.graphApiHelper      = graphApiHelper;
            this.tokenHelper         = tokenHelper;
            this.sharePointApiHelper = sharePointApiHelper;
            this.botSettings         = botSettings.CurrentValue;
            this.customTokenHelper   = customTokenHelper;
            this.logger = logger;

            this.dialogStatePropertyAccessor = this.conversationState.CreateProperty <DialogState>(nameof(DialogState));
            this.userDataPropertyAccessor    = this.conversationState.CreateProperty <UserData>("ConversationData"); // For compatibility with v1 of Expert Finder
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExpertFinderBot{T}"/> class.
 /// </summary>
 /// <param name="conversationState">State management object for maintaining conversation state.</param>
 /// <param name="userState">State management object for maintaining user conversation state.</param>
 /// <param name="dialog">Base class for bot dialog.</param>
 /// <param name="graphApiHelper">Helper for working with Microsoft Graph api.</param>
 /// <param name="tokenHelper">Helper for JWT token generation and validation.</param>
 /// <param name="sharePointApiHelper">Helper object for working with SharePoint rest api.</param>
 /// <param name="optionsAccessor">A set of key/value application configuration properties for Expert Finder bot.</param>
 /// <param name="customTokenHelper">Helper for AAD token generation.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 public ExpertFinderBot(ConversationState conversationState, UserState userState, T dialog, IGraphApiHelper graphApiHelper, ITokenHelper tokenHelper, ISharePointApiHelper sharePointApiHelper, ICustomTokenHelper customTokenHelper, IOptionsMonitor <BotSettings> optionsAccessor, ILogger <ExpertFinderBot <T> > logger)
 {
     this.conversationState             = conversationState;
     this.userState                     = userState;
     this.dialog                        = dialog;
     this.graphApiHelper                = graphApiHelper;
     this.tokenHelper                   = tokenHelper;
     this.sharePointApiHelper           = sharePointApiHelper;
     this.options                       = optionsAccessor.CurrentValue;
     this.appBaseUrl                    = this.options.AppBaseUri;
     this.connectionName                = this.options.ConnectionName;
     this.sharePointSiteUri             = this.options.SharePointSiteUrl;
     this.appInsightsInstrumentationKey = this.options.AppInsightsInstrumentationKey;
     this.tenantId                      = this.options.TenantId;
     this.customTokenHelper             = customTokenHelper;
     this.logger                        = logger;
 }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainDialog"/> class.
        /// </summary>
        /// <param name="logger">Instance to send logs to the Application Insights service.</param>
        /// <param name="graphApiHelper">Helper for working with Microsoft Graph api.</param>
        /// <param name="storageHelper">Helper for working with Microsoft Azure Table storage service.</param>
        /// /// <param name="optionsAccessor">A set of key/value application configuration properties for AADv1 connection name.</param>
        public MainDialog(IGraphApiHelper graphApiHelper, IUserProfileActivityStorageHelper storageHelper, IOptionsMonitor <AADSettings> optionsAccessor, ILogger <MainDialog> logger)
            : base(nameof(MainDialog), optionsAccessor.CurrentValue.ConnectionName)
        {
            this.graphApiHelper = graphApiHelper;
            this.storageHelper  = storageHelper;
            this.logger         = logger;

            this.AddDialog(new OAuthPrompt(
                               nameof(OAuthPrompt),
                               new OAuthPromptSettings
            {
                ConnectionName = optionsAccessor.CurrentValue.ConnectionName,
                Text           = Strings.SigninCardText,
                Title          = Strings.SignInBtnText,
                Timeout        = Convert.ToInt32(TimeSpan.FromMinutes(5).TotalMilliseconds), // In milliseconds
            }));

            this.AddDialog(new WaterfallDialog(
                               nameof(WaterfallDialog),
                               new WaterfallStep[] { this.OAuthPromptStepAsync, this.MyProfileAndSearchAsync }));

            // The initial child Dialog to run.
            this.InitialDialogId = nameof(WaterfallDialog);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainDialog"/> class.
        /// </summary>
        /// <param name="graphApiHelper">Helper for working with Microsoft Graph API.</param>
        /// <param name="storageHelper">Helper for working with Microsoft Azure Table storage service.</param>
        /// <param name="botSettings">A set of key/value application configuration properties.</param>
        /// <param name="logger">Instance to send logs to the Application Insights service.</param>
        public MainDialog(IGraphApiHelper graphApiHelper, IUserProfileActivityStorageHelper storageHelper, IOptionsMonitor <BotSettings> botSettings, ILogger <MainDialog> logger)
            : base(nameof(MainDialog), botSettings.CurrentValue.OAuthConnectionName)
        {
            this.graphApiHelper = graphApiHelper;
            this.storageHelper  = storageHelper;
            this.logger         = logger;

            this.AddDialog(new OAuthPrompt(
                               nameof(OAuthPrompt),
                               new OAuthPromptSettings
            {
                ConnectionName = botSettings.CurrentValue.OAuthConnectionName,
                Text           = Strings.SignInCardText,
                Title          = Strings.SignInButtonText,
                Timeout        = (int)TimeSpan.FromMinutes(5).TotalMilliseconds,
            }));

            this.AddDialog(new WaterfallDialog(
                               "MainDialog",
                               new WaterfallStep[] { this.CheckForUnknownInputAsync, this.OAuthPromptStepAsync, this.MyProfileAndSearchAsync }));

            // The initial child Dialog to run.
            this.InitialDialogId = "MainDialog";
        }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MeetingProvider"/> class.
 /// </summary>
 /// <param name="apiHelper">Api helper service for making post and get calls to Graph.</param>
 /// <param name="telemetryClient">Telemetry client to log event and errors.</param>
 public MeetingProvider(IGraphApiHelper apiHelper, TelemetryClient telemetryClient)
 {
     this.apiHelper       = apiHelper;
     this.telemetryClient = telemetryClient;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserConfigurationProvider"/> class.
 /// </summary>
 /// <param name="apiHelper">Api helper service for making post and get calls to Microsoft Graph APIs.</param>
 /// <param name="telemetryClient">Telemetry client for logging events and errors.</param>
 public UserConfigurationProvider(IGraphApiHelper apiHelper, TelemetryClient telemetryClient)
 {
     this.apiHelper       = apiHelper;
     this.telemetryClient = telemetryClient;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamUserHelper"/> class.
 /// </summary>
 /// <param name="graphApiHelper">Helper for accessing with Microsoft Graph API.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 public TeamUserHelper(IGraphApiHelper graphApiHelper, ILogger <TeamUserHelper> logger)
 {
     this.graphApiHelper = graphApiHelper;
     this.logger         = logger;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExchangeSyncHelper"/> class.
 /// </summary>
 /// <param name="apiHelper">Api helper service for making post and get calls to Graph.</param>
 /// <param name="telemetryClient">Telemetry service to log events and errors.</param>
 public ExchangeService(IGraphApiHelper apiHelper, TelemetryClient telemetryClient)
 {
     this.apiHelper       = apiHelper;
     this.telemetryClient = telemetryClient;
 }