Soenneker.DigitalOcean.OpenApiClientUtil 4.0.81

Prefix Reserved
dotnet add package Soenneker.DigitalOcean.OpenApiClientUtil --version 4.0.81
                    
NuGet\Install-Package Soenneker.DigitalOcean.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.DigitalOcean.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.DigitalOcean.OpenApiClientUtil" Version="4.0.81" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.DigitalOcean.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.DigitalOcean.OpenApiClientUtil --version 4.0.81
                    
#r "nuget: Soenneker.DigitalOcean.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.DigitalOcean.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.DigitalOcean.OpenApiClientUtil&version=4.0.81
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.DigitalOcean.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.DigitalOcean.OpenApiClientUtil

Provides a lazily created, cached DigitalOcean API client backed by the configured DigitalOcean HTTP provider.

Installation

dotnet add package Soenneker.DigitalOcean.OpenApiClientUtil

Configuration

{
  "DigitalOcean": {
    "AccessToken": "your-personal-access-token"
  }
}

Store the token in user secrets, environment-backed configuration, or a secret manager rather than source control.

Registration

using Soenneker.DigitalOcean.OpenApiClientUtil.Registrars;

services.AddDigitalOceanOpenApiClientUtilAsScoped();

The scoped registration creates one cached generated client per dependency-injection scope while retaining the underlying DigitalOcean HTTP client as a singleton. Disposing the util at the end of a scope does not destroy that shared transport.

Use AddDigitalOceanOpenApiClientUtilAsSingleton() when the generated-client holder should also live for the application lifetime.

Usage

using Soenneker.DigitalOcean.OpenApiClient;
using Soenneker.DigitalOcean.OpenApiClient.Models;
using Soenneker.DigitalOcean.OpenApiClientUtil.Abstract;

public sealed class DropletReader(IDigitalOceanOpenApiClientUtil clientUtil)
{
    public async Task<IReadOnlyList<Droplet>> GetPage(
        int page,
        CancellationToken cancellationToken)
    {
        DigitalOceanOpenApiClient client = await clientUtil.Get(cancellationToken);

        AllDropletsResponse? response = await client.V2.Droplets.GetAsync(
            request =>
            {
                request.QueryParameters.Page = page;
                request.QueryParameters.PerPage = 50;
            },
            cancellationToken);

        return response?.Droplets ?? [];
    }
}

Get returns the same generated client for the lifetime of the util. Pass cancellation tokens to both Get and API operations. Pagination remains explicit; inspect response links or metadata and request additional pages as needed.

DigitalOcean error responses are surfaced through the generated client’s Kiota error models. Handle authentication failures, rate limiting, and transient transport errors according to the caller’s retry policy.

Optional DigitalOcean:ClientBaseUrl, DigitalOcean:AuthHeaderName, and DigitalOcean:AuthHeaderValueTemplate settings are supported by the transport package. Treat them as trusted configuration because they determine where and how credentials are 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 0 10/7/2026
4.0.80 88 10/4/2026
4.0.79 86 10/2/2026
4.0.78 89 10/1/2026
4.0.77 81 10/1/2026
4.0.76 95 9/30/2026
4.0.75 85 9/29/2026
4.0.74 93 9/29/2026
4.0.73 84 9/29/2026
4.0.72 93 9/26/2026
4.0.71 90 9/25/2026
4.0.70 88 9/25/2026
4.0.69 89 9/25/2026
4.0.68 88 9/24/2026
4.0.67 86 9/24/2026
4.0.66 96 9/23/2026
4.0.65 99 9/22/2026
4.0.64 102 9/19/2026
4.0.63 91 9/18/2026
4.0.62 89 9/17/2026
Loading failed