From e774afc85e7f4be8533e7d8865f9786635b153da Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 5 Dec 2025 23:02:45 +0100 Subject: [PATCH] Add InvokeRecActionAsync method to ReCClient class Added the `InvokeRecActionAsync` method to the `ReCClient` class in the `ReC.Client` namespace. This method performs an asynchronous HTTP POST request to the `api/RecAction/invoke/{profileId}` endpoint. It accepts a `profileId` parameter to specify the profile ID and an optional `CancellationToken` for task cancellation. The method ensures the HTTP response indicates success by calling `EnsureSuccessStatusCode()`. Included XML documentation comments for clarity and maintainability. --- src/ReC.Client/ReCClient.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 99165a7..767ae33 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -18,5 +18,17 @@ namespace ReC.Client { _http = http ?? throw new ArgumentNullException(nameof(http)); } + + /// + /// POST api/RecAction/invoke/{profileId} + /// + /// + /// + /// + public async Task InvokeRecActionAsync(int profileId, CancellationToken ct = default) + { + var resp = await _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null, ct); + resp.EnsureSuccessStatusCode(); + } } }