microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/McpServer/Models.cs
37lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json.Serialization; |
| 5 | |
| 6 | namespace McpServer; |
| 7 | |
| 8 | // MCP clients (and their JSON output schemas) expect snake_case field names, |
| 9 | // so each positional record parameter carries an explicit JsonPropertyName. |
| 10 | // The `property:` target is required: without it, the attribute would land on |
| 11 | // the constructor parameter and System.Text.Json would ignore it. |
| 12 | |
| 13 | public sealed record NotifyResult( |
| 14 | [property: JsonPropertyName("notified")] bool Notified, |
| 15 | [property: JsonPropertyName("user_id")] string UserId); |
| 16 | |
| 17 | public sealed record AskResult( |
| 18 | [property: JsonPropertyName("request_id")] string RequestId); |
| 19 | |
| 20 | public sealed record ReplyResult( |
| 21 | [property: JsonPropertyName("status")] string Status, |
| 22 | [property: JsonPropertyName("reply")] string? Reply); |
| 23 | |
| 24 | public sealed record ApprovalRequestResult( |
| 25 | [property: JsonPropertyName("approval_id")] string ApprovalId); |
| 26 | |
| 27 | public sealed record ApprovalResult( |
| 28 | [property: JsonPropertyName("approval_id")] string ApprovalId, |
| 29 | [property: JsonPropertyName("status")] string Status); |
| 30 | |
| 31 | public sealed record UserMatch( |
| 32 | [property: JsonPropertyName("id")] string Id, |
| 33 | [property: JsonPropertyName("display_name")] string? DisplayName, |
| 34 | [property: JsonPropertyName("user_principal_name")] string? UserPrincipalName); |
| 35 | |
| 36 | public sealed record FindUserResult( |
| 37 | [property: JsonPropertyName("matches")] IReadOnlyList<UserMatch> Matches); |
| 38 | |