-
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.
Additional methods on the Users resource
Resolves #186
- Loading branch information
Showing
48 changed files
with
1,445 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using ZoomNet.Models; | ||
|
@@ -14,26 +13,28 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca | |
|
||
await log.WriteLineAsync("\n***** USERS *****\n").ConfigureAwait(false); | ||
|
||
// GET ALL THE USERS | ||
var paginatedUsers = await client.Users.GetAllAsync(UserStatus.Active, null, 100, (string)null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"There are {paginatedUsers.Records.Length} users").ConfigureAwait(false); | ||
|
||
// CLEANUP PREVIOUS INTEGRATION TESTS THAT MIGHT HAVE BEEN INTERRUPTED BEFORE THEY HAD TIME TO CLEANUP AFTER THEMSELVES | ||
var cleanUpTasks = paginatedUsers.Records | ||
.Where(m => m.FirstName == "ZoomNet" && m.LastName == "Integration Testing") | ||
.Select(async oldUser => | ||
{ | ||
await client.Users.DeleteAsync(oldUser.Id, null, false, false, false, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"User {oldUser.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); | ||
|
||
// GET MY USER | ||
var myUser = await client.Users.GetCurrentAsync(cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"My user retrieved. My email address is {myUser.Email}").ConfigureAwait(false); | ||
await Task.Delay(500, cancellationToken).ConfigureAwait(false); | ||
|
||
// UPDATE MY USER | ||
await client.Users.UpdateAsync(myUser.Id, | ||
firstName: "Hello", | ||
lastName: "World", | ||
company: "Microsoft", | ||
department: "Accounting", | ||
jobTitle: "CFO", | ||
location: "3rd floor", | ||
manager: "Bob", | ||
phoneNumbers: new[] | ||
{ | ||
new UserPhoneNumber { Country = Country.Canada, CountryCode = "+1", Number = "555-555-1234", Type = UserPhoneType.Office } | ||
}, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync("My user was updated").ConfigureAwait(false); | ||
await Task.Delay(500, cancellationToken).ConfigureAwait(false); | ||
|
||
// GET MY ASSISTANTS | ||
var myAssistants = await client.Users.GetAssistantsAsync(myUser.Id, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"My user has {myAssistants.Length} assistants").ConfigureAwait(false); | ||
|
@@ -58,18 +59,9 @@ public async Task RunAsync(string userId, IZoomClient client, TextWriter log, Ca | |
await Task.Delay(500, cancellationToken).ConfigureAwait(false); | ||
|
||
// GET MY PERMISSIONS | ||
var myPermissions = await client.Users.GetPermissionsAsync(myUser.Id, cancellationToken).ConfigureAwait(false); | ||
var myPermissions = await client.Users.GetPermissionsAsync("me", cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"My permissions retrieved: I have been granted {myPermissions.Length} permissions").ConfigureAwait(false); | ||
//await Task.Delay(500, cancellationToken).ConfigureAwait(false); | ||
|
||
// CREATE NEW USER (commenting out this integration test because I currently do not have permission to create users) | ||
//var newUser = await client.Users.CreateAsync("[email protected]", "ZoomNet", "Integration Testing", null, UserType.Basic, UserCreateType.Normal, cancellationToken).ConfigureAwait(false); | ||
//await log.WriteLineAsync($"New user created: {newUser.Id}").ConfigureAwait(false); | ||
//await Task.Delay(500, cancellationToken).ConfigureAwait(false); | ||
|
||
// DELETE USER | ||
//await client.Users.DeleteAsync(newUser.Id, null, false, false, false, cancellationToken).ConfigureAwait(false); | ||
//await log.WriteLineAsync($"User {newUser.Id} deleted").ConfigureAwait(false); | ||
await Task.Delay(500, cancellationToken).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Enumeration to indicate if a attendee is allowed to save webinar chats. | ||
/// </summary> | ||
public enum AttendeeChatSaveType | ||
{ | ||
/// <summary> The attendee cannot save chat.</summary> | ||
Disallowed = 1, | ||
|
||
/// <summary>The attendee can only save host and panelist chats.</summary> | ||
HostAndPanelists = 2, | ||
|
||
/// <summary>Attendees can save all webinar chats.</summary> | ||
All = 3 | ||
} | ||
} |
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,17 @@ | ||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Enumeration to indicate the groups a given attendee can chat with. | ||
/// </summary> | ||
public enum AttendeeChatType | ||
{ | ||
/// <summary> The attendee cannot use chat.</summary> | ||
Disallowed = 1, | ||
|
||
/// <summary>Attendee can chat with Host and panelists only.</summary> | ||
HostAndPanelists = 2, | ||
|
||
/// <summary>The attendee can chat with everyone.</summary> | ||
Everyone = 3 | ||
} | ||
} |
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; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// A user's Tol=free and fee-base toll call settings. | ||
/// </summary> | ||
public class AudioConferencingCallSettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets a value indicating whether webinar attendees can dial in through the account's Toll-free and Fee-based Toll Call phone numbers. | ||
/// </summary> | ||
/// <remarks> | ||
/// This feature is only available in version 5.2.2 and higher. | ||
/// </remarks> | ||
[JsonProperty(PropertyName = "allow_webinar_attendees_dial")] | ||
public bool WebinarAttendeesCanDialIn { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the user has the Toll-free and Fee-based Toll Call setting enabled. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "enable")] | ||
public bool Enabled { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's Toll-free and Fee-based Toll Call phone number information. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "numbers")] | ||
public AudioConferencingPhoneNumberInformation[] Numbers { get; set; } | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Source/ZoomNet/Models/AudioConferencingPhoneNumberInformation.cs
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,40 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Toll-free and Fee-based Toll Call phone number information. | ||
/// </summary> | ||
public class AudioConferencingPhoneNumberInformation | ||
{ | ||
/// <summary> | ||
/// Gets or sets the phone number's E.164 country calling code. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "code")] | ||
public string CallingCode { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the phone number's E.164 country calling code. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "country_code")] | ||
public Country CountryCode { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the name of the country. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "country_name")] | ||
public string CountryName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the phone number display number. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "display_number")] | ||
public string DisplayNumber { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the phone number. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "number")] | ||
public string Number { 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
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,30 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Closed captioning settings. | ||
/// </summary> | ||
public class ClosedCaptioningSettings | ||
{ | ||
/// <summary>Gets or sets a value indicating whether to allow a live transcription service to transcribe meetings.</summary> | ||
[JsonProperty(PropertyName = "auto_transcribing")] | ||
public bool AllowAutoTranscription { get; set; } | ||
|
||
/// <summary>Gets or sets a value indicating whether to allow the host to type closed captions or assign a participant or 3rd-party service to provide closed captioning.</summary> | ||
[JsonProperty(PropertyName = "enable")] | ||
public bool Enabled { get; set; } | ||
|
||
/// <summary>Gets or sets a value indicating whether to allow participants to save closed captions or transcripts.</summary> | ||
[JsonProperty(PropertyName = "save_caption")] | ||
public bool AllowParticipantsToSave { get; set; } | ||
|
||
/// <summary>Gets or sets a value indicating whether to allow the use of an API token to integrate with 3rd-party closed captioning services.</summary> | ||
[JsonProperty(PropertyName = "third_party_captioning_service")] | ||
public bool AllowThirdPartyCaptioningService { get; set; } | ||
|
||
/// <summary>Gets or sets a value indicating whether to allow the viewing of full transcripts in the in-meeting side panel.</summary> | ||
[JsonProperty(PropertyName = "view_full_transcript")] | ||
public bool AllowFullTranscriptViewing { 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,31 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Enumeration to indicate the type of concurrent meeting. | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum ConcurrentMeetingType | ||
{ | ||
/// <summary> | ||
/// Basic. | ||
/// </summary> | ||
[EnumMember(Value = "Basic")] | ||
Basic, | ||
|
||
/// <summary> | ||
/// Plus. | ||
/// </summary> | ||
[EnumMember(Value = "Plus")] | ||
Plus, | ||
|
||
/// <summary> | ||
/// None. | ||
/// </summary> | ||
[EnumMember(Value = "None")] | ||
None | ||
} | ||
} |
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,69 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
|
||
namespace ZoomNet.Models | ||
{ | ||
/// <summary> | ||
/// Data center region. | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum DataCenterRegion | ||
{ | ||
/// <summary>Europe</summary> | ||
[EnumMember(Value = "EU")] | ||
Europe, | ||
|
||
/// <summary>Hong Kong</summary> | ||
[EnumMember(Value = "HK")] | ||
HongKong, | ||
|
||
/// <summary>Australia</summary> | ||
[EnumMember(Value = "AU")] | ||
Australia, | ||
|
||
/// <summary>India</summary> | ||
[EnumMember(Value = "IN")] | ||
India, | ||
|
||
/// <summary>Latin America</summary> | ||
[EnumMember(Value = "LA")] | ||
LatinAmerica, | ||
|
||
/// <summary>Tokyo</summary> | ||
[EnumMember(Value = "TY")] | ||
Tokyo, | ||
|
||
/// <summary>China</summary> | ||
[EnumMember(Value = "CN")] | ||
China, | ||
|
||
/// <summary>United States of America</summary> | ||
[EnumMember(Value = "US")] | ||
UnitedStatesOfAmerica, | ||
|
||
/// <summary>Canada</summary> | ||
[EnumMember(Value = "CA")] | ||
Canada, | ||
|
||
/// <summary>Canada</summary> | ||
[EnumMember(Value = "DE")] | ||
Germany, | ||
|
||
/// <summary>Canada</summary> | ||
[EnumMember(Value = "NL")] | ||
Netherlands, | ||
|
||
/// <summary>Mexico</summary> | ||
[EnumMember(Value = "MX")] | ||
Mexico, | ||
|
||
/// <summary>Singapore</summary> | ||
[EnumMember(Value = "SG")] | ||
Singapore, | ||
|
||
/// <summary>Ireland</summary> | ||
[EnumMember(Value = "IE")] | ||
Ireland, | ||
} | ||
} |
Oops, something went wrong.