microsoft/teams.net
Publicmirrored from https://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Api/MessageExtensions/Action.cs
61lines · modecode
| 1 | using System.Text.Json.Serialization; |
| 2 | |
| 3 | using Microsoft.Teams.Common; |
| 4 | |
| 5 | namespace Microsoft.Teams.Api.MessageExtensions; |
| 6 | |
| 7 | /// <summary> |
| 8 | /// The context from which the command originates. |
| 9 | // Possible values include: 'message', 'compose', 'commandbox' |
| 10 | /// </summary> |
| 11 | [JsonConverter(typeof(JsonConverter<MessagePreviewAction>))] |
| 12 | public class MessagePreviewAction(string value) : StringEnum(value) |
| 13 | { |
| 14 | public static readonly MessagePreviewAction Edit = new("edit"); |
| 15 | public bool IsEdit => Edit.Equals(Value); |
| 16 | |
| 17 | public static readonly MessagePreviewAction Send = new("send"); |
| 18 | public bool IsSend => Send.Equals(Value); |
| 19 | } |
| 20 | |
| 21 | /// <summary> |
| 22 | /// Messaging extension action |
| 23 | /// </summary> |
| 24 | public class Action : TaskModules.Request |
| 25 | { |
| 26 | /// <summary> |
| 27 | /// Id of the command assigned by Bot |
| 28 | /// </summary> |
| 29 | [JsonPropertyName("commandId")] |
| 30 | [JsonPropertyOrder(2)] |
| 31 | public string? CommandId { get; set; } |
| 32 | |
| 33 | /// <summary> |
| 34 | /// The context from which the command originates. |
| 35 | // Possible values include: 'message', 'compose', 'commandbox' |
| 36 | /// </summary> |
| 37 | [JsonPropertyName("commandContext")] |
| 38 | [JsonPropertyOrder(3)] |
| 39 | public required Commands.Context CommandContext { get; set; } |
| 40 | |
| 41 | /// <summary> |
| 42 | /// Bot message preview action taken by user. Possible values include: 'edit', 'send' |
| 43 | /// </summary> |
| 44 | [JsonPropertyName("botMessagePreviewAction")] |
| 45 | [JsonPropertyOrder(4)] |
| 46 | public required MessagePreviewAction BotMessagePreviewAction { get; set; } |
| 47 | |
| 48 | /// <summary> |
| 49 | /// the activities to preview |
| 50 | /// </summary> |
| 51 | [JsonPropertyName("botActivityPreview")] |
| 52 | [JsonPropertyOrder(5)] |
| 53 | public IList<Activities.Activity>? BotActivityPreview { get; set; } |
| 54 | |
| 55 | /// <summary> |
| 56 | /// Message content sent as part of the command request. |
| 57 | /// </summary> |
| 58 | [JsonPropertyName("messagePayload")] |
| 59 | [JsonPropertyOrder(6)] |
| 60 | public Messages.Message? MessagePayload { get; set; } |
| 61 | } |