-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathGlipExportTest.cs
41 lines (37 loc) · 1.36 KB
/
GlipExportTest.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
using Xunit;
namespace RingCentral.Tests;
[Collection("Sequential")]
public class GlipExportTest
{
[Fact]
public async void ExportGlipData()
{
var rc = await ReusableRestClient.GetInstance();
// // can only be done once per day
// var r = await rc.Restapi().Glip().DataExport().Post(new CreateDataExportTaskRequest());
// Assert.Equal("Accepted", r.status);
//
// await Task.Delay(60000);
// var r2 = await rc.Restapi().Glip().DataExport(r.id).Get();
// Assert.Equal("Completed", r2.status);
//
// var content = await rc.Get<byte[]>(r2.datasets[0].uri);
// Assert.True(content.Length > 0);
// File.WriteAllBytes("test.zip", content);
}
// // cannot do it because there is no api to list existing tasks
// [Fact]
// public async void DowloadArchieve()
// {
// using (var rc = new RestClient(
// Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_ID"),
// Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_SECRET"),
// Environment.GetEnvironmentVariable("RINGCENTRAL_SERVER_URL")
// ))
// {
// await rc.Authorize(
// Environment.GetEnvironmentVariable("RINGCENTRAL_JWT_TOKEN")
// );
// }
// }
}