From b7aea848a99461bd8b08d778ec38e77a2c1453a9 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 15 Apr 2026 13:57:42 +0200 Subject: [PATCH] Add InvokeReferences support to InvokeAsync method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added InvokeReferences class for passing optional reference values (Reference1–Reference5) when invoking a profile. Updated InvokeAsync to accept and serialize these references in the POST request. Improved XML docs to reflect the new parameter. --- src/ReC.Client/Api/InvokeReferences.cs | 46 ++++++++++++++++++++++++++ src/ReC.Client/Api/RecActionApi.cs | 6 ++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/ReC.Client/Api/InvokeReferences.cs diff --git a/src/ReC.Client/Api/InvokeReferences.cs b/src/ReC.Client/Api/InvokeReferences.cs new file mode 100644 index 0000000..e63a14a --- /dev/null +++ b/src/ReC.Client/Api/InvokeReferences.cs @@ -0,0 +1,46 @@ +namespace ReC.Client.Api +{ + /// + /// Optional reference values that are passed through to all result records when invoking a profile. + /// + public class InvokeReferences + { + /// Reference value 1. + public string +#if NET + ? +#endif + Reference1 { get; set; } + + /// Reference value 2. + public string +#if NET + ? +#endif + Reference2 { get; set; } + + /// Reference value 3. + public string + +#if NET + ? +#endif + Reference3 { get; set; } + + /// Reference value 4. + public string + +#if NET + ? +#endif + Reference4 { get; set; } + + /// Reference value 5. + public string + +#if NET + ? +#endif + Reference5 { get; set; } + } +} \ No newline at end of file diff --git a/src/ReC.Client/Api/RecActionApi.cs b/src/ReC.Client/Api/RecActionApi.cs index 830c76d..a326aa5 100644 --- a/src/ReC.Client/Api/RecActionApi.cs +++ b/src/ReC.Client/Api/RecActionApi.cs @@ -21,11 +21,13 @@ namespace ReC.Client.Api /// Invokes a ReC action for the specified profile. /// /// The profile identifier. + /// Optional reference values to pass through to all result records. /// A token to cancel the operation. /// if the request succeeds; otherwise, . - public async Task InvokeAsync(int profileId, CancellationToken cancellationToken = default) + public async Task InvokeAsync(int profileId, InvokeReferences references = null, CancellationToken cancellationToken = default) { - var resp = await Http.PostAsync($"{ResourcePath}/invoke/{profileId}", content: null, cancellationToken); + var content = references != null ? ReCClientHelpers.ToJsonContent(references) : null; + var resp = await Http.PostAsync($"{ResourcePath}/invoke/{profileId}", content, cancellationToken); return resp.IsSuccessStatusCode; }