Skip to content

Commit

Permalink
(GH-367) WebHookSettings.GetAllAsync must return PaginatedResponseWit…
Browse files Browse the repository at this point in the history
…hLinks
  • Loading branch information
Jericho committed Jan 23, 2021
1 parent 30c27e7 commit fe23393
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Source/StrongGrid/Resources/IWebhookSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ Task<EventWebhookSettings> UpdateEventWebhookSettingsAsync(
/// <param name="onBehalfOf">The user to impersonate.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The <see cref="InboundParseWebhookSettings" />.
/// The <see cref="PaginatedResponseWithLinks{InboundParseWebhookSettings}" />.
/// </returns>
Task<InboundParseWebhookSettings[]> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default);
Task<PaginatedResponseWithLinks<InboundParseWebhookSettings>> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default);

/// <summary>
/// Get the inbound parse webhook settings for a specific hostname.
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid/Resources/WebhookSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ public Task<InboundParseWebhookSettings> CreateInboundParseWebhookSettingsAsync(
/// <param name="onBehalfOf">The user to impersonate.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The <see cref="InboundParseWebhookSettings" />.
/// The <see cref="PaginatedResponseWithLinks{InboundParseWebhookSettings}" />.
/// </returns>
public Task<InboundParseWebhookSettings[]> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default)
public Task<PaginatedResponseWithLinks<InboundParseWebhookSettings>> GetAllInboundParseWebhookSettingsAsync(string onBehalfOf = null, CancellationToken cancellationToken = default)
{
return _client
.GetAsync($"{_inboundParseWebhookEndpoint}/settings")
.OnBehalfOf(onBehalfOf)
.WithCancellationToken(cancellationToken)
.AsObject<InboundParseWebhookSettings[]>("result");
.AsPaginatedResponseWithLinks<InboundParseWebhookSettings>("result");
}

/// <summary>
Expand Down

0 comments on commit fe23393

Please sign in to comment.