Language

ActionSubmitRouteAttribute(String, String, Boolean, UInt16, String) Constructor

Definition

Attribute to define a route that handles Adaptive Card Action.Submit message activities, optionally matching a specific verb or verb pattern.

public ActionSubmitRouteAttribute(string verb = default, string verbRegex = default, bool isAgenticOnly = false, ushort rank = 32767, string autoSignInHandlers = default);
new Microsoft.Agents.Builder.App.AdaptiveCards.ActionSubmitRouteAttribute : string * string * bool * uint16 * string -> Microsoft.Agents.Builder.App.AdaptiveCards.ActionSubmitRouteAttribute
Public Sub New (Optional verb As String = Nothing, Optional verbRegex As String = Nothing, Optional isAgenticOnly As Boolean = false, Optional rank As UShort = 32767, Optional autoSignInHandlers As String = Nothing)

Parameters

verb
String

The exact verb to match. Mutually exclusive with verbRegex. When both are omitted, all Action.Submit messages are matched.

verbRegex
String

A regular expression pattern matched against the Action.Submit filter field. Mutually exclusive with verb.

isAgenticOnly
Boolean

When true, the route only fires for agentic turns. Defaults to false.

rank
UInt16

Route evaluation order. Lower values run first. Defaults to Unspecified.

autoSignInHandlers
String

A comma/space/semicolon-delimited list of OAuth sign-in handler names, or the name of an instance or static method on the agent class matching Func<ITurnContext, string[]>.

Remarks

Decorate a method with this attribute to register it as a handler for Adaptive Card Action.Submit events. Provide verb for an exact match, verbRegex for a pattern match, or neither to match any Action.Submit message. verb and verbRegex are mutually exclusive. When a verb is matched, the activity value field configured by the actionSubmitFilter option (defaults to verb) is used. The method must match the ActionSubmitHandler delegate signature.

[ActionSubmitRoute("ok")]
public async Task OnOkAsync(ITurnContext turnContext, ITurnState turnState, object data, CancellationToken cancellationToken)
{
    // Handle Action.Submit with verb "ok"
}

Applies to