diff --git a/Source/StrongGrid.IntegrationTests/Tests/ApiKeys.cs b/Source/StrongGrid.IntegrationTests/Tests/ApiKeys.cs index 5b4576f3..e2ab8695 100644 --- a/Source/StrongGrid.IntegrationTests/Tests/ApiKeys.cs +++ b/Source/StrongGrid.IntegrationTests/Tests/ApiKeys.cs @@ -16,10 +16,10 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken // GET ALL THE API KEYS var apiKeys = await client.ApiKeys.GetAllAsync(50, 0, null, cancellationToken).ConfigureAwait(false); - await log.WriteLineAsync($"There are {apiKeys.Length} Api Keys").ConfigureAwait(false); + await log.WriteLineAsync($"There are {apiKeys.Records.Length} Api Keys").ConfigureAwait(false); // CLEANUP PREVIOUS INTEGRATION TESTS THAT MIGHT HAVE BEEN INTERRUPTED BEFORE THEY HAD TIME TO CLEANUP AFTER THEMSELVES - var cleanUpTasks = apiKeys + var cleanUpTasks = apiKeys.Records .Where(k => k.Name.StartsWith("StrongGrid Integration Testing:")) .Select(async oldApiKey => { diff --git a/Source/StrongGrid/Resources/ApiKeys.cs b/Source/StrongGrid/Resources/ApiKeys.cs index 74db75ba..a38e3971 100644 --- a/Source/StrongGrid/Resources/ApiKeys.cs +++ b/Source/StrongGrid/Resources/ApiKeys.cs @@ -60,13 +60,13 @@ public Task GetAsync(string keyId, string onBehalfOf = null, Cancellatio /// The user to impersonate. /// Cancellation token. /// - /// An array of . + /// The . /// /// /// The response does not include the permissions associated with each api key. /// In order to get the permission for a given key, you need to retrieve keys one at a time. /// - public Task GetAllAsync(int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default) + public Task> GetAllAsync(int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default) { return _client .GetAsync(_endpoint) @@ -74,7 +74,7 @@ public Task GetAllAsync(int limit = 50, int offset = 0, string onBehal .WithArgument("offset", offset) .OnBehalfOf(onBehalfOf) .WithCancellationToken(cancellationToken) - .AsObject("result"); + .AsPaginatedResponseWithLinks("result"); } /// diff --git a/Source/StrongGrid/Resources/IApiKeys.cs b/Source/StrongGrid/Resources/IApiKeys.cs index 2cd74d95..d8919458 100644 --- a/Source/StrongGrid/Resources/IApiKeys.cs +++ b/Source/StrongGrid/Resources/IApiKeys.cs @@ -33,13 +33,13 @@ public interface IApiKeys /// The user to impersonate. /// Cancellation token. /// - /// An array of . + /// The . /// /// /// The response does not include the permissions associated with each api key. /// In order to get the permission for a given key, you need to retrieve keys one at a time. /// - Task GetAllAsync(int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default); + Task> GetAllAsync(int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default); /// /// Generate a new API Key.