Skip to content

Commit

Permalink
(GH-186) Get user's security setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Feb 26, 2022
1 parent 2c1ff47 commit 482a8aa
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Source/ZoomNet/Models/AudioConferencingUserSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Newtonsoft.Json;

namespace ZoomNet.Models
{
/// <summary>
/// Audio conferencing user settings.
/// </summary>
public class AudioConferencingUserSettings
{
/// <summary>
/// Gets or sets a value indicating whether a notification is sent when attendees join a meeting before the host.
/// </summary>
[JsonProperty(PropertyName = "jbh_reminder")]
public bool AttendeesJoinBeforeHost { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a notification is sent when a meeting is cancelled.
/// </summary>
[JsonProperty(PropertyName = "cancel_meeting_reminder")]
public bool CancelMeeting { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a notification is sent when an alternative host is set or removed from a meeting.
/// </summary>
[JsonProperty(PropertyName = "alternative_host_reminder")]
public bool ChangeAlternativeHost { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a notification is sent to the host when a meeting is scheduled, rescheduled or cancelled.
/// </summary>
[JsonProperty(PropertyName = "schedule_for_reminder")]
public bool MeetingScheduled { get; set; }
}
}
26 changes: 26 additions & 0 deletions Source/ZoomNet/Models/EncryptionType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace ZoomNet.Models
{
/// <summary>
/// Enumeration to indicate the type of encryption.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum EncryptionType
{
/// <summary>Enhanced encryption.</summary>
/// <remarks>Encryption data is stored in the cloud.</remarks>
[EnumMember(Value = "enhanced_encryption ")]
Enhanced,

/// <summary>End-to-end encryption.</summary>
/// <remarks>
/// The encryption key is stored on the local device and cannot be obtained by anyone else.
/// Enabling end-to-end encryption also disables certain features, such as cloud recording, live streaming, and allowing participants to join before the host.
/// </remarks>
[EnumMember(Value = "e2ee")]
EndToEnd
}
}
101 changes: 101 additions & 0 deletions Source/ZoomNet/Models/SecuritySettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using Newtonsoft.Json;

namespace ZoomNet.Models
{
/// <summary>
/// Security settings.
/// </summary>
public class SecuritySettings
{
/// <summary>
/// Gets or sets a value indicating whether all meetings must be secured with at least one security options.
/// </summary>
[JsonProperty(PropertyName = "auto_security")]
public bool MustBeSecured { get; set; }

/// <summary>
/// Gets or sets a value indicating whether users in specific domains are blocked from joining meetings and webinars.
/// </summary>
[JsonProperty(PropertyName = "block_user_domain")]
public bool EnforceBlockedDomains { get; set; }

/// <summary>
/// Gets or sets the blocked domains.
/// </summary>
[JsonProperty(PropertyName = "block_user_domain_list")]
public string[] BlockedDomains { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the meeting password is encrypted and included in the invitation link.
/// </summary>
[JsonProperty(PropertyName = "embed_password_in_join_link")]
public bool IncludePasswordInJoinLink { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the meeting password is encrypted and included in the invitation link.
/// </summary>
[JsonProperty(PropertyName = "encryption_type")]
public EncryptionType EncryptionType { get; set; }

/// <summary>
/// Gets or sets a value indicating whether end-to-end encryption is enabled.
/// </summary>
[JsonProperty(PropertyName = "end_to_end_encrypted_meetings")]
public bool EndToEndEncryptionEnabled { get; set; }

/// <summary>
/// Gets or sets the password requirements.
/// </summary>
[JsonProperty(PropertyName = "meeting_password_requirement")]
public PasswordRequirements PasswordRequirements { get; set; }

/// <summary>
/// Gets or sets a value indicating whether only authenticated users can join a meeting from the web client.
/// </summary>
[JsonProperty(PropertyName = "only_authenticated_can_join_from_webclient")]
public bool OnlyAuthenticatedCanJoinFromWebclient { get; set; }

/// <summary>
/// Gets or sets a value indicating whether passwords are required for participants joining by phone.
/// </summary>
[JsonProperty(PropertyName = "phone_password")]
public bool PasswordIsRequiredToJoinPhone { get; set; }

/// <summary>
/// Gets or sets a value indicating whether passwords are required for participants joining a Personal Meeting ID meeting.
/// </summary>
[JsonProperty(PropertyName = "pmi_password")]
public bool PasswordIsRequiredToJoinPMI { get; set; }

/// <summary>
/// Gets or sets a value indicating whether passwords are required for participants joining a scheduled meeting.
/// </summary>
[JsonProperty(PropertyName = "require_password_for_scheduled_meeting")]
public bool PasswordIsRequiredToJoinScheduledMeeting { get; set; }

/// <summary>
/// Gets or sets a value indicating whether passwords are required for participants joining a scheduled webinar.
/// </summary>
[JsonProperty(PropertyName = "require_password_for_scheduled_webinar")]
public bool PasswordIsRequiredToJoinScheduledWebinar { get; set; }

/// <summary>
/// Gets or sets a value indicating whether participants are placed in the Waiting Room when they join a meeting.
/// </summary>
[JsonProperty(PropertyName = "waiting_room")]
public bool JoinWaitingRoomBeforeMeeting { get; set; }

/// <summary>
/// Gets or sets the waiting room settings.
/// </summary>
[JsonProperty(PropertyName = "waiting_room_settings")]
public WaitingRoomSettings WaitingRoomSettings { get; set; }

/// <summary>
/// Gets or sets a value indicating whether a password is generated when scheduling webinars.
/// Participants must use the generated password to join the scheduled webinar.
/// </summary>
[JsonProperty(PropertyName = "webinar_password")]
public bool GeneratePasswordForScheduledWebinars { get; set; }
}
}
10 changes: 10 additions & 0 deletions Source/ZoomNet/Resources/IUsers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ public interface IUsers
/// </returns>
Task<AuthenticationSettings> GetRecordingAuthenticationSettingsAsync(string userId, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieve a user's security settings.
/// </summary>
/// <param name="userId">The user Id.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The <see cref="SecuritySettings">settings</see>.
/// </returns>
Task<SecuritySettings> GetSecuritySettingsAsync(string userId, CancellationToken cancellationToken = default);

/// <summary>
/// Deactivate a specific user on a Zoom account.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions Source/ZoomNet/Resources/Users.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,16 @@ public async Task<AuthenticationSettings> GetRecordingAuthenticationSettingsAsyn
return settings;
}

/// <inheritdoc/>
public Task<SecuritySettings> GetSecuritySettingsAsync(string userId, CancellationToken cancellationToken = default)
{
return _client
.GetAsync($"users/{userId}/settings")
.WithArgument("option", "meeting_security")
.WithCancellationToken(cancellationToken)
.AsObject<SecuritySettings>("meeting_security");
}

/// <summary>
/// Deactivate a specific user on a Zoom account.
/// </summary>
Expand Down

0 comments on commit 482a8aa

Please sign in to comment.