Skip to content

v2.2.0

Choose a tag to compare

@ianhalpern ianhalpern released this 09 Feb 22:16
· 2 commits to master since this release
v2.2.0
3257bfa

Release v2.2.0

🎉 Major Features

Static Query Methods on ARMObjectBase

New static All, GroupBy, and OrderBy methods on all ARM object types, enabling cleaner query patterns directly from the type.

  • All / AllAsync: Query all objects of a type

    var customers = pl.Customer.All();
    var payments = await pl.Payment.AllAsync();
  • GroupBy: Group query results by field

    var results = pl.Payment.GroupBy("status").All();
  • OrderBy: Order query results by field

    var results = pl.Payment.OrderBy("desc(created_at)").All();

Exceptions Namespace

Exception classes are now available under the Payload.Exceptions namespace for cleaner imports. Existing pl.* exception references remain supported for backward compatibility.

using Payload.Exceptions;

try { ... }
catch (InvalidAttributes e) { ... }
catch (NotFound e) { ... }

✨ New Objects

  • InvoiceAttachment - Invoice file attachments

🐛 Bug Fixes

  • Fixed ARMRequest.GroupBy with string arguments: Passing a string like "status" would throw an InvalidCastException because string implements IEnumerable and was incorrectly handled as a collection
  • Fixed GetRoute pluralization: Object names ending in "s" (e.g. processing_settings) no longer get a double "s" appended to their endpoint

🔧 Improvements

  • Extracted shared BuildRequest/ExtractArgs helpers in ARMObjectBase to eliminate duplicated session extraction and polymorphic filter logic
  • Moved _httpMessageHandler from ARMRequest to Payload.Session for cleaner test mocking and architecture
  • Renamed Session constructor parameters from api_key/api_version to apiKey/apiVersion to follow C# naming conventions

📚 Documentation

  • Updated README to use apiVersion parameter name

🔄 Breaking Changes

None - this release is fully backward compatible. The Session constructor parameter rename uses named arguments, which is source-compatible for positional callers.

Pull Requests

  • #30 Release v2.2.0

Installation

Install via NuGet Package Manager:

dotnet add package payload-api --version 2.2.0

Or via Package Manager Console:

Install-Package payload-api -Version 2.2.0

Or add to your .csproj file:

<PackageReference Include="payload-api" Version="2.2.0" />

Full Changelog

v2.1.0...v2.2.0