/// <summary> /// Load Webhook configuration into a Webhook configuration object /// </summary> /// <returns>A Webhook configuration object</returns> public static Webhook Load(string preset = "maestrano") { var config = new Webhook(); config.Account = WebhookAccount.Load(preset); config.Connec = WebhookConnec.Load(preset); return(config); }
/// <summary> /// Load WebhookConnec configuration into a WebhookConnec configuration object /// </summary> /// <returns>A WebhooAccount configuration object</returns> public static WebhookConnec Load(string preset = "maestrano") { var config = ConfigurationManager.GetSection(preset + "/webhook/connec") as WebhookConnec; if (config == null) config = new WebhookConnec(); config.Subscriptions = WebhookConnecSubscriptions.Load(); return config; }
/// <summary> /// Load Webhook into a Connec configuration object from a JObject /// </summary> /// <returns>A Webhook configuration object</returns> public static Webhook LoadFromJson(JObject obj) { var config = new Webhook(); config.Account = WebhookAccount.LoadFromJson(obj["account"].Value <JObject>()); config.Connec = WebhookConnec.LoadFromJson(obj["connec"].Value <JObject>()); return(config); }
/// <summary> /// Load Webhook into a WebhookAccount configuration object from a JObject /// </summary> /// <returns>A WebhookAccount configuration object</returns> public static WebhookConnec LoadFromJson(JObject obj) { var config = new WebhookConnec(); config.NotificationPath = obj["notification_path"].Value <string>(); config.InitializationPath = obj["initialization_path"].Value <string>(); config.ExternalIds = obj["external_ids"].Value <bool>(); config.Subscriptions = new WebhookConnecSubscriptions(); return(config); }
/// <summary> /// Load WebhookConnec configuration into a WebhookConnec configuration object /// </summary> /// <returns>A WebhooAccount configuration object</returns> public static WebhookConnec Load() { var config = ConfigurationManager.GetSection("maestrano/webhook/connec") as WebhookConnec; if (config == null) { config = new WebhookConnec(); } config.Subscriptions = WebhookConnecSubscriptions.Load(); return(config); }
/// <summary> /// Load WebhookConnec configuration into a WebhookConnec configuration object /// </summary> /// <returns>A WebhooAccount configuration object</returns> public static WebhookConnec Load(string preset = "maestrano") { ConfigurationManager.RefreshSection(preset + "/webhook/connec"); var config = ConfigurationManager.GetSection(preset + "/webhook/connec") as WebhookConnec; if (config == null) { config = new WebhookConnec(); } config.Subscriptions = WebhookConnecSubscriptions.Load(); return(config); }
/// <summary> /// Load Webhook into a WebhookAccount configuration object from a JObject /// </summary> /// <returns>A WebhookAccount configuration object</returns> public static WebhookConnec LoadFromJson(String preset, JObject obj) { var config = new WebhookConnec(); config.NotificationsPath = obj["notification_path"].Value <string>(); if (obj["connec_subscriptions"] == null) { config.Subscriptions = WebhookConnecSubscriptions.Load(); } else { config.Subscriptions = WebhookConnecSubscriptions.LoadFromJson(preset, obj["connec_subscriptions"].Value <JObject>()); } return(config); }
public Webhook(string preset = "maestrano") { Account = WebhookAccount.Load(preset); Connec = WebhookConnec.Load(preset); }
public Webhook() { Account = WebhookAccount.Load(); Connec = WebhookConnec.Load(); }