/// <summary> /// Extension method for adding the Cachet integration to the the WardenConfiguration. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of CachetIntegration.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder IntegrateWithCachet( this WardenConfiguration.Builder builder, CachetIntegrationConfiguration configuration) { builder.AddIntegration(CachetIntegration.Create(configuration)); return(builder); }
public CachetIntegration(CachetIntegrationConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration), "Cachet Integration configuration has not been provided."); } _configuration = configuration; _cachetService = _configuration.CachetServiceProvider(); }
/// <summary> /// Constructor of fluent builder for the CachetIntegrationConfiguration. /// </summary> /// <param name="apiUrl">URL of the Cachet API.</param> /// <param name="username">Username of the Cachet account.</param> /// <param name="password">Password of the Cachet account.</param> /// <returns>Instance of fluent builder for the CachetIntegrationConfiguration.</returns> public Builder(string apiUrl, string username, string password) { Configuration = new CachetIntegrationConfiguration(apiUrl, username, password); }
/// <summary> /// Constructor of fluent builder for the CachetIntegrationConfiguration. /// </summary> /// <param name="apiUrl">URL of the Cachet API.</param> /// <param name="accessToken">Access token of the Cachet account.</param> /// <returns>Instance of fluent builder for the CachetIntegrationConfiguration.</returns> public Builder(string apiUrl, string accessToken) { Configuration = new CachetIntegrationConfiguration(apiUrl, accessToken); }
/// <summary> /// Factory method for creating a new instance of CachetIntegration. /// </summary> /// <param name="configuration">Configuration of Cachet integration.</param> /// <returns>Instance of CachetIntegration.</returns> public static CachetIntegration Create(CachetIntegrationConfiguration configuration) => new CachetIntegration(configuration);