Skip to content

Commit

Permalink
Add templateId to CreateRecurringWebinarAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Crouch authored and Simon Crouch committed Feb 9, 2021
1 parent aacc3db commit 3b0723a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Source/ZoomNet/Resources/IWebinars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ public interface IWebinars
/// <param name="password">Password to join the webinar. Password may only contain the following characters: [a-z A-Z 0-9 @ - _ *]. Max of 10 characters.</param>
/// <param name="settings">Webinar settings.</param>
/// <param name="trackingFields">Tracking fields.</param>
/// <param name="templateId">Template Identifer. If passed in, Zoom advise using the userId in the <paramref name="userId"/> field, rather than email address.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The new webinar.
/// </returns>
/// <exception cref="System.Exception">Thrown when an exception occured while creating the webinar.</exception>
Task<RecurringWebinar> CreateRecurringWebinarAsync(string userId, string topic, string agenda, DateTime? start, int duration, RecurrenceInfo recurrence, string password = null, WebinarSettings settings = null, IDictionary<string, string> trackingFields = null, CancellationToken cancellationToken = default);
Task<RecurringWebinar> CreateRecurringWebinarAsync(string userId, string topic, string agenda, DateTime? start, int duration, RecurrenceInfo recurrence, string password = null, WebinarSettings settings = null, IDictionary<string, string> trackingFields = null, string templateId = null, CancellationToken cancellationToken = default);

/// <summary>
/// Update the details of a webinar occurrence.
Expand Down
4 changes: 3 additions & 1 deletion Source/ZoomNet/Resources/Webinars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@ public Task<ScheduledWebinar> CreateScheduledWebinarAsync(string userId, string
/// <param name="password">Password to join the webinar. By default the password may only contain the following characters: [a-z A-Z 0-9 @ - _ *]. Max of 10 characters. This can be updated within Zoom account settings.</param>
/// <param name="settings">Webinar settings.</param>
/// <param name="trackingFields">Tracking fields.</param>
/// <param name="templateId">Template Identifer. If passed in, Zoom advise using the userId in the <paramref name="userId"/> field, rather than email address.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The new webinar.
/// </returns>
/// <exception cref="System.Exception">Thrown when an exception occured while creating the webinar.</exception>
public Task<RecurringWebinar> CreateRecurringWebinarAsync(string userId, string topic, string agenda, DateTime? start, int duration, RecurrenceInfo recurrence, string password = null, WebinarSettings settings = null, IDictionary<string, string> trackingFields = null, CancellationToken cancellationToken = default)
public Task<RecurringWebinar> CreateRecurringWebinarAsync(string userId, string topic, string agenda, DateTime? start, int duration, RecurrenceInfo recurrence, string password = null, WebinarSettings settings = null, IDictionary<string, string> trackingFields = null, string templateId = null, CancellationToken cancellationToken = default)
{
var data = new JObject()
{
Expand All @@ -156,6 +157,7 @@ public Task<RecurringWebinar> CreateRecurringWebinarAsync(string userId, string
data.AddPropertyIfValue("timezone", "UTC");
data.AddPropertyIfValue("settings", settings);
data.AddPropertyIfValue("tracking_fields", trackingFields?.Select(tf => new JObject() { { "field", tf.Key }, { "value", tf.Value } }));
data.AddPropertyIfValue("template_id", templateId);

return _client
.PostAsync($"users/{userId}/webinars")
Expand Down

0 comments on commit 3b0723a

Please sign in to comment.