GoAffPro.Client
0.2.1-dev1
See the version list below for details.
dotnet add package GoAffPro.Client --version 0.2.1-dev1
NuGet\Install-Package GoAffPro.Client -Version 0.2.1-dev1
<PackageReference Include="GoAffPro.Client" Version="0.2.1-dev1" />
<PackageVersion Include="GoAffPro.Client" Version="0.2.1-dev1" />
<PackageReference Include="GoAffPro.Client" />
paket add GoAffPro.Client --version 0.2.1-dev1
#r "nuget: GoAffPro.Client, 0.2.1-dev1"
#:package GoAffPro.Client@0.2.1-dev1
#addin nuget:?package=GoAffPro.Client&version=0.2.1-dev1&prerelease
#tool nuget:?package=GoAffPro.Client&version=0.2.1-dev1&prerelease
GoAffPro.Client
Async-first .NET client for the GoAffPro API with build-time NSwag generation and polling/event-based change detection.
Targets
net8.0net10.0
Install
dotnet add package GoAffPro.Client
Quick Start
using GoAffPro.Client;
// Option 1: create from existing token
await using var client = new GoAffProClient(new GoAffProClientOptions
{
BearerToken = "your-access-token",
});
// Option 2: login and create
await using var loggedInClient = await GoAffProClient.CreateLoggedInAsync(
email: "affiliate@example.com",
password: "password123");
Wrapper Methods (DX Layer)
The wrapper methods are built on top of generated clients:
var orders = await client.GetOrdersAsync(limit: 50);
var affiliates = await client.GetAffiliatesAsync(limit: 50);
Wrapper methods return typed models:
GoAffProOrderGoAffProAffiliateGoAffProReward
Each model includes strongly typed fields and RawPayload (JsonElement) for advanced scenarios.
GetRewardsAsync is currently disabled because /user/feed/rewards is returning 404 (observed on 2026-02-18). The method is marked [Obsolete] and currently returns an empty collection.
Access Generated Clients Directly
var loginResponse = await client.User.UserLoginAsync(new GoAffPro.Client.Generated.User.Body
{
Email = "affiliate@example.com",
Password = "password123",
});
var publicSites = await client.PublicApi.PublicSitesAsync(
site_ids: null,
currency: null,
keyword: null,
limit: 20,
offset: 0);
Event Detection
GoAffProEventDetector supports both async streams and classic .NET events.
Async Streams
using GoAffPro.Client.Events;
var detector = new GoAffProEventDetector(client, pollingInterval: TimeSpan.FromSeconds(30));
await foreach (var order in detector.NewOrdersAsync(cancellationToken))
{
Console.WriteLine($"New order: {order.Id}");
}
Event Handlers
using GoAffPro.Client.Events;
var detector = new GoAffProEventDetector(client, pollingInterval: TimeSpan.FromSeconds(30));
detector.OrderDetected += (_, args) => Console.WriteLine($"Order: {args.Order.Id}");
detector.AffiliateDetected += (_, args) => Console.WriteLine($"Affiliate: {args.Affiliate.Id}");
await detector.StartAsync(cancellationToken);
Dependency Injection
services.AddGoAffProClient(options =>
{
options.BaseUrl = new Uri("https://api.goaffpro.com/v1/", UriKind.Absolute);
options.BearerToken = configuration["GoAffPro:Token"];
options.Timeout = TimeSpan.FromSeconds(30);
});
Example App
An executable sample is included at:
examples/GoAffPro.Client.Example
Run it with:
dotnet run --project examples/GoAffPro.Client.Example
Build-Time Generation
On build, GoAffPro.Client.Generator:
- Fetches
https://api.goaffpro.com/docs/admin/swagger-ui-init.js(or usesopenapi/swagger-ui-init.jsonly if you provide a local override file) - Extracts OpenAPI JSON
- Filters to
/user/*and/public/* - Normalizes schema gaps for generation
- Generates:
src/GoAffPro.Client/Generated/GoAffProUserClient.g.cssrc/GoAffPro.Client/Generated/GoAffProPublicClient.g.cs
Do not edit *.g.cs manually.
Testing
dotnet test
Integration Tests
$env:GOAFFPRO_TEST_TOKEN="your-token"
dotnet test --filter "Category=Integration"
Contract Snapshot Test
The test suite validates generated client method signatures against:
tests/GoAffPro.Client.Tests/Snapshots/GeneratedClientSignatures.snapshot
If generated signatures change, update the snapshot intentionally in the same change.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Microsoft.Extensions.Http.Polly (>= 10.0.0)
- Polly (>= 8.4.2)
- Polly.Extensions.Http (>= 3.0.0)
-
net8.0
- Microsoft.Extensions.Http.Polly (>= 10.0.0)
- Polly (>= 8.4.2)
- Polly.Extensions.Http (>= 3.0.0)
- System.Text.Json (>= 10.0.0)
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.3.0-dev2 | 0 | 2/25/2026 |
| 0.3.0-dev1 | 0 | 2/25/2026 |
| 0.2.1-dev1 | 50 | 2/22/2026 |
| 0.2.0 | 54 | 2/18/2026 |