Skip to content

Commit

Permalink
Merge branch 'feature/meeting_getall_returns_summary' into develop
Browse files Browse the repository at this point in the history
Resolves #223
  • Loading branch information
Jericho committed Jun 30, 2022
2 parents cb6f145 + 8eb0fc1 commit 036b391
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 65 deletions.
1 change: 1 addition & 0 deletions Source/ZoomNet.IntegrationTests/Tests/Meetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient clie
// CLEANUP PREVIOUS INTEGRATION TESTS THAT MIGHT HAVE BEEN INTERRUPTED BEFORE THEY HAD TIME TO CLEANUP AFTER THEMSELVES
var cleanUpTasks = paginatedScheduledMeetings.Records
.Union(paginatedLiveMeetings.Records)
.Union(paginatedUpcomingMeetings.Records)
.Where(m => m.Topic.StartsWith("ZoomNet Integration Testing:"))
.Select(async oldMeeting =>
{
Expand Down
1 change: 0 additions & 1 deletion Source/ZoomNet.IntegrationTests/Tests/Webinars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient clie

// CLEANUP PREVIOUS INTEGRATION TESTS THAT MIGHT HAVE BEEN INTERRUPTED BEFORE THEY HAD TIME TO CLEANUP AFTER THEMSELVES
var cleanUpTasks = paginatedWebinars.Records
.Union(paginatedWebinars.Records)
.Where(m => m.Topic.StartsWith("ZoomNet Integration Testing:"))
.Select(async oldWebinar =>
{
Expand Down
89 changes: 89 additions & 0 deletions Source/ZoomNet/Models/MeetingSummary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System;
using System.Text.Json.Serialization;

namespace ZoomNet.Models
{
/// <summary>
/// Summary information about a meeting.
/// </summary>
public class MeetingSummary
{
/// <summary>Gets or sets the meeting description.</summary>
/// <remarks>
/// The length of agenda gets truncated to 250 characters
/// when you list all meetings for a user. To view the complete
/// agenda of a meeting, retrieve details for a single meeting,
/// use the Get a meeting API.
/// </remarks>
[JsonPropertyName("agenda")]
public string Agenda { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting was created.
/// </summary>
[JsonPropertyName("created_at")]
public DateTime CreatedOn { get; set; }

/// <summary>
/// Gets or sets the duration in minutes.
/// </summary>
[JsonPropertyName("duration")]
public int Duration { get; set; }

/// <summary>
/// Gets or sets the ID of the user who is set as the host of the meeting.
/// </summary>
[JsonPropertyName("host_id")]
public string HostId { get; set; }

/// <summary>
/// Gets or sets the meeting id, also known as the meeting number.
/// </summary>
[JsonPropertyName("id")]
public long Id { get; set; }

/// <summary>
/// Gets or sets the URL for the host to start the meeting.
/// </summary>
[JsonPropertyName("start_url")]
public string StartUrl { get; set; }

/// <summary>
/// Gets or sets the personal meeting id.
/// </summary>
[JsonPropertyName("pmi")]
public string PersonalMeetingId { get; set; }

/// <summary>
/// Gets or sets the start time.
/// </summary>
[JsonPropertyName("start_time")]
public DateTime StartTime { get; set; }

/// <summary>
/// Gets or sets the timezone.
/// For example, "America/Los_Angeles".
/// Please reference our <a href="https://marketplace.zoom.us/docs/api-reference/other-references/abbreviation-lists#timezones">timezone list</a> for supported timezones and their formats.
/// </summary>
[JsonPropertyName("timezone")]
public string Timezone { get; set; }

/// <summary>
/// Gets or sets the topic of the meeting.
/// </summary>
[JsonPropertyName("topic")]
public string Topic { get; set; }

/// <summary>
/// Gets or sets the meeting type.
/// </summary>
[JsonPropertyName("type")]
public MeetingType Type { get; set; }

/// <summary>
/// Gets or sets the unique id.
/// </summary>
[JsonPropertyName("uuid")]
public string Uuid { get; set; }
}
}
98 changes: 98 additions & 0 deletions Source/ZoomNet/Models/WebinarSummary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System;
using System.Text.Json.Serialization;

namespace ZoomNet.Models
{
/// <summary>
/// Summary information about a webinar.
/// </summary>
public class WebinarSummary
{
/// <summary>
/// Gets or sets the webinar agenda.
/// </summary>
/// <value>The agenda.</value>
[JsonPropertyName("agenda")]
public string Agenda { get; set; }

/// <summary>
/// Gets or sets the date and time when the meeting was created.
/// </summary>
/// <value>The meeting created time.</value>
[JsonPropertyName("created_at")]
public DateTime CreatedOn { get; set; }

/// <summary>
/// Gets or sets the duration in minutes.
/// </summary>
/// <value>The duration in minutes.</value>
[JsonPropertyName("duration")]
public int Duration { get; set; }

/// <summary>
/// Gets or sets the ID of the user who is set as the host of the webinar.
/// </summary>
/// <value>
/// The user id.
/// </value>
[JsonPropertyName("host_id")]
public string HostId { get; set; }

/// <summary>
/// Gets or sets the webinar id, also known as the webinar number.
/// </summary>
/// <value>
/// The id.
/// </value>
[JsonPropertyName("id")]
public long Id { get; set; }

/// <summary>
/// Gets or sets the URL to join the webinar.
/// </summary>
/// <value>The join URL.</value>
[JsonPropertyName("join_url")]
public string JoinUrl { get; set; }

/// <summary>
/// Gets or sets the webinar start time.
/// </summary>
/// <value>The webinar start time.</value>
[JsonPropertyName("start_time")]
public DateTime StartTime { get; set; }

/// <summary>
/// Gets or sets the timezone.
/// For example, "America/Los_Angeles".
/// Please reference our <a href="https://marketplace.zoom.us/docs/api-reference/other-references/abbreviation-lists#timezones">timezone list</a> for supported timezones and their formats.
/// </summary>
/// <value>The webinar timezone. For example, "America/Los_Angeles". Please reference our <a href="https://marketplace.zoom.us/docs/api-reference/other-references/abbreviation-lists#timezones">timezone list</a> for supported timezones and their formats.</value>
[JsonPropertyName("timezone")]
public string Timezone { get; set; }

/// <summary>
/// Gets or sets the topic of the meeting.
/// </summary>
/// <value>
/// The topic.
/// </value>
[JsonPropertyName("topic")]
public string Topic { get; set; }

/// <summary>
/// Gets or sets the webinar type.
/// </summary>
/// <value>The webinar type.</value>
[JsonPropertyName("type")]
public WebinarType Type { get; set; }

/// <summary>
/// Gets or sets the unique id.
/// </summary>
/// <value>
/// The unique id.
/// </value>
[JsonPropertyName("uuid")]
public string Uuid { get; set; }
}
}
16 changes: 8 additions & 8 deletions Source/ZoomNet/Resources/IMeetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ namespace ZoomNet.Resources
public interface IMeetings
{
/// <summary>
/// Retrieve all meetings of the specified type for a user.
/// Retrieve summary information about all meetings of the specified type for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="type">The type of meetings. Allowed values: Scheduled, Live, Upcoming.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="page">The current page number of returned records.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Meeting">meetings</see>.
/// An array of <see cref="MeetingSummary">meeting summaries</see>.
/// </returns>
/// <remarks>
/// This call omits 'occurrences'. Therefore the 'Occurrences' property will be empty.
/// To obtain the full details about a given meeting you must invoke <see cref="Meetings.GetAsync(long, string, CancellationToken)"/>.
/// </remarks>
[Obsolete("Zoom is in the process of deprecating the \"page number\" and \"page count\" fields.")]
Task<PaginatedResponse<Meeting>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default);
Task<PaginatedResponse<MeetingSummary>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieve all meetings of the specified type for a user.
/// Retrieve summary information about all meetings of the specified type for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="type">The type of meetings. Allowed values: Scheduled, Live, Upcoming.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="pagingToken">The paging token.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Meeting">meetings</see>.
/// An array of <see cref="MeetingSummary">meeting summaries</see>.
/// </returns>
/// <remarks>
/// This call omits 'occurrences'. Therefore the 'Occurrences' property will be empty.
/// To obtain the full details about a given meeting you must invoke <see cref="Meetings.GetAsync(long, string, CancellationToken)"/>.
/// </remarks>
Task<PaginatedResponseWithToken<Meeting>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default);
Task<PaginatedResponseWithToken<MeetingSummary>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default);

/// <summary>
/// Creates an instant meeting for a user.
Expand Down
18 changes: 12 additions & 6 deletions Source/ZoomNet/Resources/IWebinars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,35 @@ namespace ZoomNet.Resources
public interface IWebinars
{
/// <summary>
/// Retrieve all webinars for a user.
/// Retrieve summary information about all webinars for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="page">The current page number of returned records.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Webinar">webinars</see>.
/// An array of <see cref="WebinarSummary">webinar summaries</see>.
/// </returns>
/// <remarks>
/// To obtain the full details about a given webinar you must invoke <see cref="Webinars.GetAsync(long, string, CancellationToken)"/>.
/// </remarks>
[Obsolete("Zoom is in the process of deprecating the \"page number\" and \"page count\" fields.")]
Task<PaginatedResponse<Webinar>> GetAllAsync(string userId, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default);
Task<PaginatedResponse<WebinarSummary>> GetAllAsync(string userId, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieve all webinars for a user.
/// Retrieve summary information about all webinars for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="pagingToken">The paging token.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Webinar">webinars</see>.
/// An array of <see cref="WebinarSummary">webinar summaries</see>.
/// </returns>
Task<PaginatedResponseWithToken<Webinar>> GetAllAsync(string userId, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default);
/// <remarks>
/// To obtain the full details about a given webinar you must invoke <see cref="Webinars.GetAsync(long, string, CancellationToken)"/>.
/// </remarks>
Task<PaginatedResponseWithToken<WebinarSummary>> GetAllAsync(string userId, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default);

/// <summary>
/// Creates a scheduled webinar for a user.
Expand Down
32 changes: 6 additions & 26 deletions Source/ZoomNet/Resources/Meetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,9 @@ internal Meetings(Pathoschild.Http.Client.IClient client)
_client = client;
}

/// <summary>
/// Retrieve all meetings of the specified type for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="type">The type of meetings. Allowed values: Scheduled, Live, Upcoming.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="page">The current page number of returned records.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Meeting" />.
/// </returns>
/// <inheritdoc/>
[Obsolete("Zoom is in the process of deprecating the \"page number\" and \"page count\" fields.")]
public Task<PaginatedResponse<Meeting>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default)
public Task<PaginatedResponse<MeetingSummary>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, int page = 1, CancellationToken cancellationToken = default)
{
if (recordsPerPage < 1 || recordsPerPage > 300)
{
Expand All @@ -54,21 +44,11 @@ public Task<PaginatedResponse<Meeting>> GetAllAsync(string userId, MeetingListTy
.WithArgument("page_size", recordsPerPage)
.WithArgument("page_number", page)
.WithCancellationToken(cancellationToken)
.AsPaginatedResponse<Meeting>("meetings");
.AsPaginatedResponse<MeetingSummary>("meetings");
}

/// <summary>
/// Retrieve all meetings of the specified type for a user.
/// </summary>
/// <param name="userId">The user Id or email address.</param>
/// <param name="type">The type of meetings. Allowed values: Scheduled, Live, Upcoming.</param>
/// <param name="recordsPerPage">The number of records returned within a single API call.</param>
/// <param name="pagingToken">The paging token.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An array of <see cref="Meeting" />.
/// </returns>
public Task<PaginatedResponseWithToken<Meeting>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default)
/// <inheritdoc/>
public Task<PaginatedResponseWithToken<MeetingSummary>> GetAllAsync(string userId, MeetingListType type = MeetingListType.Scheduled, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default)
{
if (recordsPerPage < 1 || recordsPerPage > 300)
{
Expand All @@ -81,7 +61,7 @@ public Task<PaginatedResponseWithToken<Meeting>> GetAllAsync(string userId, Meet
.WithArgument("page_size", recordsPerPage)
.WithArgument("next_page_token", pagingToken)
.WithCancellationToken(cancellationToken)
.AsPaginatedResponseWithToken<Meeting>("meetings");
.AsPaginatedResponseWithToken<MeetingSummary>("meetings");
}

/// <summary>
Expand Down
Loading

0 comments on commit 036b391

Please sign in to comment.