public async Task <ResponseList <Activity> > GetSpaceActivitiesAsync(ActivityQueryParams @params = null, CancellationToken?token = default(CancellationToken?)) { var url = BuildEndpoint("space/activities"); using (var response = await Get(url, @params, token: token)) using (var content = response.Content) { return(await Factory.CreateActivityListAsync(response)); } }
public void TestActivityQueryParams() { var param = new ActivityQueryParams() { ActivityType = new[] { ActivityType.IssueCommented, ActivityType.IssueCreated }, Count = 10, MinId = 1, MaxId = 100, Order = Order.Asc, }; var parameters = param.Parameters; Assert.IsTrue(parameters.Any(x => x.Name == "activityTypeId[]" && x.Value == "3")); Assert.IsTrue(parameters.Any(x => x.Name == "activityTypeId[]" && x.Value == "1")); Assert.IsTrue(parameters.Any(x => x.Name == "count" && x.Value == "10")); Assert.IsTrue(parameters.Any(x => x.Name == "minId" && x.Value == "1")); Assert.IsTrue(parameters.Any(x => x.Name == "maxId" && x.Value == "100")); Assert.IsTrue(parameters.Any(x => x.Name == "order" && x.Value == "asc")); }
public async Task <ResponseList <Activity> > GetUserActivitiesAsync(long numericUserId, ActivityQueryParams queryParams = null, CancellationToken?token = default(CancellationToken?)) { using (var response = await Get(BuildEndpoint($"users/{numericUserId}/activities"), queryParams, token: token)) using (var content = response.Content) { return(await Factory.CreateActivityListAsync(response)); } }
public async Task <ResponseList <Activity> > GetProjectActivitiesAsync(IdOrKey projectIdOrKey, ActivityQueryParams query = null, CancellationToken?token = default(CancellationToken?)) { using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/activities"), query, token: token)) using (var content = response.Content) { return(await Factory.CreateActivityListAsync(response)); } }