Method RunAsync
- Namespace
- IntentSharp.Targets
- Assembly
- IntentSharp.dll
RunAsync(string, object?, CancellationToken)
Runs one whole operation for request: sense, plan, check and execute. Writing a record is the
same call with the record as input; whether it may write is decided by the rule files and the
data.allowWrites setting. A refused check or a failed plan returns an outcome with
Executed false and Check saying why.
public Task<CommandOutcome> RunAsync(string request, object? input = null, CancellationToken cancellationToken = default)
Parameters
requeststringWhat the caller wants, in plain language.
inputobjectA value the command works with, such as a record to write; null for none. It is sent to the model.
cancellationTokenCancellationTokenCancels the call, the execution included.
Returns
- Task<CommandOutcome>
The outcome.
Exceptions
- ArgumentNullException
requestis null.- ArgumentException
requestis empty.- InvalidOperationException
The plan intent is neither in the client's document store nor shipped by the library.
- TargetOperationException
Describing, inspecting or executing failed as the target classified it (a second SchemaMismatch included), or the execution outlasted
data.timeout(Timeout).- OperationCanceledException
cancellationTokenwas cancelled.