-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (40 loc) · 1.68 KB
/
Program.cs
File metadata and controls
48 lines (40 loc) · 1.68 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
47
48
using System;
using System.Collections.Generic;
using com.freeclimb.api;
using com.freeclimb.api.message;
namespace ListRecordings {
class Program {
public static string getFreeClimbAccountId () {
return System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
}
public static string getFreeClimbApiKeys () {
return System.Environment.GetEnvironmentVariable("API_KEY");
}
static void Main(string[] args)
{
// Create FreeClimbClient object
FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(), getFreeClimbApiKeys());
// Invoke get method to retrieve initial list of recording information
MessageList messageList = client.getMessagesRequester.get();
// Check if list is empty by checking total size of the list
if (messageList.getTotalSize > 0)
{
// retrieve all recording for server
while (messageList.getLocalSize < messageList.getTotalSize)
{
messageList.loadNextPage();
}
// Convert current pages recording information to a linked list
LinkedList<IFreeClimbCommon> commonList = messageList.export();
// Loop through linked list to process recording information
foreach (IFreeClimbCommon element in commonList)
{
// Cast each element to the Recording element for processing
Message message = element as Message;
// Process recording element
Console.Write(message.getText);
}
}
}
}
}