From fe233932da00d0e4cc7e0b251a43962ec61bfec4 Mon Sep 17 00:00:00 2001 From: Jericho Date: Sat, 23 Jan 2021 14:58:04 -0500 Subject: [PATCH] (GH-367) WebHookSettings.GetAllAsync must return PaginatedResponseWithLinks --- Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs | 2 +- Source/StrongGrid/Resources/IWebhookSettings.cs | 4 ++-- Source/StrongGrid/Resources/WebhookSettings.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs b/Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs index f8a08463..51687f80 100644 --- a/Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs +++ b/Source/StrongGrid.IntegrationTests/Tests/WebhookSettings.cs @@ -18,7 +18,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken // GET THE INBOUND PARSE SETTINGS var inboundParseWebhookSettings = await client.WebhookSettings.GetAllInboundParseWebhookSettingsAsync(null, cancellationToken).ConfigureAwait(false); - await log.WriteLineAsync("The inbound parse webhook settings have been retrieved.").ConfigureAwait(false); + await log.WriteLineAsync($"The inbound parse webhook settings have been retrieved. There are {inboundParseWebhookSettings.Records.Length} settings").ConfigureAwait(false); // GET THE SIGNED EVENTS PUBLIC KEY var publicKey = await client.WebhookSettings.GetSignedEventsPublicKeyAsync(cancellationToken).ConfigureAwait(false); diff --git a/Source/StrongGrid/Resources/IWebhookSettings.cs b/Source/StrongGrid/Resources/IWebhookSettings.cs index eba36027..42212758 100644 --- a/Source/StrongGrid/Resources/IWebhookSettings.cs +++ b/Source/StrongGrid/Resources/IWebhookSettings.cs @@ -94,9 +94,9 @@ Task UpdateEventWebhookSettingsAsync( /// The user to impersonate. /// The cancellation token. /// - /// The . + /// The . /// - Task GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default); + Task> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default); /// /// Get the inbound parse webhook settings for a specific hostname. diff --git a/Source/StrongGrid/Resources/WebhookSettings.cs b/Source/StrongGrid/Resources/WebhookSettings.cs index 8bb75842..136a94d9 100644 --- a/Source/StrongGrid/Resources/WebhookSettings.cs +++ b/Source/StrongGrid/Resources/WebhookSettings.cs @@ -164,15 +164,15 @@ public Task CreateInboundParseWebhookSettingsAsync( /// The user to impersonate. /// The cancellation token. /// - /// The . + /// The . /// - public Task GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default) + public Task> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default) { return _client .GetAsync($"{_inboundParseWebhookEndpoint}/settings") .OnBehalfOf(onBehalfOf) .WithCancellationToken(cancellationToken) - .AsObject("result"); + .AsPaginatedResponseWithLinks("result"); } ///