Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BotController"/> class.
 /// Dependency Injection will provide the Adapter and IBot implementation at runtime.
 /// </summary>
 /// <param name="adapter">Communicator Bot Adapter instance.</param>
 /// <param name="authorBot">Communicator Author Bot instance.</param>
 /// <param name="userBot">Communicator User Bot instance.</param>
 public BotController(
     AmdocsCommunicatorBotAdapter adapter,
     AuthorTeamsActivityHandler authorBot,
     UserTeamsActivityHandler userBot)
 {
     this.adapter   = adapter ?? throw new ArgumentNullException(nameof(adapter));
     this.authorBot = authorBot ?? throw new ArgumentNullException(nameof(authorBot));
     this.userBot   = userBot ?? throw new ArgumentNullException(nameof(userBot));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DraftNotificationPreviewService"/> class.
        /// </summary>
        /// <param name="botOptions">The bot options.</param>
        /// <param name="adaptiveCardCreator">Adaptive card creator service.</param>
        /// <param name="botAdapter">Bot framework http adapter instance.</param>
        public DraftNotificationPreviewService(
            IOptions <BotOptions> botOptions,
            AdaptiveCardCreator adaptiveCardCreator,
            AmdocsCommunicatorBotAdapter botAdapter)
        {
            var options = botOptions ?? throw new ArgumentNullException(nameof(botOptions));

            this.botAppId = options.Value.AuthorAppId;
            if (string.IsNullOrEmpty(this.botAppId))
            {
                throw new ApplicationException("AuthorAppId setting is missing in the configuration.");
            }

            this.adaptiveCardCreator = adaptiveCardCreator ?? throw new ArgumentNullException(nameof(adaptiveCardCreator));
            this.botAdapter          = botAdapter ?? throw new ArgumentNullException(nameof(botAdapter));
        }