microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/sub-pr-338

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Bot.Core/ConversationClient.Models.cs

248lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Bot.Core.Schema;
5
6namespace Microsoft.Teams.Bot.Core;
7
8/// <summary>
9/// Response from sending an activity.
10/// </summary>
11public class SendActivityResponse
12{
13 /// <summary>
14 /// Id of the activity
15 /// </summary>
16 [JsonPropertyName("id")]
17 public string? Id { get; set; }
18}
19
20/// <summary>
21/// Response from updating an activity.
22/// </summary>
23public class UpdateActivityResponse
24{
25 /// <summary>
26 /// Id of the activity
27 /// </summary>
28 [JsonPropertyName("id")]
29 public string? Id { get; set; }
30}
31
32/// <summary>
33/// Response from deleting an activity.
34/// </summary>
35public class DeleteActivityResponse
36{
37 /// <summary>
38 /// Id of the activity
39 /// </summary>
40 [JsonPropertyName("id")]
41 public string? Id { get; set; }
42}
43
44/// <summary>
45/// Response from getting conversations.
46/// </summary>
47public class GetConversationsResponse
48{
49 /// <summary>
50 /// Gets or sets the continuation token that can be used to get paged results.
51 /// </summary>
52 [JsonPropertyName("continuationToken")]
53 public string? ContinuationToken { get; set; }
54
55 /// <summary>
56 /// Gets or sets the list of conversations.
57 /// </summary>
58 [JsonPropertyName("conversations")]
59#pragma warning disable CA2227 // Collection properties should be read only
60 public IList<ConversationMembers>? Conversations { get; set; }
61#pragma warning restore CA2227 // Collection properties should be read only
62}
63
64/// <summary>
65/// Represents a conversation and its members.
66/// </summary>
67public class ConversationMembers
68{
69 /// <summary>
70 /// Gets or sets the conversation ID.
71 /// </summary>
72 [JsonPropertyName("id")]
73 public string? Id { get; set; }
74
75 /// <summary>
76 /// Gets or sets the list of members in this conversation.
77 /// </summary>
78 [JsonPropertyName("members")]
79#pragma warning disable CA2227 // Collection properties should be read only
80 public IList<ConversationAccount>? Members { get; set; }
81#pragma warning restore CA2227 // Collection properties should be read only
82}
83
84/// <summary>
85/// Parameters for creating a new conversation.
86/// </summary>
87public class ConversationParameters
88{
89 /// <summary>
90 /// Gets or sets a value indicating whether the conversation is a group conversation.
91 /// </summary>
92 [JsonPropertyName("isGroup")]
93 public bool? IsGroup { get; set; }
94
95 /// <summary>
96 /// Gets or sets the bot's account for this conversation.
97 /// </summary>
98 [JsonPropertyName("bot")]
99 public ConversationAccount? Bot { get; set; }
100
101 /// <summary>
102 /// Gets or sets the list of members to add to the conversation.
103 /// </summary>
104 [JsonPropertyName("members")]
105#pragma warning disable CA2227 // Collection properties should be read only
106 public IList<ConversationAccount>? Members { get; set; }
107#pragma warning restore CA2227 // Collection properties should be read only
108
109 /// <summary>
110 /// Gets or sets the topic name for the conversation (if supported by the channel).
111 /// </summary>
112 [JsonPropertyName("topicName")]
113 public string? TopicName { get; set; }
114
115 /// <summary>
116 /// Gets or sets the initial activity to send when creating the conversation.
117 /// </summary>
118 [JsonPropertyName("activity")]
119 public CoreActivity? Activity { get; set; }
120
121 /// <summary>
122 /// Gets or sets channel-specific payload for creating the conversation.
123 /// </summary>
124 [JsonPropertyName("channelData")]
125 public object? ChannelData { get; set; }
126
127 /// <summary>
128 /// Gets or sets the tenant ID where the conversation should be created.
129 /// </summary>
130 [JsonPropertyName("tenantId")]
131 public string? TenantId { get; set; }
132}
133
134/// <summary>
135/// Response from creating a conversation.
136/// </summary>
137public class CreateConversationResponse
138{
139 /// <summary>
140 /// Gets or sets the ID of the activity (if sent).
141 /// </summary>
142 [JsonPropertyName("activityId")]
143 public string? ActivityId { get; set; }
144
145 /// <summary>
146 /// Gets or sets the service endpoint where operations concerning the conversation may be performed.
147 /// </summary>
148 [JsonPropertyName("serviceUrl")]
149 public Uri? ServiceUrl { get; set; }
150
151 /// <summary>
152 /// Gets or sets the identifier of the conversation resource.
153 /// </summary>
154 [JsonPropertyName("id")]
155 public string? Id { get; set; }
156}
157
158/// <summary>
159/// Result from getting paged members of a conversation.
160/// </summary>
161public class PagedMembersResult
162{
163 /// <summary>
164 /// Gets or sets the continuation token that can be used to get paged results.
165 /// </summary>
166 [JsonPropertyName("continuationToken")]
167 public string? ContinuationToken { get; set; }
168
169 /// <summary>
170 /// Gets or sets the list of members in this page.
171 /// </summary>
172 [JsonPropertyName("members")]
173#pragma warning disable CA2227 // Collection properties should be read only
174 public IList<ConversationAccount>? Members { get; set; }
175#pragma warning restore CA2227 // Collection properties should be read only
176}
177
178/// <summary>
179/// A collection of activities that represents a conversation transcript.
180/// </summary>
181public class Transcript
182{
183 /// <summary>
184 /// Gets or sets the collection of activities that conforms to the Transcript schema.
185 /// </summary>
186 [JsonPropertyName("activities")]
187#pragma warning disable CA2227 // Collection properties should be read only
188 public IList<CoreActivity>? Activities { get; set; }
189#pragma warning restore CA2227 // Collection properties should be read only
190}
191
192/// <summary>
193/// Response from sending conversation history.
194/// </summary>
195public class SendConversationHistoryResponse
196{
197 /// <summary>
198 /// Gets or sets the ID of the resource.
199 /// </summary>
200 [JsonPropertyName("id")]
201 public string? Id { get; set; }
202}
203
204/// <summary>
205/// Represents attachment data for uploading.
206/// </summary>
207public class AttachmentData
208{
209 /// <summary>
210 /// Gets or sets the Content-Type of the attachment.
211 /// </summary>
212 [JsonPropertyName("type")]
213 public string? Type { get; set; }
214
215 /// <summary>
216 /// Gets or sets the name of the attachment.
217 /// </summary>
218 [JsonPropertyName("name")]
219 public string? Name { get; set; }
220
221 /// <summary>
222 /// Gets or sets the attachment content as a byte array.
223 /// </summary>
224 [JsonPropertyName("originalBase64")]
225#pragma warning disable CA1819 // Properties should not return arrays
226 public byte[]? OriginalBase64 { get; set; }
227#pragma warning restore CA1819 // Properties should not return arrays
228
229 /// <summary>
230 /// Gets or sets the attachment thumbnail as a byte array.
231 /// </summary>
232 [JsonPropertyName("thumbnailBase64")]
233#pragma warning disable CA1819 // Properties should not return arrays
234 public byte[]? ThumbnailBase64 { get; set; }
235#pragma warning restore CA1819 // Properties should not return arrays
236}
237
238/// <summary>
239/// Response from uploading an attachment.
240/// </summary>
241public class UploadAttachmentResponse
242{
243 /// <summary>
244 /// Gets or sets the ID of the uploaded attachment.
245 /// </summary>
246 [JsonPropertyName("id")]
247 public string? Id { get; set; }
248}