Skip to content

Commit 8c358c5

Browse files
author
Martin Ševčík
committed
EN-628 remove legacy webhooks
1 parent 854e22f commit 8c358c5

File tree

15 files changed

+8
-842
lines changed

15 files changed

+8
-842
lines changed

Kontent.Ai.Management.Tests/CodeSamples/CmApiV2.cs

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
using Kontent.Ai.Management.Models.Languages;
1111
using Kontent.Ai.Management.Models.LanguageVariants;
1212
using Kontent.Ai.Management.Models.LanguageVariants.Elements;
13-
using Kontent.Ai.Management.Models.LegacyWebhooks;
14-
using Kontent.Ai.Management.Models.LegacyWebhooks.Triggers;
1513
using Kontent.Ai.Management.Models.Publishing;
1614
using Kontent.Ai.Management.Models.Shared;
1715
using Kontent.Ai.Management.Models.TaxonomyGroups;
@@ -163,18 +161,6 @@ public async void DeleteLanguageVariant()
163161
await client.DeleteLanguageVariantAsync(identifier);
164162
}
165163

166-
// DocSection: cm_api_v2_delete_legacy_webhook
167-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
168-
[Fact]
169-
public async void DeleteLegacyWebhook()
170-
{
171-
var client = _fileSystemFixture.CreateMockClient(Substitute.For<IManagementHttpClient>());
172-
173-
var identifier = Reference.ById(Guid.Parse("d53360f7-79e1-42f4-a524-1b53a417d03e"));
174-
175-
await client.DeleteLegacyWebhookAsync(identifier);
176-
}
177-
178164
// DocSection: cm_api_v2_delete_webhook
179165
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
180166
[Fact]
@@ -554,20 +540,6 @@ public async void GetVariantsWithComponentsOfType()
554540
Assert.Single(response);
555541
}
556542

557-
// DocSection: cm_api_v2_get_legacy_webhook
558-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
559-
[Fact]
560-
public async void GetLegacyWebhook()
561-
{
562-
var client = _fileSystemFixture.CreateMockClientWithResponse("LegacyWebhook.json");
563-
564-
var identifier = Reference.ById(Guid.Parse("5df74e27-1213-484e-b9ae-bcbe90bd5990"));
565-
566-
var response = await client.GetLegacyWebhookAsync(identifier);
567-
568-
Assert.NotNull(response);
569-
}
570-
571543
// DocSection: cm_api_v2_get_webhook
572544
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
573545
[Fact]
@@ -582,18 +554,6 @@ public async void GetWebhook()
582554
Assert.NotNull(response);
583555
}
584556

585-
// DocSection: cm_api_v2_get_legacy_webhooks
586-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
587-
[Fact]
588-
public async void GetLegacyWebhooks()
589-
{
590-
var client = _fileSystemFixture.CreateMockClientWithResponse("LegacyWebhooks.json");
591-
592-
var response = await client.ListLegacyWebhooksAsync();
593-
594-
Assert.Single(response);
595-
}
596-
597557
// DocSection: cm_api_v2_get_webhooks
598558
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
599559
[Fact]
@@ -1356,93 +1316,6 @@ public async void PostValidate()
13561316
Assert.NotNull(response);
13571317
}
13581318

1359-
// DocSection: cm_api_v2_post_legacy_webhook
1360-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
1361-
[Fact]
1362-
public async void PostLegacyWebhook()
1363-
{
1364-
var client = _fileSystemFixture.CreateMockClientWithResponse("PostLegacyWebhookResponse.json");
1365-
1366-
var response = await client.CreateLegacyWebhookAsync(new LegacyWebhookCreateModel
1367-
{
1368-
Name = "Example webhook",
1369-
Url = "https://example.com/webhook",
1370-
Secret = "secret_key",
1371-
Triggers = new LegacyWebhookTriggersModel
1372-
{
1373-
DeliveryApiContentChanges = new[]
1374-
{
1375-
new DeliveryApiTriggerModel
1376-
{
1377-
Type = TriggerChangeType.LanguageVariant,
1378-
Operations = new []
1379-
{
1380-
"publish",
1381-
"unpublish"
1382-
}
1383-
},
1384-
new DeliveryApiTriggerModel
1385-
{
1386-
Type = TriggerChangeType.Taxonomy,
1387-
Operations = new []
1388-
{
1389-
"archive",
1390-
"restore",
1391-
"upsert"
1392-
}
1393-
}
1394-
},
1395-
PreviewDeliveryApiContentChanges = new[]
1396-
{
1397-
new DeliveryApiTriggerModel
1398-
{
1399-
Type = TriggerChangeType.LanguageVariant,
1400-
Operations = new []
1401-
{
1402-
"archive",
1403-
"upsert"
1404-
}
1405-
},
1406-
new DeliveryApiTriggerModel
1407-
{
1408-
Type = TriggerChangeType.Taxonomy,
1409-
Operations = new []
1410-
{
1411-
"archive",
1412-
"restore",
1413-
"upsert"
1414-
}
1415-
}
1416-
},
1417-
WorkflowStepChanges = new[]
1418-
{
1419-
new WorkflowStepTriggerModel
1420-
{
1421-
TransitionsTo = new []
1422-
{
1423-
Reference.ById(Guid.Parse("b4363ccd-8f21-45fd-a840-5843d7b7f008")),
1424-
Reference.ById(Guid.Parse("88ac5e6e-1c5c-4638-96e1-0d61221ad5bf")),
1425-
}
1426-
},
1427-
},
1428-
ManagementApiContentChanges = new[]
1429-
{
1430-
new ManagementApiTriggerModel
1431-
{
1432-
Operations = new []
1433-
{
1434-
"archive",
1435-
"create",
1436-
"restore",
1437-
}
1438-
}
1439-
},
1440-
}
1441-
});
1442-
1443-
Assert.NotNull(response);
1444-
}
1445-
14461319
// DocSection: cm_api_v2_post_webhook
14471320
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
14481321
[Fact]
@@ -2040,18 +1913,6 @@ await client.ChangeLanguageVariantWorkflowAsync(
20401913
Assert.Null(exception);
20411914
}
20421915

2043-
// DocSection: mapi_v2_disable_legacy_webhook
2044-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
2045-
[Fact]
2046-
public async void PutDisableLegacyWebhook()
2047-
{
2048-
var client = _fileSystemFixture.CreateMockClientWithResponse("Empty.json");
2049-
2050-
var exception = await Record.ExceptionAsync(async () =>
2051-
await client.DisableLegacyWebhookAsync(Reference.ById(Guid.Parse("5df74e27-1213-484e-b9ae-bcbe90bd5990"))));
2052-
Assert.Null(exception);
2053-
}
2054-
20551916
// DocSection: mapi_v2_disable_webhook
20561917
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
20571918
[Fact]
@@ -2064,18 +1925,6 @@ public async void PutDisableWebhook()
20641925
Assert.Null(exception);
20651926
}
20661927

2067-
// DocSection: mapi_v2_enable_legacy_webhook
2068-
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
2069-
[Fact]
2070-
public async void PutEnableLegacyWebhook()
2071-
{
2072-
var client = _fileSystemFixture.CreateMockClientWithResponse("Empty.json");
2073-
2074-
var exception = await Record.ExceptionAsync(async () =>
2075-
await client.EnableLegacyWebhookAsync(Reference.ById(Guid.Parse("5df74e27-1213-484e-b9ae-bcbe90bd5990"))));
2076-
Assert.Null(exception);
2077-
}
2078-
20791928
// DocSection: mapi_v2_enable_webhook
20801929
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
20811930
[Fact]

0 commit comments

Comments
 (0)