-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,832 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using ZoomNet.Models; | ||
|
||
namespace ZoomNet.IntegrationTests.Tests | ||
{ | ||
public class Webinars : IIntegrationTest | ||
{ | ||
public async Task RunAsync(string userId, IZoomClient client, TextWriter log, CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) return; | ||
|
||
await log.WriteLineAsync("\n***** WEBINARS *****\n").ConfigureAwait(false); | ||
|
||
// GET ALL THE WEBINARS | ||
var paginatedWebinars = await client.Webinars.GetAllAsync(userId, 30, 1, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"There are {paginatedWebinars.TotalRecords} webinars for user {userId}").ConfigureAwait(false); | ||
|
||
// 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 => | ||
{ | ||
await client.Webinars.DeleteAsync(oldWebinar.Id, null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Webinar {oldWebinar.Id} deleted").ConfigureAwait(false); | ||
await Task.Delay(250, cancellationToken).ConfigureAwait(false); // Brief pause to ensure Zoom has time to catch up | ||
}); | ||
await Task.WhenAll(cleanUpTasks).ConfigureAwait(false); | ||
|
||
var settings = new WebinarSettings() | ||
{ | ||
ApprovalType = MeetingApprovalType.Manual | ||
}; | ||
var trackingFields = new Dictionary<string, string>() | ||
{ | ||
{ "field1", "value1"}, | ||
{ "field2", "value2"} | ||
}; | ||
|
||
// Scheduled webinar | ||
var start = DateTime.UtcNow.AddMonths(1); | ||
var duration = 30; | ||
var newScheduledWebinar = await client.Webinars.CreateScheduledWebinarAsync(userId, "ZoomNet Integration Testing: scheduled webinar", "The agenda", start, duration, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Scheduled webinar {newScheduledWebinar.Id} created").ConfigureAwait(false); | ||
|
||
await client.Webinars.DeleteAsync(newScheduledWebinar.Id, null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Scheduled webinar {newScheduledWebinar.Id} deleted").ConfigureAwait(false); | ||
|
||
// Recurring webinar | ||
var recurrenceInfo = new RecurrenceInfo() | ||
{ | ||
EndTimes = 2, | ||
WeeklyDays = new[] { DayOfWeek.Monday, DayOfWeek.Friday }, | ||
Type = RecurrenceType.Weekly | ||
}; | ||
var newRecurringWebinar = await client.Webinars.CreateRecurringWebinarAsync(userId, "ZoomNet Integration Testing: recurring webinar", "The agenda", start, duration, recurrenceInfo, "p@ss!w0rd", settings, trackingFields, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Recurring webinar {newRecurringWebinar.Id} created").ConfigureAwait(false); | ||
|
||
await client.Webinars.DeleteAsync(newRecurringWebinar.Id, null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Recurring webinar {newRecurringWebinar.Id} deleted").ConfigureAwait(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Panelist. | ||
/// </summary> | ||
public class Panelist | ||
{ | ||
/// <summary> | ||
/// Gets or sets the panelist id. | ||
/// </summary> | ||
/// <value> | ||
/// The id. | ||
/// </value> | ||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the panelist's email address. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "email")] | ||
public string Email { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the panelist's full name. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "name")] | ||
public string FullName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the panelist's join URL. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "join_url")] | ||
public string JoinUrl { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Enumeration to indicate where the audio recording is saved. | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum RecordingType | ||
{ | ||
/// <summary> | ||
/// Record on local. | ||
/// </summary> | ||
[EnumMember(Value = "local")] | ||
OnLocal, | ||
|
||
/// <summary> | ||
/// Record on cloud. | ||
/// </summary> | ||
[EnumMember(Value = "cloud")] | ||
OnCloud, | ||
|
||
/// <summary> | ||
/// Do not record. | ||
/// </summary> | ||
[EnumMember(Value = "none")] | ||
Disabled | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// A meeting. | ||
/// </summary> | ||
/// <seealso cref="ZoomNet.Models.Webinar" /> | ||
public class RecurringWebinar : Webinar | ||
{ | ||
/// <summary> | ||
/// Gets or sets the occurrences. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "occurrences", NullValueHandling = NullValueHandling.Ignore)] | ||
public MeetingOccurrence[] Occurrences { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the recurrence info. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "recurrence", NullValueHandling = NullValueHandling.Ignore)] | ||
public RecurrenceInfo RecurrenceInfo { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// A scheduled webinar. | ||
/// </summary> | ||
/// <seealso cref="ZoomNet.Models.Webinar" /> | ||
public class ScheduledWebinar : Webinar | ||
{ | ||
/// <summary> | ||
/// Gets or sets the webinar start time. | ||
/// </summary> | ||
/// <value>The webinar start time.</value> | ||
[JsonProperty(PropertyName = "start_time", NullValueHandling = NullValueHandling.Ignore)] | ||
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> | ||
[JsonProperty(PropertyName = "timezone", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Timezone { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Tracking Source. | ||
/// </summary> | ||
public class TrackingSource | ||
{ | ||
/// <summary> | ||
/// Gets or sets the unique identifier. | ||
/// </summary> | ||
/// <value> | ||
/// The id. | ||
/// </value> | ||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the name of the source (platform) where the registration URL was shared. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "source_name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the URL that was shared for the registration. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "tracking_url")] | ||
public string TrackingUrl { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the number of visitors who visited the registration page from this source. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "visitor_count")] | ||
public long VisitorCount { get; set; } | ||
} | ||
} |
Oops, something went wrong.