microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
samples/migration-bot

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Api/Activities/Conversation/EndOfConversationActivity.cs

53lines · 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
16public class EndOfConversationActivity() : Activity(ActivityType.EndOfConversation)
17{
18 /// <summary>
19 /// The a code for endOfConversation activities that indicates why the conversation ended.
20 /// </summary>
21 [JsonPropertyName("code")]
22 [JsonPropertyOrder(31)]
23 public EndOfConversationCode? Code { get; set; }
24
25 /// <summary>
26 /// The text content of the message.
27 /// </summary>
28 [JsonPropertyName("text")]
29 [JsonPropertyOrder(32)]
30 public required string Text { get; set; }
31}
32
33[JsonConverter(typeof(JsonConverter<EndOfConversationCode>))]
34public class EndOfConversationCode(string value) : StringEnum(value)
35{
36 public static readonly EndOfConversationCode Unknown = new("unknown");
37 public bool IsUnknown => Unknown.Equals(Value);
38
39 public static readonly EndOfConversationCode CompletedSuccessfully = new("completedSuccessfully");
40 public bool IsCompletedSuccessfully => CompletedSuccessfully.Equals(Value);
41
42 public static readonly EndOfConversationCode UserCancelled = new("userCancelled");
43 public bool IsUserCancelled => UserCancelled.Equals(Value);
44
45 public static readonly EndOfConversationCode BotTimedOut = new("botTimedOut");
46 public bool IsBotTimedOut => BotTimedOut.Equals(Value);
47
48 public static readonly EndOfConversationCode BotIssuedInvalidMessage = new("botIssuedInvalidMessage");
49 public bool IsBotIssuedInvalidMessage => BotIssuedInvalidMessage.Equals(Value);
50
51 public static readonly EndOfConversationCode ChannelFailed = new("channelFailed");
52 public bool IsChannelFailed => ChannelFailed.Equals(Value);
53}