microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Bot.Apps/Handlers/MessageExtension/MessageExtensionQuery.cs
77lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json.Serialization; |
| 5 | |
| 6 | namespace Microsoft.Teams.Bot.Apps.Handlers.MessageExtension; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// Messaging extension query payload. |
| 10 | /// </summary> |
| 11 | public class MessageExtensionQuery |
| 12 | { |
| 13 | /// <summary> |
| 14 | /// Id of the command assigned by the bot. |
| 15 | /// </summary> |
| 16 | [JsonPropertyName("commandId")] |
| 17 | public required string CommandId { get; set; } |
| 18 | |
| 19 | /// <summary> |
| 20 | /// Parameters for the query. |
| 21 | /// </summary> |
| 22 | [JsonPropertyName("parameters")] |
| 23 | public required IList<QueryParameter> Parameters { get; set; } |
| 24 | |
| 25 | /// <summary> |
| 26 | /// Query options for pagination. |
| 27 | /// </summary> |
| 28 | [JsonPropertyName("queryOptions")] |
| 29 | public QueryOptions? QueryOptions { get; set; } |
| 30 | |
| 31 | //TODO : check how to use this ? auth ? |
| 32 | /* |
| 33 | /// <summary> |
| 34 | /// State parameter passed back to the bot after authentication/configuration flow. |
| 35 | /// </summary> |
| 36 | [JsonPropertyName("state")] |
| 37 | public string? State { get; set; } |
| 38 | */ |
| 39 | } |
| 40 | |
| 41 | /// <summary> |
| 42 | /// Query parameter. |
| 43 | /// </summary> |
| 44 | public class QueryParameter |
| 45 | { |
| 46 | /// <summary> |
| 47 | /// Name of the parameter. |
| 48 | /// </summary> |
| 49 | [JsonPropertyName("name")] |
| 50 | public required string Name { get; set; } |
| 51 | |
| 52 | /// <summary> |
| 53 | /// Value of the parameter. |
| 54 | /// </summary> |
| 55 | [JsonPropertyName("value")] |
| 56 | public required string Value { get; set; } |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /// <summary> |
| 61 | /// Query options for pagination. |
| 62 | /// </summary> |
| 63 | public class QueryOptions |
| 64 | { |
| 65 | /// <summary> |
| 66 | /// Number of entities to skip. |
| 67 | /// </summary> |
| 68 | [JsonPropertyName("skip")] |
| 69 | public int? Skip { get; set; } |
| 70 | |
| 71 | /// <summary> |
| 72 | /// Number of entities to fetch. |
| 73 | /// </summary> |
| 74 | [JsonPropertyName("count")] |
| 75 | public int? Count { get; set; } |
| 76 | } |
| 77 | |
| 78 | |