Skip to content

Commit

Permalink
(GH-367) SenderAuthentication.GetAllReverseDnsAsync must return Pagin…
Browse files Browse the repository at this point in the history
…atedResponseWithLinks
  • Loading branch information
Jericho committed Jan 23, 2021
1 parent 7e4ae65 commit 71d6ea4
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 @@ -44,7 +44,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken
await log.WriteLineAsync("\n***** SENDER AUTHENTICATION: Reverse DNS *****").ConfigureAwait(false);

var reverseDnsRecords = await client.SenderAuthentication.GetAllReverseDnsAsync(null, 50, 0, null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"All AuthenticatedSender reverse DNS retrieved. There are {reverseDnsRecords.Length} records").ConfigureAwait(false);
await log.WriteLineAsync($"All AuthenticatedSender reverse DNS retrieved. There are {reverseDnsRecords.Records.Length} records").ConfigureAwait(false);


await log.WriteLineAsync("\n***** SENDER AUTHENTICATION: LINKS *****").ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions Source/StrongGrid/Resources/ISenderAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ public interface ISenderAuthentication
/// <param name="onBehalfOf">The user to impersonate.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>
/// An array of <see cref="ReverseDns" />.
/// The <see cref="PaginatedResponseWithLinks{ReverseDns}" />.
/// </returns>
Task<ReverseDns[]> GetAllReverseDnsAsync(string segmentPrefix = null, int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default);
Task<PaginatedResponseWithLinks<ReverseDns>> GetAllReverseDnsAsync(string segmentPrefix = null, int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default);

/// <summary>
/// Get a specific reverse DNS.
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid/Resources/SenderAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ public Task<AuthenticatedDomain> AssociateDomainAsync(long domainId, string user
/// <param name="onBehalfOf">The user to impersonate.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>
/// An array of <see cref="ReverseDns" />.
/// The <see cref="PaginatedResponseWithLinks{ReverseDns}" />.
/// </returns>
public Task<ReverseDns[]> GetAllReverseDnsAsync(string segmentPrefix = null, int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default)
public Task<PaginatedResponseWithLinks<ReverseDns>> GetAllReverseDnsAsync(string segmentPrefix = null, int limit = 50, int offset = 0, string onBehalfOf = null, CancellationToken cancellationToken = default)
{
return _client
.GetAsync($"{_endpoint}/ips")
Expand All @@ -304,7 +304,7 @@ public Task<ReverseDns[]> GetAllReverseDnsAsync(string segmentPrefix = null, int
.WithArgument("offset", offset)
.WithArgument("ip", segmentPrefix)
.WithCancellationToken(cancellationToken)
.AsObject<ReverseDns[]>();
.AsPaginatedResponseWithLinks<ReverseDns>();
}

/// <summary>
Expand Down

0 comments on commit 71d6ea4

Please sign in to comment.