Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Apr 18, 2024
2 parents 57c90ca + 87a1e84 commit 7664204
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 34 deletions.
17 changes: 15 additions & 2 deletions Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -13,8 +14,20 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken
await log.WriteLineAsync("\n***** WEBHOOK SETTINGS *****\n").ConfigureAwait(false);

// GET ALL THE EVENT SETTINGS
var eventWebhookSettings = await client.WebhookSettings.GetAllEventWebhookSettingsAsync(null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"All the event webhook settings have been retrieved. There are {eventWebhookSettings.Length} configured events.").ConfigureAwait(false);
var eventsWebhookSettings = await client.WebhookSettings.GetAllEventWebhookSettingsAsync(null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"All the event webhook settings have been retrieved. There are {eventsWebhookSettings.Length} configured events.").ConfigureAwait(false);

// GET ONE EVENT SETTINGS
if (eventsWebhookSettings.Any())
{
// Get event settings without specifying an ID. Per SendGrid documentation, this should return the oldest webhook by created_date.
var defaultEventSettings = await client.WebhookSettings.GetEventWebhookSettingsAsync(null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync("The settings for the default event webhook have been retrieved.").ConfigureAwait(false);

// Get event settings by specifying an ID.
var eventSettings = await client.WebhookSettings.GetEventWebhookSettingsAsync(eventsWebhookSettings.Last().Id, null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"The settings for event webhook {eventSettings.Id} have been retrieved.").ConfigureAwait(false);
}

// GET ALL THE INBOUND PARSE SETTINGS
var inboundParseWebhookSettings = await client.WebhookSettings.GetAllInboundParseWebhookSettingsAsync(null, cancellationToken).ConfigureAwait(false);
Expand Down
64 changes: 32 additions & 32 deletions Source/StrongGrid.IntegrationTests/TestsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,39 @@ public async Task StartAsync(CancellationToken cancellationToken)
// These are the integration tests that we will execute
var integrationTests = new Type[]
{
//typeof(AccessManagement),
//typeof(Alerts),
//typeof(ApiKeys),
//typeof(Batches),
//typeof(Blocks),
//typeof(Bounces),
//typeof(ContactsAndCustomFields),
//typeof(Designs),
//typeof(EmailActivities),
//typeof(EngagementQuality),
//typeof(EmailValidation),
//typeof(GlobalSuppressions),
//typeof(InvalidEmails),
//typeof(IpAddresses),
//typeof(IpPools),
//typeof(LegacyCampaignsAndSenderIdentities),
//typeof(LegacyCategories),
//typeof(LegacyContactsAndCustomFields),
//typeof(LegacyListsAndSegments),
//typeof(ListsAndSegments),
//typeof(Mail),
//typeof(SenderAuthentication),
//typeof(Settings),
//typeof(SingleSendsAndSenderIdentities),
//typeof(SpamReports),
//typeof(Statistics),
//typeof(Subusers),
//typeof(Teammates),
//typeof(Templates),
//typeof(UnsubscribeGroupsAndSuppressions),
//typeof(User),
typeof(AccessManagement),
typeof(Alerts),
typeof(ApiKeys),
typeof(Batches),
typeof(Blocks),
typeof(Bounces),
typeof(ContactsAndCustomFields),
typeof(Designs),
typeof(EmailActivities),
typeof(EngagementQuality),
typeof(EmailValidation),
typeof(GlobalSuppressions),
typeof(InvalidEmails),
typeof(IpAddresses),
typeof(IpPools),
typeof(LegacyCampaignsAndSenderIdentities),
typeof(LegacyCategories),
typeof(LegacyContactsAndCustomFields),
typeof(LegacyListsAndSegments),
typeof(ListsAndSegments),
typeof(Mail),
typeof(SenderAuthentication),
typeof(Settings),
typeof(SingleSendsAndSenderIdentities),
typeof(SpamReports),
typeof(Statistics),
typeof(Subusers),
typeof(Teammates),
typeof(Templates),
typeof(UnsubscribeGroupsAndSuppressions),
typeof(User),
typeof(WebhookSettings),
//typeof(WebhookStats)
typeof(WebhookStats)
};

// Execute the async tests in parallel (with max degree of parallelism)
Expand Down

0 comments on commit 7664204

Please sign in to comment.