• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

microsoft / botbuilder-dotnet / 333683

15 Dec 2022 06:25PM UTC coverage: 79.054% (-0.008%) from 79.062%
333683

Pull #6570

CI-PR build

GitHub
Merge 605095e6d into a908ca355
Pull Request #6570: Support bot sdk dot net for targeted meeting notification

25800 of 32636 relevant lines covered (79.05%)

0.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/libraries/Microsoft.Bot.Connector/Teams/TeamsOperationsExtensions.cs
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the MIT License.
3

4
namespace Microsoft.Bot.Connector.Teams
5
{
6
    using System;
7
    using System.Threading;
8
    using System.Threading.Tasks;
9
    using Microsoft.Bot.Schema.Teams;
10

11
    /// <summary>
12
    /// Extension methods for TeamsOperations.
13
    /// </summary>
14
    public static partial class TeamsOperationsExtensions
15
    {
16
        /// <summary>
17
        /// Fetches channel list for a given team.
18
        /// </summary>
19
        /// <param name='operations'>
20
        /// The operations group for this extension method.
21
        /// </param>
22
        /// <param name='teamId'>
23
        /// Team Id.
24
        /// </param>
25
        /// <param name='cancellationToken'>
26
        /// The cancellation token.
27
        /// </param>
28
        /// <returns>The channel list for a given team.</returns>
29
        public static async Task<ConversationList> FetchChannelListAsync(this ITeamsOperations operations, string teamId, CancellationToken cancellationToken = default(CancellationToken))
30
        {
31
            using (var result = await operations.FetchChannelListWithHttpMessagesAsync(teamId, null, cancellationToken).ConfigureAwait(false))
1✔
32
            {
33
                return result.Body;
1✔
34
            }
35
        }
1✔
36

37
        /// <summary>
38
        /// Fetches details related to a team.
39
        /// </summary>
40
        /// <param name='operations'>
41
        /// The operations group for this extension method.
42
        /// </param>
43
        /// <param name='teamId'>
44
        /// Team Id.
45
        /// </param>
46
        /// <param name='cancellationToken'>
47
        /// The cancellation token.
48
        /// </param>
49
        /// <returns>The details related to a team.</returns>
50
        public static async Task<TeamDetails> FetchTeamDetailsAsync(this ITeamsOperations operations, string teamId, CancellationToken cancellationToken = default(CancellationToken))
51
        {
52
            using (var result = await operations.FetchTeamDetailsWithHttpMessagesAsync(teamId, null, cancellationToken).ConfigureAwait(false))
1✔
53
            {
54
                return result.Body;
1✔
55
            }
56
        }
1✔
57

58
        /// <summary>
59
        /// Fetches information related to a Teams meeting.
60
        /// </summary>
61
        /// <param name='operations'>
62
        /// The operations group for this extension method.
63
        /// </param>
64
        /// <param name='meetingId'>
65
        /// Meeting Id.
66
        /// </param>
67
        /// <param name='cancellationToken'>
68
        /// The cancellation token.
69
        /// </param>
70
        /// <returns>The details related to a team.</returns>
71
        public static async Task<MeetingInfo> FetchMeetingInfoAsync(this ITeamsOperations operations, string meetingId, CancellationToken cancellationToken = default(CancellationToken))
72
        {
73
            if (operations is TeamsOperations teamsOperations)
1✔
74
            {
75
                using var result = await teamsOperations.FetchMeetingInfoWithHttpMessagesAsync(meetingId, null, cancellationToken).ConfigureAwait(false);
1✔
76
                return result.Body;
1✔
77
            }
78

79
            throw new InvalidOperationException("TeamsOperations with GetMeetingInfoWithHttpMessagesAsync is required for FetchMeetingInfoAsync.");
×
80
        }
1✔
81

82
        /// <summary>
83
        /// Fetches participant details related to a Teams meeting.
84
        /// </summary>
85
        /// <param name='operations'>
86
        /// The operations group for this extension method.
87
        /// </param>
88
        /// <param name='meetingId'>
89
        /// Team meeting Id.
90
        /// </param>
91
        /// <param name='participantId'>
92
        /// Team meeting participant Id.
93
        /// </param>
94
        /// <param name='tenantId'>
95
        /// Team meeting tenant Id.
96
        /// </param>
97
        /// <param name='cancellationToken'>
98
        /// The cancellation token.
99
        /// </param>
100
        /// <returns>The participant details related to a Teams meeting.</returns>
101
        public static async Task<TeamsMeetingParticipant> FetchParticipantAsync(this ITeamsOperations operations, string meetingId, string participantId, string tenantId, CancellationToken cancellationToken = default(CancellationToken))
102
        {
103
            if (operations is TeamsOperations teamsOperations)
1✔
104
            {
105
                using (var result = await teamsOperations.FetchParticipantWithHttpMessagesAsync(meetingId, participantId, tenantId, null, cancellationToken).ConfigureAwait(false))
1✔
106
                {
107
                    return result.Body;
1✔
108
                }
109
            }
110
            else
111
            {
112
                throw new InvalidOperationException("TeamsOperations with GetParticipantWithHttpMessagesAsync is required for FetchParticipantAsync.");
×
113
            }
114
        }
1✔
115

116
        /// <summary>
117
        /// Sends a notification to participants of a Teams meeting.
118
        /// </summary>
119
        /// <param name='operations'>
120
        /// The operations group for this extension method.
121
        /// </param>
122
        /// <param name='meetingId'>
123
        /// Team meeting Id.
124
        /// </param>
125
        /// <param name='notification'>
126
        /// Team meeting notification.
127
        /// </param>
128
        /// <param name='cancellationToken'>
129
        /// The cancellation token.
130
        /// </param>
131
        /// <returns>Information regarding which participant notifications failed.</returns>
132
        public static async Task<TeamsMeetingNotificationRecipientFailureInfos> SendMeetingNotificationAsync(this ITeamsOperations operations, string meetingId, TeamsMeetingNotification notification, CancellationToken cancellationToken = default(CancellationToken))
133
        {
134
            if (operations is TeamsOperations teamsOperations)
1✔
135
            {
136
                using (var result = await teamsOperations.SendMeetingNotificationMessageAsync(meetingId, notification, null, cancellationToken).ConfigureAwait(false))
1✔
137
                {
138
                    return result.Body;
1✔
139
                }
140
            }
141
            else
142
            {
143
                throw new InvalidOperationException("TeamsOperations with GetParticipantWithHttpMessagesAsync is required for FetchParticipantAsync.");
×
144
            }
145
        }
1✔
146
    }
147
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc