diff --git a/Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs b/Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs index 720ee5e4..b27ecc1c 100644 --- a/Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs +++ b/Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs @@ -1418,9 +1418,9 @@ public async void PostWebhook() Enabled = true, Actions = new [] { - new ContentTypeActionModel { Action = ContentTypeActionEnum.Created }, - new ContentTypeActionModel { Action = ContentTypeActionEnum.Changed }, - new ContentTypeActionModel { Action = ContentTypeActionEnum.Deleted } + new ContentTypeActionModel { Action = ContentTypeAction.Created }, + new ContentTypeActionModel { Action = ContentTypeAction.Changed }, + new ContentTypeActionModel { Action = ContentTypeAction.Deleted } } }, ContentItem = new ContentItemTriggerModel @@ -1430,7 +1430,7 @@ public async void PostWebhook() { new ContentItemActionModel { - Action = ContentItemActionEnum.Deleted, + Action = ContentItemAction.Deleted, TransitionTo = new [] { new ContentItemWorkflowTransition { @@ -1453,8 +1453,8 @@ public async void PostWebhook() Enabled = true, Actions = new [] { - new TaxonomyActionModel { Action = TaxonomyActionEnum.TermChanged }, - new TaxonomyActionModel { Action = TaxonomyActionEnum.MetadataChanged } + new TaxonomyActionModel { Action = TaxonomyAction.TermChanged }, + new TaxonomyActionModel { Action = TaxonomyAction.MetadataChanged } } }, Asset = new AssetTriggerModel @@ -1462,8 +1462,8 @@ public async void PostWebhook() Enabled = true, Actions = new [] { - new AssetActionModel { Action = AssetActionEnum.Created }, - new AssetActionModel { Action = AssetActionEnum.Changed } + new AssetActionModel { Action = AssetAction.Created }, + new AssetActionModel { Action = AssetAction.Changed } } }, Language = new LanguageTriggerModel @@ -1471,7 +1471,7 @@ public async void PostWebhook() Enabled = true, Actions = new [] { - new LanguageActionModel { Action = LanguageActionEnum.Created } + new LanguageActionModel { Action = LanguageAction.Created } } }, Slot = DeliverySlot.Published, diff --git a/Kontent.Ai.Management.Tests/ManagementClientTests/WebhookTests.cs b/Kontent.Ai.Management.Tests/ManagementClientTests/WebhookTests.cs index 9671c399..1e21ad17 100644 --- a/Kontent.Ai.Management.Tests/ManagementClientTests/WebhookTests.cs +++ b/Kontent.Ai.Management.Tests/ManagementClientTests/WebhookTests.cs @@ -94,7 +94,7 @@ public async void CreateWebhookAsync_CreatesWebhook() DeliveryTriggers = new DeliveryTriggersModel { ContentType = new ContentTypeTriggerModel { Enabled = true, - Actions = new[] { new ContentTypeActionModel { Action = ContentTypeActionEnum.Created } } + Actions = new[] { new ContentTypeActionModel { Action = ContentTypeAction.Created } } } } }; diff --git a/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookHealthStatus.cs b/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookHealthStatus.cs new file mode 100644 index 00000000..7d65ccba --- /dev/null +++ b/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookHealthStatus.cs @@ -0,0 +1,33 @@ +using System.Runtime.Serialization; + +namespace Kontent.Ai.Management.Models.LegacyWebhooks; + +/// +/// Webhook health status. +/// +public enum LegacyWebhookHealthStatus +{ + /// + /// Appears for newly created webhooks before any notification has been sent. + /// + [EnumMember(Value = "unknown")] + Unknown = 0, + + /// + /// Appears for webhooks that have properly delivered notifications. + /// + [EnumMember(Value = "working")] + Working = 1, + + /// + /// Appears for webhooks that have not been delivered properly. + /// + [EnumMember(Value = "failing")] + Failing = 2, + + /// + /// Appears for webhooks where delivery has repeatedly failed, and no notifications have been accepted for 7 days. + /// + [EnumMember(Value = "dead")] + Dead = 3 +} \ No newline at end of file diff --git a/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookModel.cs b/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookModel.cs index 28ce16e4..1ee3bd12 100644 --- a/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookModel.cs +++ b/Kontent.Ai.Management/Models/LegacyWebhooks/LegacyWebhookModel.cs @@ -14,6 +14,12 @@ public class LegacyWebhookModel /// [JsonProperty("last_modified")] public DateTime? LastModified { get; set; } + + /// + /// The webhook's health status tells you whether the webhook is operational. + /// + [JsonProperty("health_status")] + public LegacyWebhookHealthStatus HealthStatus { get; set; } /// /// Gets or sets the webhook's internal ID. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionEnum.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetAction.cs similarity index 95% rename from Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionEnum.cs rename to Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetAction.cs index 7702ad63..63d95b5e 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionEnum.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetAction.cs @@ -5,7 +5,7 @@ namespace Kontent.Ai.Management.Models.Webhooks.Triggers.Asset; /// /// Represents asset actions. /// -public enum AssetActionEnum +public enum AssetAction { /// /// Asset created action. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionModel.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionModel.cs index 6e92ab48..8d3abb6c 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionModel.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Asset/AssetActionModel.cs @@ -11,5 +11,5 @@ public class AssetActionModel /// Asset action. /// [JsonProperty("action")] - public AssetActionEnum Action { get; set; } + public AssetAction Action { get; set; } } \ No newline at end of file diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionEnum.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemAction.cs similarity index 97% rename from Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionEnum.cs rename to Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemAction.cs index 5a9036ab..09a83425 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionEnum.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemAction.cs @@ -5,7 +5,7 @@ namespace Kontent.Ai.Management.Models.Webhooks.Triggers.ContentItem; /// /// Represents content item actions. /// -public enum ContentItemActionEnum +public enum ContentItemAction { /// /// Content item created action. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionModel.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionModel.cs index 0f22a346..b0bfc7bb 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionModel.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentItem/ContentItemActionModel.cs @@ -12,7 +12,7 @@ public class ContentItemActionModel /// The action performed on a content item. /// [JsonProperty("action")] - public ContentItemActionEnum Action { get; set; } + public ContentItemAction Action { get; set; } /// /// Specifies a workflow and its workflow step. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionEnum.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeAction.cs similarity index 94% rename from Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionEnum.cs rename to Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeAction.cs index 9ad3eddd..d9dce22e 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionEnum.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeAction.cs @@ -5,7 +5,7 @@ namespace Kontent.Ai.Management.Models.Webhooks.Triggers.ContentType; /// /// Represents content type actions. /// -public enum ContentTypeActionEnum +public enum ContentTypeAction { /// /// Content type created action. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionModel.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionModel.cs index 67263487..2e0ae8c5 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionModel.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/ContentType/ContentTypeActionModel.cs @@ -11,5 +11,5 @@ public class ContentTypeActionModel /// Content type action. /// [JsonProperty("action")] - public ContentTypeActionEnum Action { get; set; } + public ContentTypeAction Action { get; set; } } \ No newline at end of file diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionEnum.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageAction.cs similarity index 94% rename from Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionEnum.cs rename to Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageAction.cs index 9afb6ef1..b1b908b7 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionEnum.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageAction.cs @@ -5,7 +5,7 @@ namespace Kontent.Ai.Management.Models.Webhooks.Triggers.Language; /// /// Represents language actions. /// -public enum LanguageActionEnum +public enum LanguageAction { /// /// Language created action. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionModel.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionModel.cs index 97e2007c..bd970411 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionModel.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Language/LanguageActionModel.cs @@ -11,5 +11,5 @@ public class LanguageActionModel /// Language action. /// [JsonProperty("action")] - public LanguageActionEnum Action { get; set; } + public LanguageAction Action { get; set; } } \ No newline at end of file diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionEnum.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyAction.cs similarity index 97% rename from Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionEnum.cs rename to Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyAction.cs index 7f7c2642..cb010881 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionEnum.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyAction.cs @@ -5,7 +5,7 @@ namespace Kontent.Ai.Management.Models.Webhooks.Triggers.Taxonomy; /// /// Represents taxonomy actions. /// -public enum TaxonomyActionEnum +public enum TaxonomyAction { /// /// Taxonomy created action. diff --git a/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionModel.cs b/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionModel.cs index e137ee75..354cf674 100644 --- a/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionModel.cs +++ b/Kontent.Ai.Management/Models/Webhooks/Triggers/Taxonomy/TaxonomyActionModel.cs @@ -11,5 +11,5 @@ public class TaxonomyActionModel /// Taxonomy action. /// [JsonProperty("action")] - public TaxonomyActionEnum Action { get; set; } + public TaxonomyAction Action { get; set; } } \ No newline at end of file