Skip to content

Commit

Permalink
Merge branch 'release/0.60.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Apr 15, 2023
2 parents b87050d + e9ed1f9 commit 1297dc3
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 8 deletions.
12 changes: 12 additions & 0 deletions Source/ZoomNet.IntegrationTests/Tests/Reports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Logzio.DotNet.NLog" Version="1.0.13" />
<PackageReference Include="Logzio.DotNet.NLog" Version="1.0.16" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="RichardSzalay.MockHttp" Version="6.0.0" />
<PackageReference Include="Shouldly" Version="4.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Models/RecurrenceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class RecurrenceInfo
public DayOfWeek? MonthlyWeekDay { get; set; }

/// <summary>
/// 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".
/// </summary>
[JsonPropertyName("end_times")]
Expand Down
19 changes: 19 additions & 0 deletions Source/ZoomNet/Models/ReportWebinarParticipant.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;

namespace ZoomNet.Models
{
/// <summary>
/// Metrics of a participant.
/// </summary>
public class ReportWebinarParticipant : ReportParticipant
{
/// <summary>
/// Gets or sets the RegistrantID of the participant.
/// </summary>
/// <value>
/// The RegistrantID of the participant. Only returned if registrant_id is included in the include_fields query parameter.
/// </value>
[JsonPropertyName("registrant_id")]
public string RegistrantId { get; set; }
}
}
16 changes: 16 additions & 0 deletions Source/ZoomNet/Resources/IReports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ public interface IReports
/// </returns>
Task<PaginatedResponseWithToken<PastMeeting>> GetMeetingsAsync(string userId, DateTime from, DateTime to, ReportMeetingType type = ReportMeetingType.Past, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default);

/// <summary>
/// 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 <see cref="IDashboards.GetMeetingParticipantsAsync"/>.
/// </summary>
/// <param name="webinarId">The webinar ID or webinar UUID. If given the webinar ID it will take the last meeting instance.</param>
/// <param name="pageSize">The number of records returned within a single API call.</param>
/// <param name="pageToken">
/// 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.
/// </param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="ReportWebinarParticipant">participants</see>.
/// </returns>
Task<PaginatedResponseWithToken<ReportWebinarParticipant>> GetWebinarParticipantsAsync(string webinarId, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default);

/// <summary>
/// Gets active/inactive host reports.
/// </summary>
Expand Down
14 changes: 14 additions & 0 deletions Source/ZoomNet/Resources/Reports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public Task<PaginatedResponseWithToken<PastMeeting>> GetMeetingsAsync(string use
.AsPaginatedResponseWithToken<PastMeeting>("meetings");
}

/// <inheritdoc/>
public Task<PaginatedResponseWithToken<ReportWebinarParticipant>> 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<ReportWebinarParticipant>("participants");
}

/// <inheritdoc/>
public Task<PaginatedResponseWithToken<ReportHost>> GetHostsAsync(DateTime from, DateTime to, ReportHostType type = ReportHostType.Active, int pageSize = 30, string pageToken = null, CancellationToken cancellationToken = default)
{
Expand Down
6 changes: 3 additions & 3 deletions Source/ZoomNet/ZoomNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
<PackageReference Include="jose-jwt" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.2.0" />
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="7.0.1" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Websocket.Client" Version="4.4.43" />
<PackageReference Include="Websocket.Client" Version="4.6.1" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.102",
"version": "7.0.203",
"rollForward": "latestFeature"
}
}

0 comments on commit 1297dc3

Please sign in to comment.