microsoft/teams.net
Publicmirrored from https://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Api/Activities/Conversation/EndOfConversationActivity.cs
55lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json.Serialization; |
| 5 | |
| 6 | using Microsoft.Teams.Common; |
| 7 | |
| 8 | namespace Microsoft.Teams.Api.Activities; |
| 9 | |
| 10 | public partial class ActivityType : StringEnum |
| 11 | { |
| 12 | public static readonly ActivityType EndOfConversation = new("endOfConversation"); |
| 13 | public bool IsEndOfConversation => EndOfConversation.Equals(Value); |
| 14 | } |
| 15 | |
| 16 | [Obsolete("This will be removed by end of summer 2026.")] |
| 17 | public class EndOfConversationActivity() : Activity(ActivityType.EndOfConversation) |
| 18 | { |
| 19 | /// <summary> |
| 20 | /// The a code for endOfConversation activities that indicates why the conversation ended. |
| 21 | /// </summary> |
| 22 | [JsonPropertyName("code")] |
| 23 | [JsonPropertyOrder(31)] |
| 24 | public EndOfConversationCode? Code { get; set; } |
| 25 | |
| 26 | /// <summary> |
| 27 | /// The text content of the message. |
| 28 | /// </summary> |
| 29 | [JsonPropertyName("text")] |
| 30 | [JsonPropertyOrder(32)] |
| 31 | public required string Text { get; set; } |
| 32 | } |
| 33 | |
| 34 | [JsonConverter(typeof(JsonConverter<EndOfConversationCode>))] |
| 35 | [Obsolete("This will be removed by end of summer 2026.")] |
| 36 | public class EndOfConversationCode(string value) : StringEnum(value) |
| 37 | { |
| 38 | public static readonly EndOfConversationCode Unknown = new("unknown"); |
| 39 | public bool IsUnknown => Unknown.Equals(Value); |
| 40 | |
| 41 | public static readonly EndOfConversationCode CompletedSuccessfully = new("completedSuccessfully"); |
| 42 | public bool IsCompletedSuccessfully => CompletedSuccessfully.Equals(Value); |
| 43 | |
| 44 | public static readonly EndOfConversationCode UserCancelled = new("userCancelled"); |
| 45 | public bool IsUserCancelled => UserCancelled.Equals(Value); |
| 46 | |
| 47 | public static readonly EndOfConversationCode BotTimedOut = new("botTimedOut"); |
| 48 | public bool IsBotTimedOut => BotTimedOut.Equals(Value); |
| 49 | |
| 50 | public static readonly EndOfConversationCode BotIssuedInvalidMessage = new("botIssuedInvalidMessage"); |
| 51 | public bool IsBotIssuedInvalidMessage => BotIssuedInvalidMessage.Equals(Value); |
| 52 | |
| 53 | public static readonly EndOfConversationCode ChannelFailed = new("channelFailed"); |
| 54 | public bool IsChannelFailed => ChannelFailed.Equals(Value); |
| 55 | } |