NuGetClient class final
A client for interacting with the NuGet Server API.
The NuGet Server API provides a set of HTTP endpoints that enable various operations such as downloading packages, fetching metadata, and more.
This client is designed to work with the NuGet Server API implemented by
NuGet.org
and other NuGet-compatible package repositories.
See https://learn.microsoft.com/nuget/api/overview for more details.
Constructors
- NuGetClient({Client? httpClient, Uri? serviceIndexUri})
- Initializes a new instance of the NuGetClient class.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
autocompletePackageIds(
String? query, {bool includePrerelease = false, int? skip, int? take}) → Future< AutocompletePackageIdsResponse> -
Retrieves the package IDs that match the
query
. -
close(
) → void - Closes the underlying HTTP client.
-
downloadPackageContent(
String packageId, {required String version}) → Future< Uint8List> -
Returns the contents of the package content (
.nupkg
) file for the package with thepackageId
andversion
. -
downloadPackageManifest(
String packageId, {required String version}) → Future< Uint8List> -
Returns the contents of the package manifest (
.nuspec
) file for the package with thepackageId
andversion
. -
getAllPackageMetadata(
String packageId) → Future< List< CatalogEntry> > -
Returns the metadata for all versions of the package with the
packageId
. -
getLatestPackageVersion(
String packageId, {bool includePrerelease = false}) → Future< String> -
Retrieves the latest version of the package with the
packageId
. -
getPackageMetadata(
String packageId, {required String version}) → Future< CatalogEntry> -
Retrieves the metadata for the package with the
packageId
andversion
. -
getPackageVersions(
String packageId, {bool includePrerelease = false}) → Future< List< String> > -
Retrieves the versions of the package with the
packageId
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
packageExists(
String packageId, {String? version}) → Future< bool> -
Determines whether the package with the
packageId
exists. -
searchPackages(
String? query, {bool includePrerelease = false, int? skip, int? take}) → Future< SearchResponse> -
Retrieves the packages that match the
query
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited