Qualithm.Platform 0.2.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Qualithm.Platform --version 0.2.0
                    
NuGet\Install-Package Qualithm.Platform -Version 0.2.0
                    
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="Qualithm.Platform" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Qualithm.Platform" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Qualithm.Platform" />
                    
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 Qualithm.Platform --version 0.2.0
                    
#r "nuget: Qualithm.Platform, 0.2.0"
                    
#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 Qualithm.Platform@0.2.0
                    
#: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=Qualithm.Platform&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Qualithm.Platform&version=0.2.0
                    
Install as a Cake Tool

Platform SDK Cs

CI codecov NuGet

C# client for the Qualithm Platform API, generated from its OpenAPI spec. Every operation and type comes from the spec the API serves, so the client changes when the API does.

Features

  • Every management operation — one typed async method per operation, grouped by resource (DevicesApi, AutomationsApi, …), with the spec's names
  • One error type — every failure is a PlatformException carrying the API's stable Code
  • Configured from the environment — QUALITHM_API_TOKEN and QUALITHM_API_URL
  • net10.0 — one class library on the current .NET LTS

Installation

dotnet add package Qualithm.Platform

Quick Start

Create an API token in the Qualithm app, on the team page under API tokens, then:

using Qualithm.Platform;
using Qualithm.Platform.Api;

using var platform = new PlatformClient(token: "<your-api-token>");

// An API token belongs to one team, so its team list has exactly that team.
var teams = await platform.Api<TeamsApi>().ListTeamsAsync();
var teamId = teams.Data.Items[0].Id;

var page = await platform.Api<DevicesApi>().ListDevicesAsync(teamId);

foreach (var device in page.Data.Items)
{
    Console.WriteLine(device.Name);
}

Usage

Configure the client

PlatformClient reads QUALITHM_API_TOKEN and QUALITHM_API_URL when you don't pass token or baseUrl. The base URL defaults to the production API, https://api.qualithm.com. Create one client and keep it for the life of your app: it owns the HTTP connection pool.

using var platform = new PlatformClient(baseUrl: "https://api.qualithm.com");

Call an operation

Each generated …Api class in Qualithm.Platform.Api is one resource group. platform.Api<T>() returns it bound to your client, created once. Method names match the spec's operationIds. Every response is the API's envelope, so the result is in Data. Operations on a team's resources take its teamId:

var automations = await platform.Api<AutomationsApi>().ListAutomationsAsync(teamId, page: 1, limit: 50);

Error Handling

Every error response and failed request throws PlatformException. Branch on Code, never on Message. A code this version doesn't know yet reads as ApiErrorCode.UnknownDefaultOpenApi. A request that got no response has Status 0:

using Qualithm.Platform.Model;

try
{
    await platform.Api<DevicesApi>().GetDeviceAsync(teamId, deviceId);
}
catch (PlatformException e) when (e.Code == ApiErrorCode.NotFound)
{
    // the device doesn't exist, or isn't in this team
}

API Reference

The operations and types are generated from the platform's OpenAPI spec, committed as openapi.json. Every public type carries /// XML doc comments, which ship in the package for the editor. CI builds the reference with docfx on every pull request into main:

dotnet tool restore
dotnet docfx docs/docfx.json --serve

Examples

See examples/:

Example Description
ListDevices List the devices in the token's team, and report a PlatformException
QUALITHM_API_TOKEN=<your-api-token> dotnet run --project examples/ListDevices

Development

Everything builds and tests on macOS, Linux or Windows with the .NET SDK global.json pins. Regenerating the client needs Docker.

git config core.hooksPath .githooks   # run the checks before each commit
dotnet restore --locked-mode
dotnet format                         # fix formatting
dotnet test
dotnet pack -c Release                # the .nupkg and .snupkg, in bin/Release

.claude/rules/checks.md lists the commands CI runs, and .githooks/pre-commit runs them.

Regenerating

src/Qualithm.Platform/Generated/ comes from openapi.json and the generator pinned in scripts/generate. Never edit it by hand: CI regenerates it and fails on any difference. The platform opens a pull request here with the new spec and the regenerated code whenever its API changes. To regenerate by hand:

scripts/generate

The hand-written layer is PlatformClient.cs and PlatformException.cs. The generated code sits outside the repo's checks, which hold only the hand-written layer:

  • Format and analyzers: scripts/generate starts every generated file with // <auto-generated/>, which dotnet format and the .NET analyzers skip, and keeps the generator's nullable setting (#nullable enable annotations). .editorconfig silences the one compiler warning the generated code trips (CS8073), for Generated/ only.
  • Coverage: the test project passes --coverlet-exclude-by-file "**/Generated/**/*.cs" through TestingPlatformCommandLineArguments, so the 80% line gate measures the hand-written layer.

Minimum Supported .NET Version

.NET 10 (SDK pinned in global.json).

License

Apache-2.0

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
0.7.0 88 11/12/2026
0.6.0 96 11/9/2026
0.5.0 106 10/27/2026
0.4.0 101 10/27/2026
0.3.0 96 10/25/2026
0.2.0 102 10/24/2026
0.1.0 107 10/24/2026