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<object>`
method for data retrieval.
This commit is contained in:
2026-05-20 11:39:39 +02:00
parent 73d8068d8e
commit bbc3524dd9
3 changed files with 36 additions and 0 deletions

View File

@@ -40,5 +40,17 @@ namespace ReC.Client.Api
return ReCClientHelpers.Deserialize<T>(body);
}
}
/// <summary>
/// Retrieves profiles and returns a dynamically deserialized payload.
/// </summary>
#if NETFRAMEWORK
public Task<dynamic> GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
#else
public Task<dynamic?> GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
#endif
{
return GetAsync<object>(id, includeActions, cancel);
}
}
}

View File

@@ -73,5 +73,17 @@ namespace ReC.Client.Api
return ReCClientHelpers.Deserialize<T>(body);
}
}
/// <summary>
/// Retrieves Rec actions and returns a dynamically deserialized payload.
/// </summary>
#if NETFRAMEWORK
public Task<dynamic> GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
#else
public Task<dynamic?> GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
#endif
{
return GetAsync<object>(profileId, invoked, cancel);
}
}
}

View File

@@ -48,5 +48,17 @@ namespace ReC.Client.Api
return ReCClientHelpers.Deserialize<T>(body);
}
}
/// <summary>
/// Retrieves results with optional filters and returns a dynamically deserialized payload.
/// </summary>
#if NETFRAMEWORK
public Task<dynamic> 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<dynamic?> 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<object>(id, actionId, profileId, batchId, includeAction, includeProfile, lastBatch, cancel);
}
}
}