/// <summary>
        /// Extension method for adding the Twilio integration to the the WardenConfiguration.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="configuration">Configuration of TwilioIntegration.</param>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder IntegrateWithTwilio(
            this WardenConfiguration.Builder builder,
            TwilioIntegrationConfiguration configuration)
        {
            builder.AddIntegration(TwilioIntegration.Create(configuration));

            return(builder);
        }
Beispiel #2
0
        public TwilioIntegration(TwilioIntegrationConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                                                "Twilio Integration configuration has not been provided.");
            }

            _configuration = configuration;
        }
Beispiel #3
0
 /// <summary>
 /// Constructor of fluent builder for the TwilioIntegrationConfiguration.
 /// </summary>
 /// <param name="accountSid">SID of the Twilio account.</param>
 /// <param name="authToken">Authentication token of the Twilio account.</param>
 /// <param name="sender">Phone number of the SMS sender.</param>
 /// <returns>Instance of fluent builder for the TwilioIntegrationConfiguration.</returns>
 public Builder(string accountSid, string authToken, string sender)
 {
     Configuration = new TwilioIntegrationConfiguration(accountSid, authToken, sender);
 }
Beispiel #4
0
 /// <summary>
 /// Factory method for creating a new instance of TwilioIntegration.
 /// </summary>
 /// <param name="configuration">Configuration of Twilio integration.</param>
 /// <returns>Instance of TwilioIntegration.</returns>
 public static TwilioIntegration Create(TwilioIntegrationConfiguration configuration)
 => new TwilioIntegration(configuration);