microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Core/Schema/ConversationAccount.cs
77lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | namespace Microsoft.Teams.Core.Schema; |
| 5 | |
| 6 | /// <summary> |
| 7 | /// Represents a conversation account, including its unique identifier, display name, and any additional properties |
| 8 | /// associated with the conversation. |
| 9 | /// </summary> |
| 10 | /// <remarks>This class is typically used to model the account information for a conversation in messaging or chat |
| 11 | /// applications. The additional properties dictionary allows for extensibility to support custom metadata or |
| 12 | /// protocol-specific fields.</remarks> |
| 13 | public class ConversationAccount() |
| 14 | { |
| 15 | /// <summary> |
| 16 | /// Gets or sets the unique identifier for the object. |
| 17 | /// </summary> |
| 18 | [JsonPropertyName("id")] |
| 19 | public string? Id { get; set; } |
| 20 | |
| 21 | /// <summary> |
| 22 | /// Gets or sets the display name of the conversation account. |
| 23 | /// </summary> |
| 24 | [JsonPropertyName("name")] |
| 25 | public string? Name { get; set; } |
| 26 | |
| 27 | /// <summary> |
| 28 | /// Gets or sets a value indicating whether this is a targeted message visible only to this recipient. |
| 29 | /// </summary> |
| 30 | [JsonPropertyName("isTargeted")] |
| 31 | [System.Diagnostics.CodeAnalysis.Experimental("ExperimentalTeamsTargeted")] |
| 32 | public bool? IsTargeted { get; set; } |
| 33 | |
| 34 | /// <summary> |
| 35 | /// Gets or sets the agentic application ID for user-delegated token acquisition. |
| 36 | /// </summary> |
| 37 | [JsonPropertyName("agenticAppId")] |
| 38 | public string? AgenticAppId { get; set; } |
| 39 | |
| 40 | /// <summary> |
| 41 | /// Gets or sets the agentic user ID for user-delegated token acquisition. |
| 42 | /// </summary> |
| 43 | [JsonPropertyName("agenticUserId")] |
| 44 | public string? AgenticUserId { get; set; } |
| 45 | |
| 46 | /// <summary> |
| 47 | /// Gets or sets the agentic application blueprint ID. |
| 48 | /// </summary> |
| 49 | [JsonPropertyName("agenticAppBlueprintId")] |
| 50 | public string? AgenticAppBlueprintId { get; set; } |
| 51 | |
| 52 | /// <summary> |
| 53 | /// Gets the extension data dictionary for storing additional properties not defined in the schema. |
| 54 | /// </summary> |
| 55 | [JsonExtensionData] |
| 56 | public ExtendedPropertiesDictionary Properties { get; set; } = []; |
| 57 | |
| 58 | /// <summary> |
| 59 | /// Gets the agentic identity from the account's typed properties. |
| 60 | /// </summary> |
| 61 | /// <returns>An AgenticIdentity instance if agentic identity information is present; otherwise, null.</returns> |
| 62 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1024:Use properties where appropriate")] |
| 63 | public AgenticIdentity? GetAgenticIdentity() |
| 64 | { |
| 65 | if (AgenticAppId is null && AgenticUserId is null && AgenticAppBlueprintId is null) |
| 66 | { |
| 67 | return null; |
| 68 | } |
| 69 | |
| 70 | return new AgenticIdentity |
| 71 | { |
| 72 | AgenticAppId = AgenticAppId, |
| 73 | AgenticUserId = AgenticUserId, |
| 74 | AgenticAppBlueprintId = AgenticAppBlueprintId |
| 75 | }; |
| 76 | } |
| 77 | } |
| 78 | |