Language

TeamsTeamUpdateRouteAttribute(Boolean, UInt16, String) Constructor

Definition

Attribute to define a route that handles any Teams team update event.

public TeamsTeamUpdateRouteAttribute(bool isAgenticOnly = false, ushort rank = 32767, string signInHandlers = default);
new Microsoft.Agents.Extensions.MSTeams.Teams.TeamsTeamUpdateRouteAttribute : bool * uint16 * string -> Microsoft.Agents.Extensions.MSTeams.Teams.TeamsTeamUpdateRouteAttribute
Public Sub New (Optional isAgenticOnly As Boolean = false, Optional rank As UShort = 32767, Optional signInHandlers As String = Nothing)

Parameters

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.

signInHandlers
String

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

Remarks

Decorate a method with this attribute to register it as a handler for all team update events in Teams, including archived, unarchived, deleted, renamed, and restored. Use the specific event attributes (e.g., TeamsTeamArchivedRouteAttribute) to handle individual event types. The method must match the TeamUpdateHandler delegate signature.

[TeamsTeamUpdateRoute]
public async Task OnAnyTeamEventAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Apps.Schema.Team team, CancellationToken cancellationToken)
{
    // Handle any team update event
}

Alternatively, OnTeamEventReceived(TeamUpdateHandler, String[], UInt16) can be used to register the handler via the fluent API.

Applies to