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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Docker.Hub.OpenApiClientUtil" Version="4.0.81" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Docker.Hub.OpenApiClientUtil" Version="4.0.81" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Docker.Hub.OpenApiClientUtil" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Docker.Hub.OpenApiClientUtil --version 4.0.81
                    
#r "nuget: Soenneker.Docker.Hub.OpenApiClientUtil, 4.0.81"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Docker.Hub.OpenApiClientUtil@4.0.81
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Docker.Hub.OpenApiClientUtil&version=4.0.81
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Docker.Hub.OpenApiClientUtil&version=4.0.81
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed