diff --git a/Source/ZoomNet.IntegrationTests/Tests/Reports.cs b/Source/ZoomNet.IntegrationTests/Tests/Reports.cs index 500b5a3d..4fb60010 100644 --- a/Source/ZoomNet.IntegrationTests/Tests/Reports.cs +++ b/Source/ZoomNet.IntegrationTests/Tests/Reports.cs @@ -35,6 +35,18 @@ public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient clie } await log.WriteLineAsync($"There are {pastMeetings.Records.Length} past instances of meetings with a total of {totalParticipants} participants for this user.").ConfigureAwait(false); + + // GET ALL THE WEBINARS + var pastWebinars = await client.Webinars.GetAllAsync(myUser.Id, 30, null, cancellationToken).ConfigureAwait(false); + + totalParticipants = 0; + foreach (var webinar in pastWebinars.Records) + { + var paginatedParticipants = await client.Reports.GetWebinarParticipantsAsync(webinar.Uuid, 30, null, cancellationToken); + totalParticipants += paginatedParticipants.TotalRecords; + } + + await log.WriteLineAsync($"There are {pastWebinars.Records.Length} past instances of webinar with a total of {totalParticipants} participants for this user.").ConfigureAwait(false); } } } diff --git a/Source/ZoomNet.IntegrationTests/ZoomNet.IntegrationTests.csproj b/Source/ZoomNet.IntegrationTests/ZoomNet.IntegrationTests.csproj index 5afa65bf..4a9d71ad 100644 --- a/Source/ZoomNet.IntegrationTests/ZoomNet.IntegrationTests.csproj +++ b/Source/ZoomNet.IntegrationTests/ZoomNet.IntegrationTests.csproj @@ -12,9 +12,9 @@ - + - + diff --git a/Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj b/Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj index 8fa7f1a2..3617cd0f 100644 --- a/Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj +++ b/Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj @@ -12,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Source/ZoomNet/Models/RecurrenceInfo.cs b/Source/ZoomNet/Models/RecurrenceInfo.cs index 8644a258..3052bf83 100644 --- a/Source/ZoomNet/Models/RecurrenceInfo.cs +++ b/Source/ZoomNet/Models/RecurrenceInfo.cs @@ -49,7 +49,7 @@ public class RecurrenceInfo public DayOfWeek? MonthlyWeekDay { get; set; } /// - /// Gets or sets the select how many times the meeting will occur before it is canceled. + /// Gets or sets the number of times the meeting will occur before it is canceled. /// Cannot be used with "end_date_time". /// [JsonPropertyName("end_times")] diff --git a/Source/ZoomNet/Models/ReportWebinarParticipant.cs b/Source/ZoomNet/Models/ReportWebinarParticipant.cs new file mode 100644 index 00000000..64281ebb --- /dev/null +++ b/Source/ZoomNet/Models/ReportWebinarParticipant.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace ZoomNet.Models +{ + /// + /// Metrics of a participant. + /// + public class ReportWebinarParticipant : ReportParticipant + { + /// + /// Gets or sets the RegistrantID of the participant. + /// + /// + /// The RegistrantID of the participant. Only returned if registrant_id is included in the include_fields query parameter. + /// + [JsonPropertyName("registrant_id")] + public string RegistrantId { get; set; } + } +} diff --git a/Source/ZoomNet/Resources/IReports.cs b/Source/ZoomNet/Resources/IReports.cs index a04cf519..37fa813a 100644 --- a/Source/ZoomNet/Resources/IReports.cs +++ b/Source/ZoomNet/Resources/IReports.cs @@ -48,6 +48,22 @@ public interface IReports /// Task> GetMeetingsAsync(string userId, DateTime from, DateTime to, ReportMeetingType type = ReportMeetingType.Past, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default); + /// + /// Get a list of participants from past webinars with two or more participants. To see a list of participants for webinars with one participant use . + /// + /// The webinar ID or webinar UUID. If given the webinar ID it will take the last meeting instance. + /// The number of records returned within a single API call. + /// + /// The next page token is used to paginate through large result sets. + /// A next page token will be returned whenever the set of available results exceeds the current page size. + /// The expiration period for this token is 15 minutes. + /// + /// The cancellation token. + /// + /// An array of participants. + /// + Task> GetWebinarParticipantsAsync(string webinarId, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default); + /// /// Gets active/inactive host reports. /// diff --git a/Source/ZoomNet/Resources/Reports.cs b/Source/ZoomNet/Resources/Reports.cs index 92c72966..15c365b0 100644 --- a/Source/ZoomNet/Resources/Reports.cs +++ b/Source/ZoomNet/Resources/Reports.cs @@ -69,6 +69,20 @@ public Task> GetMeetingsAsync(string use .AsPaginatedResponseWithToken("meetings"); } + /// + public Task> GetWebinarParticipantsAsync(string webinarId, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default) + { + VerifyPageSize(pageSize); + + return _client + .GetAsync($"report/webinars/{webinarId}/participants") + .WithArgument("include_fields", "registrant_id") + .WithArgument("page_size", pageSize) + .WithArgument("next_page_token", pageToken) + .WithCancellationToken(cancellationToken) + .AsPaginatedResponseWithToken("participants"); + } + /// public Task> GetHostsAsync(DateTime from, DateTime to, ReportHostType type = ReportHostType.Active, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default) { diff --git a/Source/ZoomNet/ZoomNet.csproj b/Source/ZoomNet/ZoomNet.csproj index d662b047..a19927d9 100644 --- a/Source/ZoomNet/ZoomNet.csproj +++ b/Source/ZoomNet/ZoomNet.csproj @@ -40,11 +40,11 @@ - + - + - + diff --git a/global.json b/global.json index 6ca92cf8..708ef389 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.102", + "version": "7.0.203", "rollForward": "latestFeature" } } \ No newline at end of file