-
Notifications
You must be signed in to change notification settings - Fork 51
Add support for retrieving Zoom Phone call queues #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 5 commits
223ac5d
97597f7
4e41e74
d085586
273a31a
d30f607
041d561
6356ed3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| using System.Collections.Generic; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace ZoomNet.Models | ||
| { | ||
| /// <summary> | ||
| /// A Call Queue. | ||
| /// </summary> | ||
| public class CallQueue | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the extension id. | ||
| /// </summary> | ||
| [JsonPropertyName("extension_id")] | ||
| public string ExtensionId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the extension number. | ||
| /// </summary> | ||
| [JsonPropertyName("extension_number")] | ||
| public long? ExtensionNumber { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the unique identifier of the call queue. | ||
| /// </summary> | ||
| [JsonPropertyName("id")] | ||
| public string Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the name of the call queue. | ||
| /// </summary> | ||
| [JsonPropertyName("name")] | ||
| public string Name { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the phone numbers assigned to the call queue. | ||
| /// </summary> | ||
| [JsonPropertyName("phone_numbers")] | ||
| public List<CallQueuePhoneNumber> PhoneNumbers { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the site information. | ||
| /// </summary> | ||
| [JsonPropertyName("site")] | ||
| public Site Site { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the status of the call queue. | ||
| /// </summary> | ||
| [JsonPropertyName("status")] | ||
| public string Status { get; set; } | ||
|
MacgyverH marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace ZoomNet.Models | ||
| { | ||
| /// <summary> | ||
| /// Represents a member of a call queue, which can be a user or a common area. | ||
| /// </summary> | ||
| public class CallQueueMember | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the member id. | ||
| /// </summary> | ||
| [JsonPropertyName("id")] | ||
| public string Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the level of the member. | ||
| /// </summary> | ||
| [JsonPropertyName("level")] | ||
| public string Level { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the name of the user or common area. | ||
| /// </summary> | ||
| [JsonPropertyName("name")] | ||
| public string Name { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets a value indicating whether the user can receive calls. It displays if the level is user. | ||
| /// </summary> | ||
| [JsonPropertyName("receive_call")] | ||
| public bool ReceiveCall { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the extension ID of the user or common area. | ||
| /// </summary> | ||
| [JsonPropertyName("extension_id")] | ||
| public string ExtensionId { get; set; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Text.Json.Serialization; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace ZoomNet.Models | ||
| { | ||
| /// <summary> | ||
| /// Represents a phone number assigned to a call queue. | ||
| /// </summary> | ||
| public class CallQueuePhoneNumber | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the unique identifier of the phone number. | ||
| /// </summary> | ||
| [JsonPropertyName("id")] | ||
| public string Id { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the phone number. | ||
| /// </summary> | ||
| [JsonPropertyName("number")] | ||
| public string Number { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// gets or sets the source of the phone number. | ||
| /// </summary> | ||
| [JsonPropertyName("source")] | ||
| public string Source { get; set; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,5 +124,44 @@ public Task UpdateCallHandlingSettingsAsync( | |
| .WithCancellationToken(cancellationToken) | ||
| .AsMessage(); | ||
| } | ||
|
|
||
| #region Call Queues | ||
| /// <inheritdoc/> | ||
| public Task<CallQueue> GetCallQueueAsync(string callQueueId, CancellationToken cancellationToken = default) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that (according to the specification) this endpoint provides more details about the requested call queue. So we can define CallQueueDetails inherited from CallQueue and add more properties there.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll compare and add the missing properties to the new class as suggested. |
||
| { | ||
| return _client | ||
| .GetAsync($"phone/call_queues/{callQueueId}") | ||
| .WithCancellationToken(cancellationToken) | ||
| .AsObject<CallQueue>(); | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public Task<PaginatedResponseWithToken<CallQueue>> GetAllCallQueuesAsync(string department = null, string costCenter = null, string siteId = null, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default) | ||
| { | ||
| Utils.ValidateRecordPerPage(recordsPerPage, max: 100); | ||
|
|
||
| return _client | ||
| .GetAsync($"phone/call_queues") | ||
| .WithArgument("department", department) | ||
| .WithArgument("cost_center", costCenter) | ||
| .WithArgument("site_id", siteId) | ||
| .WithArgument("page_size", recordsPerPage) | ||
| .WithArgument("next_page_token", pagingToken) | ||
| .WithCancellationToken(cancellationToken) | ||
| .AsPaginatedResponseWithToken<CallQueue>("call_queues"); | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public Task<PaginatedResponseWithToken<CallQueueMember>> GetCallQueueMembersAsync(string callQueueId, int recordsPerPage = 30, string pagingToken = null, CancellationToken cancellationToken = default) | ||
| { | ||
| Utils.ValidateRecordPerPage(recordsPerPage); | ||
| return _client | ||
| .GetAsync($"phone/call_queues/{callQueueId}/members") | ||
| .WithArgument("page_size", recordsPerPage) | ||
| .WithArgument("next_page_token", pagingToken) | ||
| .WithCancellationToken(cancellationToken) | ||
| .AsPaginatedResponseWithToken<CallQueueMember>("call_queue_members"); | ||
| } | ||
| #endregion | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.