microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Bot.Core/Activities/CommandResultActivity.cs
56lines · 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 | /// Asynchronous external command result activity. |
| 8 | /// </summary> |
| 9 | public class CommandResultActivity : 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 result. |
| 19 | /// </summary> |
| 20 | [JsonPropertyName("value")] |
| 21 | public CommandResultValue? Value { get; set; } |
| 22 | |
| 23 | /// <summary> |
| 24 | /// Initializes a new instance of the <see cref="CommandResultActivity"/> class. |
| 25 | /// </summary> |
| 26 | public CommandResultActivity() : base(ActivityTypes.CommandResult) |
| 27 | { |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | /// <summary> |
| 32 | /// The value field of a <see cref="CommandResultActivity"/> contains metadata related to a command result. |
| 33 | /// An optional extensible data payload may be included if defined by the command result activity name. |
| 34 | /// The presence of an error field indicates that the original command failed to complete. |
| 35 | /// </summary> |
| 36 | public class CommandResultValue |
| 37 | { |
| 38 | /// <summary> |
| 39 | /// Gets or sets the ID of the command. |
| 40 | /// </summary> |
| 41 | [JsonPropertyName("commandId")] |
| 42 | public string? CommandId { get; set; } |
| 43 | |
| 44 | /// <summary> |
| 45 | /// Gets or sets the data field containing optional parameters specific to this command result activity, |
| 46 | /// as defined by the name. The value of the data field is a complex type. |
| 47 | /// </summary> |
| 48 | [JsonPropertyName("data")] |
| 49 | public object? Data { get; set; } |
| 50 | |
| 51 | /// <summary> |
| 52 | /// Gets or sets the optional error, if the command result indicates a failure. |
| 53 | /// </summary> |
| 54 | [JsonPropertyName("error")] |
| 55 | public Error? Error { get; set; } |
| 56 | } |
| 57 | |