public async Task <TvDbResponse <Image[]> > GetImagesAsync(int seriesId, ImagesQueryAlternative query, CancellationToken cancellationToken) { var request = new ApiRequest("GET", $"/series/{seriesId}/images/query?{this.UrlHelpers.Querify(query)}"); var response = await this.ApiClient.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); return(this.Parser.Parse <TvDbResponse <Image[]> >(response, ErrorMessages.Series.GetImagesAsync)); }
// ReSharper disable once InconsistentNaming public Task GetImagesAsync_Alternative_Makes_The_Right_Request(int seriesId, string keyType, string resolution, string subKey) { var query = new ImagesQueryAlternative { Resolution = resolution, SubKey = subKey, KeyType = keyType }; return(CreateClient() .WithErrorMap(ErrorMessages.Series.GetImagesAsync) .SetResultObject(new TvDbResponse <Image[]>()) .WhenCallingAMethod((impl, token) => impl.GetImagesAsync(seriesId, query, token)) .ShouldRequest("GET", $"/series/{seriesId}/images/query?keyType={keyType}&resolution={resolution}&subKey={subKey}") .RunAsync()); }
public Task <TvDbResponse <Image[]> > GetImagesAsync(int seriesId, ImagesQueryAlternative query) { return(this.GetImagesAsync(seriesId, query, CancellationToken.None)); }