microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Bot.Apps/Schema/StreamingActivity.cs
37lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json.Serialization; |
| 5 | using Microsoft.Teams.Bot.Apps.Schema.Entities; |
| 6 | |
| 7 | namespace Microsoft.Teams.Bot.Apps.Schema; |
| 8 | |
| 9 | /// <summary> |
| 10 | /// Represents a streaming activity chunk. Has type "typing" to satisfy the Teams |
| 11 | /// streaming API, but carries text content that accumulates into the final response. |
| 12 | /// </summary> |
| 13 | public class StreamingActivity : TeamsActivity |
| 14 | { |
| 15 | /// <summary> |
| 16 | /// Initializes a new instance of the <see cref="StreamingActivity"/> class with the specified text. |
| 17 | /// </summary> |
| 18 | /// <param name="text"></param> |
| 19 | [JsonConstructor] |
| 20 | public StreamingActivity(string text) : base(TeamsActivityType.Typing) |
| 21 | { |
| 22 | Text = text; |
| 23 | StreamInfo = new StreamInfoEntity(); |
| 24 | AddEntity(StreamInfo); |
| 25 | } |
| 26 | |
| 27 | /// <summary> |
| 28 | /// Gets or sets the text content of the streaming chunk. |
| 29 | /// </summary> |
| 30 | [JsonPropertyName("text")] |
| 31 | public string Text { get; set; } |
| 32 | |
| 33 | /// <summary> |
| 34 | /// Gets the stream info entity for this streaming activity. |
| 35 | /// </summary> |
| 36 | public StreamInfoEntity StreamInfo { get; } |
| 37 | } |
| 38 | |