-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
44 lines (36 loc) · 1.52 KB
/
Program.cs
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
using System;
using System.Collections.Generic;
using com.freeclimb.api;
using com.freeclimb.api.recording;
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
RecordingList recordingList = client.getRecordingsRequester.getMeta ();
// Check if list is empty by checking total size of the list
if (recordingList.getTotalSize > 0) {
// retrieve all recording for server
while (recordingList.getLocalSize < recordingList.getTotalSize) {
recordingList.loadNextPage ();
}
// Convert current pages recording information to a linked list
LinkedList<IFreeClimbCommon> commonList = recordingList.export ();
// Loop through linked list to process recording information
foreach (IFreeClimbCommon element in commonList) {
// Cast each element to the Recording element for processing
Recording recording = element as Recording;
// Process recording element
Console.Write (recording.getRecordingId);
}
}
}
}
}