Soenneker.Docker.Hub.OpenApiClientUtil
4.0.81
Prefix Reserved
dotnet add package Soenneker.Docker.Hub.OpenApiClientUtil --version 4.0.81
NuGet\Install-Package Soenneker.Docker.Hub.OpenApiClientUtil -Version 4.0.81
<PackageReference Include="Soenneker.Docker.Hub.OpenApiClientUtil" Version="4.0.81" />
<PackageVersion Include="Soenneker.Docker.Hub.OpenApiClientUtil" Version="4.0.81" />
<PackageReference Include="Soenneker.Docker.Hub.OpenApiClientUtil" />
paket add Soenneker.Docker.Hub.OpenApiClientUtil --version 4.0.81
#r "nuget: Soenneker.Docker.Hub.OpenApiClientUtil, 4.0.81"
#:package Soenneker.Docker.Hub.OpenApiClientUtil@4.0.81
#addin nuget:?package=Soenneker.Docker.Hub.OpenApiClientUtil&version=4.0.81
#tool nuget:?package=Soenneker.Docker.Hub.OpenApiClientUtil&version=4.0.81
Soenneker.Docker.Hub.OpenApiClientUtil
Provides a lazily created, cached Docker Hub API client backed by the configured Docker Hub HTTP provider.
Installation
dotnet add package Soenneker.Docker.Hub.OpenApiClientUtil
Configuration
{
"DockerHub": {
"AccessToken": "your-access-token"
}
}
Keep the token in a secret provider rather than source control.
Registration
using Soenneker.Docker.Hub.OpenApiClientUtil.Registrars;
services.AddDockerHubOpenApiClientUtilAsScoped();
The scoped registration creates one cached generated client per dependency-injection scope while retaining the underlying Docker Hub HTTP client provider as a singleton. Disposing the util at the end of a scope does not destroy that shared transport.
Use AddDockerHubOpenApiClientUtilAsSingleton() when the generated-client holder should also live for the application lifetime.
Usage
using Soenneker.Docker.Hub.OpenApiClient;
using Soenneker.Docker.Hub.OpenApiClient.Models;
using Soenneker.Docker.Hub.OpenApiClientUtil.Abstract;
public sealed class AccessTokenReader(IDockerHubOpenApiClientUtil clientUtil)
{
public async Task<IReadOnlyList<GetAccessTokensResponseResultsItem>> GetPage(
int page,
CancellationToken cancellationToken)
{
DockerHubOpenApiClient client = await clientUtil.Get(cancellationToken);
GetAccessTokensResponse? response = await client.V2.AccessTokens.GetAsync(
request =>
{
request.QueryParameters.Page = page;
request.QueryParameters.PageSize = 25;
},
cancellationToken);
return response?.Results ?? [];
}
}
Get returns the same generated client for the lifetime of the util. Pass cancellation tokens to both Get and API operations. Pagination remains explicit; use the response’s Next, Previous, and Count values to drive subsequent requests.
Documented non-success responses are surfaced through generated Kiota error models deriving from ApiException. The exact error type varies by endpoint, so translate failures at the application boundary rather than assuming one universal Docker Hub error shape.
Optional transport overrides use the Hub:ClientBaseUrl, Hub:AuthHeaderName, and Hub:AuthHeaderValueTemplate keys. Treat them as trusted configuration because they determine where and how the access token is sent.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Docker.Hub.HttpClients (>= 4.0.61)
- Soenneker.Docker.Hub.OpenApiClient (>= 4.0.20)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.81 | 73 | 10/1/2026 |
| 4.0.80 | 81 | 9/29/2026 |
| 4.0.79 | 86 | 9/29/2026 |
| 4.0.78 | 92 | 9/26/2026 |
| 4.0.77 | 87 | 9/25/2026 |
| 4.0.76 | 85 | 9/25/2026 |
| 4.0.74 | 85 | 9/24/2026 |
| 4.0.73 | 92 | 9/23/2026 |
| 4.0.72 | 98 | 9/22/2026 |
| 4.0.71 | 99 | 9/18/2026 |
| 4.0.70 | 93 | 9/17/2026 |
| 4.0.69 | 88 | 9/17/2026 |
| 4.0.68 | 99 | 9/16/2026 |
| 4.0.67 | 85 | 9/16/2026 |
| 4.0.66 | 92 | 9/16/2026 |
| 4.0.65 | 92 | 9/16/2026 |
| 4.0.64 | 94 | 9/16/2026 |
| 4.0.63 | 91 | 9/15/2026 |
| 4.0.62 | 90 | 9/13/2026 |
| 4.0.61 | 85 | 9/13/2026 |