microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
docs/update-release-process

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

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
4using System.Text.Json.Serialization;
5
6using Microsoft.Teams.Common;
7
8namespace Microsoft.Teams.Api.Activities;
9
10public 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.")]
17public 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.")]
36public 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}