/// <summary>
 /// Initializes a new instance of the <see cref="TwilioAdapter"/> class using configuration settings.
 /// </summary>
 /// <param name="configuration">An <see cref="IConfiguration"/> instance.</param>
 /// <remarks>
 /// The configuration keys are:
 /// TwilioNumber: The phone number associated with the Twilio account.
 /// TwilioAccountSid: The string identifier of the account. See https://www.twilio.com/docs/glossary/what-is-a-sid
 /// TwilioAuthToken: The authentication token for the account.
 /// TwilioValidationUrl: The validation URL for incoming requests.
 /// </remarks>
 /// <param name="adapterOptions">Options for the <see cref="TwilioAdapter"/>.</param>
 /// <param name="logger">The ILogger implementation this adapter should use.</param>
 public TwilioWhatsAppAdapter(IConfiguration configuration, TwilioAdapterOptions adapterOptions = null, ILogger logger = null)
     : this(
         new TwilioClientWrapper(new TwilioClientWrapperOptions(configuration["TwilioNumber"], configuration["TwilioAccountSid"], configuration["TwilioAuthToken"], new Uri(configuration["TwilioValidationUrl"]))), adapterOptions, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TwilioAdapter"/> class.
 /// </summary>
 /// <param name="twilioClient">The Twilio client to connect to.</param>
 /// <param name="adapterOptions">Options for the <see cref="TwilioAdapter"/>.</param>
 /// <param name="logger">The ILogger implementation this adapter should use.</param>
 public TwilioWhatsAppAdapter(TwilioClientWrapper twilioClient, TwilioAdapterOptions adapterOptions, ILogger logger = null)
 {
     _twilioClient = twilioClient ?? throw new ArgumentNullException(nameof(twilioClient));
     _logger       = logger ?? NullLogger.Instance;
     _options      = adapterOptions ?? new TwilioAdapterOptions();
 }
Ejemplo n.º 3
0
 public TwilioClientWrapper(TwilioClientWrapperOptions options, TwilioAdapterOptions adapterOptions, ILogger logger) : this(options)
 {
 }