From bbc3524dd9de267971c8d9d3cf525873e89a0c8d Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 20 May 2026 11:39:39 +0200 Subject: [PATCH] Add GetDynamicAsync methods for dynamic deserialization Added `GetDynamicAsync` methods to `ProfileApi`, `RecActionApi`, and `ResultApi` to enable dynamic payload deserialization. These methods support optional parameters for filtering and are conditionally compiled for `NETFRAMEWORK` and other frameworks, with nullable reference type support where applicable. Internally, they reuse the existing `GetAsync` method for data retrieval. --- src/ReC.Client/Api/ProfileApi.cs | 12 ++++++++++++ src/ReC.Client/Api/RecActionApi.cs | 12 ++++++++++++ src/ReC.Client/Api/ResultApi.cs | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/ReC.Client/Api/ProfileApi.cs b/src/ReC.Client/Api/ProfileApi.cs index 4347095..6c610d3 100644 --- a/src/ReC.Client/Api/ProfileApi.cs +++ b/src/ReC.Client/Api/ProfileApi.cs @@ -40,5 +40,17 @@ namespace ReC.Client.Api return ReCClientHelpers.Deserialize(body); } } + + /// + /// Retrieves profiles and returns a dynamically deserialized payload. + /// +#if NETFRAMEWORK + public Task GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default) +#else + public Task GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default) +#endif + { + return GetAsync(id, includeActions, cancel); + } } } diff --git a/src/ReC.Client/Api/RecActionApi.cs b/src/ReC.Client/Api/RecActionApi.cs index 9429d3f..cb85870 100644 --- a/src/ReC.Client/Api/RecActionApi.cs +++ b/src/ReC.Client/Api/RecActionApi.cs @@ -73,5 +73,17 @@ namespace ReC.Client.Api return ReCClientHelpers.Deserialize(body); } } + + /// + /// Retrieves Rec actions and returns a dynamically deserialized payload. + /// +#if NETFRAMEWORK + public Task GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default) +#else + public Task GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default) +#endif + { + return GetAsync(profileId, invoked, cancel); + } } } diff --git a/src/ReC.Client/Api/ResultApi.cs b/src/ReC.Client/Api/ResultApi.cs index 6a6d21e..94f38ba 100644 --- a/src/ReC.Client/Api/ResultApi.cs +++ b/src/ReC.Client/Api/ResultApi.cs @@ -48,5 +48,17 @@ namespace ReC.Client.Api return ReCClientHelpers.Deserialize(body); } } + + /// + /// Retrieves results with optional filters and returns a dynamically deserialized payload. + /// +#if NETFRAMEWORK + public Task GetDynamicAsync(long? id = null, long? actionId = null, long? profileId = null, string batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default) +#else + public Task GetDynamicAsync(long? id = null, long? actionId = null, long? profileId = null, string? batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default) +#endif + { + return GetAsync(id, actionId, profileId, batchId, includeAction, includeProfile, lastBatch, cancel); + } } }