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:
@@ -40,5 +40,17 @@ namespace ReC.Client.Api
|
|||||||
return ReCClientHelpers.Deserialize<T>(body);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,5 +73,17 @@ namespace ReC.Client.Api
|
|||||||
return ReCClientHelpers.Deserialize<T>(body);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,5 +48,17 @@ namespace ReC.Client.Api
|
|||||||
return ReCClientHelpers.Deserialize<T>(body);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user