Skip to content

Commit

Permalink
Merge branch 'release/0.45.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jul 8, 2022
2 parents c547085 + 5204f67 commit 13b0665
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Source/ZoomNet.IntegrationTests/Tests/Meetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient clie
{
Audio = AudioType.Telephony,
RegistrationType = RegistrationType.RegisterOnceAttendAll,
ApprovalType = ApprovalType.Manual
ApprovalType = ApprovalType.Manual,
JoinBeforeHost = true,
JoinBeforeHostTime = JoinBeforeHostTime.FiveMinutes,
};
var trackingFields = new Dictionary<string, string>()
{
Expand Down Expand Up @@ -240,6 +242,13 @@ public async Task RunAsync(User myUser, string[] myPermissions, IZoomClient clie

await client.Meetings.DeleteAsync(newRecurringMeeting.Id, null, false, false, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Recurring meeting {newRecurringMeeting.Id} deleted").ConfigureAwait(false);

// Recurring meeting with no fixed time
var newRecurringNoFixTimeMeeting = await client.Meetings.CreateRecurringMeetingAsync(myUser.Id, "ZoomNet Integration Testing: recurring meeting with no fixed time", "The agenda", start, duration, null, TimeZones.UTC, "p@ss!w0rd", settings, null, null, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Recurring meeting with no fixed time {newRecurringNoFixTimeMeeting.Id} created").ConfigureAwait(false);

await client.Meetings.DeleteAsync(newRecurringNoFixTimeMeeting.Id, null, false, false, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Recurring meeting with no fixed time {newRecurringNoFixTimeMeeting.Id} deleted").ConfigureAwait(false);
}
}
}
27 changes: 27 additions & 0 deletions Source/ZoomNet/Extensions/Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,18 @@ internal static (WeakReference<HttpRequestMessage> RequestReference, string Diag
"code": 300,
"message": "This meeting has not registration required: 544993922"
}
Sometimes, the JSON string contains additional info like this example:
{
"code":300,
"message":"Validation Failed.",
"errors":[
{
"field":"settings.jbh_time",
"message":"Invalid parameter: jbh_time."
}
]
}
*/

var responseContent = await message.Content.ReadAsStringAsync(null).ConfigureAwait(false);
Expand All @@ -639,6 +651,21 @@ internal static (WeakReference<HttpRequestMessage> RequestReference, string Diag
var rootJsonElement = JsonDocument.Parse(responseContent).RootElement;
errorCode = rootJsonElement.TryGetProperty("code", out JsonElement jsonErrorCode) ? (int?)jsonErrorCode.GetInt32() : (int?)null;
errorMessage = rootJsonElement.TryGetProperty("message", out JsonElement jsonErrorMessage) ? jsonErrorMessage.GetString() : (errorCode.HasValue ? $"Error code: {errorCode}" : errorMessage);
if (rootJsonElement.TryGetProperty("errors", out JsonElement jsonErrorDetails))
{
var errorDetails = string.Join(
" ",
jsonErrorDetails
.EnumerateArray()
.Select(jsonErrorDetail =>
{
var errorDetail = jsonErrorDetail.TryGetProperty("message", out JsonElement jsonErrorMessage) ? jsonErrorMessage.GetString() : string.Empty;
return errorDetail;
})
.Where(errorDetail => !string.IsNullOrEmpty(errorDetail)));

if (!string.IsNullOrEmpty(errorDetails)) errorMessage += $" {errorDetails}";
}

isError = errorCode.HasValue;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Models/EncryptionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum EncryptionType
{
/// <summary>Enhanced encryption.</summary>
/// <remarks>Encryption data is stored in the cloud.</remarks>
[EnumMember(Value = "enhanced_encryption ")]
[EnumMember(Value = "enhanced_encryption")]
Enhanced,

/// <summary>End-to-end encryption.</summary>
Expand Down
23 changes: 23 additions & 0 deletions Source/ZoomNet/Models/JoinBeforeHostTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace ZoomNet.Models
{
/// <summary>
/// Enumeration to indicate the time limits within which a participant can join a meeting before the meeting's host.
/// </summary>
public enum JoinBeforeHostTime
{
/// <summary>
/// Participants are allowed to join the meeting at anytime.
/// </summary>
Anytime = 0,

/// <summary>
/// Participants are allowed to join the meeting 5 minutes before the meeting's start time.
/// </summary>
FiveMinutes = 5,

/// <summary>
/// Participants are allowed to join the meeting 10 minutes before the meeting's start time.
/// </summary>
TenMinutes = 10,
}
}
7 changes: 7 additions & 0 deletions Source/ZoomNet/Models/MeetingSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ public class MeetingSettings
[Obsolete("Deprecated")]
public bool? HostInIndia { get; set; }

/// <summary>
/// Gets or sets the time limits within which a participant can join a meeting before the meeting's host.
/// </summary>
/// <remarks>This value is applicable only if <see cref="JoinBeforeHost"/> is true.</remarks>
[JsonPropertyName("jbh_time")]
public JoinBeforeHostTime? JoinBeforeHostTime { get; set; }

/// <summary>
/// Gets or sets the value indicating whether participants can join the meeting before the host starts the meeting. Only used for scheduled or recurring meetings.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Resources/Meetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public Task<RecurringMeeting> CreateRecurringMeetingAsync(
{
var data = new JsonObject
{
{ "type", start.HasValue ? 8 : 3 }, // 8 = Recurring with fixed time. 3 = Recurring with no fixed time.
{ "type", recurrence == null ? MeetingType.RecurringNoFixedTime : MeetingType.RecurringFixedTime },
{ "topic", topic },
{ "password", password },
{ "agenda", agenda },
Expand Down

0 comments on commit 13b0665

Please sign in to comment.