Documentation
Table of Contents

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

request string

What the caller wants, in plain language.

input object

A value the command works with, such as a record to write; null for none. It is sent to the model.

cancellationToken CancellationToken

Cancels the call, the execution included.

Returns

Task<CommandOutcome>

The outcome.

Exceptions

ArgumentNullException

request is null.

ArgumentException

request is 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

cancellationToken was cancelled.