microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Bot.Core/Activities/CommandActivity.cs
49lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | namespace Microsoft.Bot.Core.Activities; |
| 5 | |
| 6 | /// <summary> |
| 7 | /// Represents a command activity. |
| 8 | /// </summary> |
| 9 | public class CommandActivity : Activity |
| 10 | { |
| 11 | /// <summary> |
| 12 | /// Gets or sets the name of the command. |
| 13 | /// </summary> |
| 14 | [JsonPropertyName("name")] |
| 15 | public string? Name { get; set; } |
| 16 | |
| 17 | /// <summary> |
| 18 | /// Gets or sets the value for this command. |
| 19 | /// </summary> |
| 20 | [JsonPropertyName("value")] |
| 21 | public CommandValue? Value { get; set; } |
| 22 | |
| 23 | /// <summary> |
| 24 | /// Initializes a new instance of the <see cref="CommandActivity"/> class. |
| 25 | /// </summary> |
| 26 | public CommandActivity() : base(ActivityTypes.Command) |
| 27 | { |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | /// <summary> |
| 32 | /// The value field of a command activity contains metadata related to a command. |
| 33 | /// An optional extensible data payload may be included if defined by the command activity name. |
| 34 | /// </summary> |
| 35 | public class CommandValue |
| 36 | { |
| 37 | /// <summary> |
| 38 | /// Gets or sets the channel ID for the command. |
| 39 | /// </summary> |
| 40 | [JsonPropertyName("channelId")] |
| 41 | public string? ChannelId { get; set; } |
| 42 | |
| 43 | /// <summary> |
| 44 | /// Gets or sets the data field containing optional parameters specific to this command activity, |
| 45 | /// as defined by the name. The value of the data field is a complex type. |
| 46 | /// </summary> |
| 47 | [JsonPropertyName("data")] |
| 48 | public object? Data { get; set; } |
| 49 | } |
| 50 | |