Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebexAdapter"/> class.
 /// Creates a Webex adapter.
 /// </summary>
 /// <param name="webexClient">A Webex API interface.</param>
 /// <param name="options">An instance of <see cref="WebexAdapterOptions"/>.</param>
 /// <param name="logger">The ILogger implementation this adapter should use.</param>
 public WebexAdapter(WebexClientWrapper webexClient, WebexAdapterOptions options, ILogger logger = null)
 {
     _webexClient = webexClient ?? throw new ArgumentNullException(nameof(webexClient));
     _options     = options ?? new WebexAdapterOptions();
     _logger      = logger ?? NullLogger.Instance;
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebexAdapter"/> class using configuration settings.
 /// </summary>
 /// <param name="configuration">An <see cref="IConfiguration"/> instance.</param>
 /// <remarks>
 /// The configuration keys are:
 /// WebexAccessToken: An access token for the bot.
 /// WebexPublicAddress: The root URL of the bot application.
 /// WebexSecret: The secret used to validate incoming webhooks.
 /// WebexWebhookName: A name for the webhook subscription.
 /// </remarks>
 /// <param name="options">An instance of <see cref="WebexAdapterOptions"/>.</param>
 /// <param name="logger">The ILogger implementation this adapter should use.</param>
 public WebexAdapter(IConfiguration configuration, WebexAdapterOptions options = null, ILogger logger = null)
     : this(new WebexClientWrapper(new WebexClientWrapperOptions(configuration[WebexAccessTokenKey], new Uri(configuration[WebexPublicAddressKey]), configuration[WebexSecretKey], configuration[WebexWebhookNameKey])), options, logger)
 {
 }