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