/// <summary>
 /// Initializes a new instance of the <see cref="UserProfileController"/> class.
 /// </summary>
 /// <param name="sharePointApiHelper">Instance of SharePoint search REST API helper.</param>
 /// <param name="tokenHelper">Instance of class for validating custom jwt access token.</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 UserProfileController(ISharePointApiHelper sharePointApiHelper, ITokenHelper tokenHelper, IOptionsMonitor <BotSettings> botSettings, ILogger <UserProfileController> logger)
 {
     this.sharePointApiHelper = sharePointApiHelper;
     this.tokenHelper         = tokenHelper;
     this.sharePointSiteUri   = botSettings.CurrentValue.SharePointSiteUrl;
     this.logger = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserProfileController"/> class.
 /// </summary>
 /// <param name="sharePointApiHelper">Instance of SharePoint search rest api helper.</param>
 /// <param name="logger">Instance to send logs to the Application Insights service.</param>
 /// <param name="tokenHelper">Instance of class for validating custom jwt access token.</param>
 /// <param name="optionsAccessor">A set of key/value application configuration properties for SharePoint rest api.</param>
 /// <param name="customTokenHelper">Instance of class for validating AAD access token.</param>
 public UserProfileController(ISharePointApiHelper sharePointApiHelper, ITokenHelper tokenHelper, ICustomTokenHelper customTokenHelper, IOptionsMonitor <SharePointSettings> optionsAccessor, ILogger <UserProfileController> logger)
 {
     this.sharePointApiHelper = sharePointApiHelper;
     this.tokenHelper         = tokenHelper;
     this.sharePointSiteUri   = optionsAccessor.CurrentValue.SharePointSiteUrl;
     this.customTokenHelper   = customTokenHelper;
     this.logger = logger;
 }
Exemplo n.º 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;
 }