microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
next/core

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Bot.Core/Schema/ConversationAccount.cs

76lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4namespace Microsoft.Teams.Bot.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>
13public 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 public bool? IsTargeted { get; set; }
32
33 /// <summary>
34 /// Gets or sets the agentic application ID for user-delegated token acquisition.
35 /// </summary>
36 [JsonPropertyName("agenticAppId")]
37 public string? AgenticAppId { get; set; }
38
39 /// <summary>
40 /// Gets or sets the agentic user ID for user-delegated token acquisition.
41 /// </summary>
42 [JsonPropertyName("agenticUserId")]
43 public string? AgenticUserId { get; set; }
44
45 /// <summary>
46 /// Gets or sets the agentic application blueprint ID.
47 /// </summary>
48 [JsonPropertyName("agenticAppBlueprintId")]
49 public string? AgenticAppBlueprintId { get; set; }
50
51 /// <summary>
52 /// Gets the extension data dictionary for storing additional properties not defined in the schema.
53 /// </summary>
54 [JsonExtensionData]
55 public ExtendedPropertiesDictionary Properties { get; set; } = [];
56
57 /// <summary>
58 /// Gets the agentic identity from the account's typed properties.
59 /// </summary>
60 /// <returns>An AgenticIdentity instance if agentic identity information is present; otherwise, null.</returns>
61 [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1024:Use properties where appropriate")]
62 public AgenticIdentity? GetAgenticIdentity()
63 {
64 if (AgenticAppId is null && AgenticUserId is null && AgenticAppBlueprintId is null)
65 {
66 return null;
67 }
68
69 return new AgenticIdentity
70 {
71 AgenticAppId = AgenticAppId,
72 AgenticUserId = AgenticUserId,
73 AgenticAppBlueprintId = AgenticAppBlueprintId
74 };
75 }
76}
77