public async Task <QualityLevelListSegment> ListQualityLevelsSegmentedAsync(ListingOptions options = default, CancellationToken cancellationToken = default) { // Generate the additional parameters, where needed var restClient = _restClientFactory.Build(); // Send the request to the Verifalia servers Dictionary <string, string> queryParams = null; if (options != null) { queryParams = new Dictionary <string, string>(); if (options.Limit > 0) { queryParams["limit"] = options.Limit.ToString(CultureInfo.InvariantCulture); } } using (var response = await restClient .InvokeAsync(HttpMethod.Get, "email-validations/quality-levels", queryParams: queryParams, headers: new Dictionary <string, object> { { "Accept", WellKnownMimeContentTypes.ApplicationJson } }, cancellationToken: cancellationToken) .ConfigureAwait(false)) { return(await ListQualityLevelsSegmentedImplAsync(restClient, response, cancellationToken) .ConfigureAwait(false)); } }
public IAsyncEnumerable <QualityLevel> ListQualityLevelsAsync(ListingOptions options = null, CancellationToken cancellationToken = default) { return(AsyncEnumerableHelper .ToAsyncEnumerable <QualityLevelListSegment, QualityLevel, ListingOptions>( ListQualityLevelsSegmentedAsync, ListQualityLevelsSegmentedAsync, options, cancellationToken)); }