microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Bot.Apps/Schema/Entities/SensitiveUsageEntity.cs
74lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Text.Json.Serialization; |
| 5 | |
| 6 | namespace Microsoft.Teams.Bot.Apps.Schema.Entities; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// Represents an entity that describes the usage of sensitive content, including its name, description, and associated |
| 10 | /// pattern. |
| 11 | /// </summary> |
| 12 | public class SensitiveUsageEntity : OMessageEntity |
| 13 | { |
| 14 | /// <summary> |
| 15 | /// Creates a new instance of <see cref="SensitiveUsageEntity"/>. |
| 16 | /// </summary> |
| 17 | public SensitiveUsageEntity() : base() => OType = "CreativeWork"; |
| 18 | |
| 19 | /// <summary> |
| 20 | /// Gets or sets the name of the sensitive usage. |
| 21 | /// </summary> |
| 22 | [JsonPropertyName("name")] |
| 23 | public required string Name |
| 24 | { |
| 25 | get => base.Properties.TryGetValue("name", out object? value) ? value?.ToString() ?? string.Empty : string.Empty; |
| 26 | set => base.Properties["name"] = value; |
| 27 | } |
| 28 | |
| 29 | /// <summary> |
| 30 | /// Gets or sets the description of the sensitive usage. |
| 31 | /// </summary> |
| 32 | [JsonPropertyName("description")] |
| 33 | public string? Description |
| 34 | { |
| 35 | get => base.Properties.TryGetValue("description", out object? value) ? value?.ToString() : null; |
| 36 | set => base.Properties["description"] = value; |
| 37 | } |
| 38 | |
| 39 | /// <summary> |
| 40 | /// Gets or sets the pattern associated with the sensitive usage. |
| 41 | /// </summary> |
| 42 | [JsonPropertyName("pattern")] |
| 43 | public DefinedTerm? Pattern |
| 44 | { |
| 45 | get => base.Properties.TryGetValue("pattern", out object? value) ? value as DefinedTerm : null; |
| 46 | set => base.Properties["pattern"] = value; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /// <summary> |
| 51 | /// Defined term. |
| 52 | /// </summary> |
| 53 | public class DefinedTerm |
| 54 | { |
| 55 | /// <summary> |
| 56 | /// Type of the defined term. |
| 57 | /// </summary> |
| 58 | [JsonPropertyName("@type")] public string Type { get; set; } = "DefinedTerm"; |
| 59 | |
| 60 | /// <summary> |
| 61 | /// OData type of the defined term. |
| 62 | /// </summary> |
| 63 | [JsonPropertyName("inDefinedTermSet")] public required string InDefinedTermSet { get; set; } |
| 64 | |
| 65 | /// <summary> |
| 66 | /// Gets or sets the name associated with the object. |
| 67 | /// </summary> |
| 68 | [JsonPropertyName("name")] public required string Name { get; set; } |
| 69 | |
| 70 | /// <summary> |
| 71 | /// Gets or sets the code that identifies the academic term. |
| 72 | /// </summary> |
| 73 | [JsonPropertyName("termCode")] public required string TermCode { get; set; } |
| 74 | } |
| 75 | |