using IdokladSdk.Clients; using IdokladSdk.Requests.Core; namespace Idoklad.Client; /// /// Generic helpers over the SDK's list/detail request builders so the read endpoints of the many /// agendas can be expressed in a single line. The concrete payload type is inferred by the SDK and /// returned boxed (full data is preserved at runtime; only the Swagger schema is generic). /// public static class SdkRequestExtensions { public static async Task ToPageAsync( this BaseList list, int page, int pageSize, CancellationToken ct, string? filter = null, string? filterType = null, string? sort = null) where TList : BaseList where TClient : BaseClient where TFilter : new() where TSort : new() where TGetModel : new() => await list.GetPageAsync(page, pageSize, filter, filterType, sort, ct); public static async Task ToDetailAsync( this BaseDetail detail, CancellationToken ct) where TDetail : BaseDetail where TClient : BaseClient where TGetModel : new() => (await detail.GetAsync(ct)).Unwrap(); }