From 6f40b9ab374680f1b4bb01281f977340045eee6d Mon Sep 17 00:00:00 2001 From: Jericho Date: Sat, 23 Jan 2021 15:57:03 -0500 Subject: [PATCH] (GH-367) Teammates.GetAllPendingInvitationsAsync must return PaginatedResponseWithLinks --- Source/StrongGrid.IntegrationTests/Tests/Teammates.cs | 2 +- Source/StrongGrid/Resources/ITeammates.cs | 4 ++-- Source/StrongGrid/Resources/Teammates.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/StrongGrid.IntegrationTests/Tests/Teammates.cs b/Source/StrongGrid.IntegrationTests/Tests/Teammates.cs index aeff69c9..414f698e 100644 --- a/Source/StrongGrid.IntegrationTests/Tests/Teammates.cs +++ b/Source/StrongGrid.IntegrationTests/Tests/Teammates.cs @@ -14,7 +14,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken // GET ALL THE PENDING INVITATIONS var pendingInvitation = await client.Teammates.GetAllPendingInvitationsAsync(50, 0, cancellationToken).ConfigureAwait(false); - await log.WriteLineAsync($"There are {pendingInvitation.Length} pending invitations").ConfigureAwait(false); + await log.WriteLineAsync($"There are {pendingInvitation.Records.Length} pending invitations").ConfigureAwait(false); // GET ALL THE TEAMMATES var allTeammates = await client.Teammates.GetAllTeammatesAsync(50, 0, cancellationToken).ConfigureAwait(false); diff --git a/Source/StrongGrid/Resources/ITeammates.cs b/Source/StrongGrid/Resources/ITeammates.cs index a18386a9..df67206d 100644 --- a/Source/StrongGrid/Resources/ITeammates.cs +++ b/Source/StrongGrid/Resources/ITeammates.cs @@ -65,12 +65,12 @@ public interface ITeammates /// The limit. /// The offset. /// The cancellation token. - /// An array of . + /// The . /// /// Each teammate invitation is valid for 7 days. /// Users may resend the invite to refresh the expiration date. /// - Task GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default); + Task> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default); /// /// Delete a pending teammate invite. diff --git a/Source/StrongGrid/Resources/Teammates.cs b/Source/StrongGrid/Resources/Teammates.cs index 0cb4df21..d82adbd6 100644 --- a/Source/StrongGrid/Resources/Teammates.cs +++ b/Source/StrongGrid/Resources/Teammates.cs @@ -113,19 +113,19 @@ public Task ResendInvitationAsync(string token, CancellationToken cancellationTo /// The limit. /// The offset. /// The cancellation token. - /// An array of . + /// The . /// /// Each teammate invitation is valid for 7 days. /// Users may resend the invite to refresh the expiration date. /// - public Task GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default) + public Task> GetAllPendingInvitationsAsync(int limit = 10, int offset = 0, CancellationToken cancellationToken = default) { return _client .GetAsync($"{_endpoint}/pending") .WithArgument("limit", limit) .WithArgument("offset", offset) .WithCancellationToken(cancellationToken) - .AsObject("result"); + .AsPaginatedResponseWithLinks("result"); } ///