-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
46 lines (39 loc) · 1.61 KB
/
Program.cs
File metadata and controls
46 lines (39 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using com.freeclimb.api;
using com.freeclimb.api.queue;
namespace ListQueueMembers {
class Program {
static string getFreeClimbAccountId () {
return System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
}
static string getFreeClimbApiKeys () {
return System.Environment.GetEnvironmentVariable("API_KEY");
}
static void Main (string[] args) {
string queueId = "";
// Create FreeClimbClient object
FreeClimbClient client = new FreeClimbClient (getFreeClimbAccountId (),
getFreeClimbApiKeys ());
// Invoke getMembers method to retrieve initial list of queue member information
QueueMemberList queueMemberList = client.getQueuesRequester.getMembers (queueId);
// Check if list is empty by checking total size of the list
if (queueMemberList.getTotalSize > 0) {
// retrieve all queue member information from server
while (queueMemberList.getLocalSize < queueMemberList.getTotalSize) {
queueMemberList.loadNextPage ();
}
// Convert current pages queue information to a linked list
LinkedList<IFreeClimbCommon> commonList = queueMemberList.export ();
// Loop through linked list to process queue member information
foreach (IFreeClimbCommon element in commonList) {
// Cast each element to the QueueMember element for processing
QueueMember queueMember = element as QueueMember;
Console.WriteLine (queueMember.getCallId);
}
} else {
Console.WriteLine ("No Members in queue");
}
}
}
}