microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
mehak/state

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Apps/Schema/Entities/ClientInfoEntity.cs

75lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5
6namespace Microsoft.Teams.Apps.Schema.Entities;
7
8/// <summary>
9/// Client info entity.
10/// </summary>
11public class ClientInfoEntity : Entity
12{
13 /// <summary>
14 /// Creates a new instance of <see cref="ClientInfoEntity"/>.
15 /// </summary>
16 public ClientInfoEntity() : base("clientInfo")
17 {
18 }
19
20
21 /// <summary>
22 /// Initializes a new instance of the <see cref="ClientInfoEntity"/> class with specified client information.
23 /// </summary>
24 /// <param name="platform">The platform identifier (e.g., "web", "desktop", "mobile").</param>
25 /// <param name="country">The country code (e.g., "US", "GB").</param>
26 /// <param name="timezone">The time zone identifier (e.g., "America/New_York").</param>
27 /// <param name="locale">The locale identifier (e.g., "en-US", "fr-FR").</param>
28 public ClientInfoEntity(string platform, string country, string timezone, string locale) : base("clientInfo")
29 {
30 Locale = locale;
31 Country = country;
32 Platform = platform;
33 Timezone = timezone;
34 }
35
36 /// <summary>
37 /// Gets or sets the locale information.
38 /// </summary>
39 [JsonPropertyName("locale")]
40 public string? Locale
41 {
42 get => base.Properties.TryGetValue("locale", out object? value) ? value?.ToString() : null;
43 set => base.Properties["locale"] = value;
44 }
45
46 /// <summary>
47 /// Gets or sets the country information.
48 /// </summary>
49 [JsonPropertyName("country")]
50 public string? Country
51 {
52 get => base.Properties.TryGetValue("country", out object? value) ? value?.ToString() : null;
53 set => base.Properties["country"] = value;
54 }
55
56 /// <summary>
57 /// Gets or sets the platform information.
58 /// </summary>
59 [JsonPropertyName("platform")]
60 public string? Platform
61 {
62 get => base.Properties.TryGetValue("platform", out object? value) ? value?.ToString() : null;
63 set => base.Properties["platform"] = value;
64 }
65
66 /// <summary>
67 /// Gets or sets the timezone information.
68 /// </summary>
69 [JsonPropertyName("timezone")]
70 public string? Timezone
71 {
72 get => base.Properties.TryGetValue("timezone", out object? value) ? value?.ToString() : null;
73 set => base.Properties["timezone"] = value;
74 }
75}
76