microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
docs/update-release-process

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Apps.BotBuilder/CompatTeamsInfo.Models.cs

83lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5using Microsoft.Bot.Schema;
6using Microsoft.Bot.Schema.Teams;
7
8namespace Microsoft.Teams.Apps.BotBuilder;
9
10internal static class TeamsApiClientModels
11{
12 /// <summary>
13 /// Gets the TeamsMeetingInfo object from the current activity.
14 /// </summary>
15 /// <param name="activity">The activity.</param>
16 /// <returns>The current activity's meeting information, or null.</returns>
17 public static TeamsMeetingInfo? TeamsGetMeetingInfo(this IActivity activity)
18 {
19 ArgumentNullException.ThrowIfNull(activity);
20 TeamsChannelData channelData = activity.GetChannelData<Microsoft.Bot.Schema.Teams.TeamsChannelData>();
21 return channelData?.Meeting;
22 }
23
24 internal sealed class SendMessageToUsersRequest
25 {
26 /// <summary>
27 /// Gets or sets the list of members.
28 /// </summary>
29 [JsonPropertyName("members")]
30 public IList<TeamMember>? Members { get; set; }
31
32 /// <summary>
33 /// Gets or sets the activity to send.
34 /// </summary>
35 [JsonPropertyName("activity")]
36 public object? Activity { get; set; }
37
38 /// <summary>
39 /// Gets or sets the tenant ID.
40 /// </summary>
41 [JsonPropertyName("tenantId")]
42 public string? TenantId { get; set; }
43 }
44
45 internal sealed class SendMessageToTeamRequest
46 {
47 /// <summary>
48 /// Gets or sets the activity to send.
49 /// </summary>
50 [JsonPropertyName("activity")]
51 public object? Activity { get; set; }
52
53 /// <summary>
54 /// Gets or sets the team ID.
55 /// </summary>
56 [JsonPropertyName("teamId")]
57 public string? TeamId { get; set; }
58
59 /// <summary>
60 /// Gets or sets the tenant ID.
61 /// </summary>
62 [JsonPropertyName("tenantId")]
63 public string? TenantId { get; set; }
64 }
65
66 /// <summary>
67 /// Request body for sending a message to all users in a tenant.
68 /// </summary>
69 internal sealed class SendMessageToTenantRequest
70 {
71 /// <summary>
72 /// Gets or sets the activity to send.
73 /// </summary>
74 [JsonPropertyName("activity")]
75 public object? Activity { get; set; }
76
77 /// <summary>
78 /// Gets or sets the tenant ID.
79 /// </summary>
80 [JsonPropertyName("tenantId")]
81 public string? TenantId { get; set; }
82 }
83}
84