-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Client SDK] Make the autocomplete resource optional (#481)
Addresses #477
- Loading branch information
1 parent
e722836
commit 6e1f2a9
Showing
3 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using BaGet.Protocol.Models; | ||
|
||
namespace BaGet.Protocol.Internal | ||
{ | ||
public class NullAutocompleteClient : IAutocompleteClient | ||
{ | ||
public Task<AutocompleteResponse> AutocompleteAsync(string query = null, int skip = 0, int take = 20, bool includePrerelease = true, bool includeSemVer2 = true, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new AutocompleteResponse | ||
{ | ||
TotalHits = 0, | ||
Data = new List<string>() | ||
}); | ||
} | ||
|
||
public Task<AutocompleteResponse> ListPackageVersionsAsync(string packageId, bool includePrerelease = true, bool includeSemVer2 = true, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new AutocompleteResponse | ||
{ | ||
TotalHits = 0, | ||
Data = new List<string>() | ||
}); | ||
} | ||
} | ||
} |
Minor typo:
required