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; }