Fill out the activity model

This commit is contained in:
pltaylor
2013-11-04 20:44:20 -05:00
parent 1f8d85f2a2
commit 643dcc7246
3 changed files with 62 additions and 1 deletions
+19 -1
View File
@@ -1,8 +1,26 @@

using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
{
public class ActivitiesClient : IActivitiesClient
public class ActivitiesClient: ApiClient, IActivitiesClient
{
public ActivitiesClient(IApiConnection apiConnection)
: base(apiConnection)
{
}
/// <summary>
/// Gets all the public events
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/activity/events/#list-public-events
/// </remarks>
/// <returns>All the public <see cref="Activity"/>s for the particular user.</returns>
public Task<IReadOnlyList<Activity>> GetAll()
{
return ApiConnection.GetAll<Activity>(ApiUrls.Events());
}
}
}
+42
View File
@@ -0,0 +1,42 @@
using System;
namespace Octokit
{
public class Activity
{
/// <summary>
/// The type of the activity.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Whether the activity event is public or not.
/// </summary>
public bool Public { get; set; }
/// <summary>
/// The repository associated with the activity event.
/// </summary>
public Repository Repo { get; set; }
/// <summary>
/// The user associated with the activity event.
/// </summary>
public User Actor { get; set; }
/// <summary>
/// The organization associated with the activity event.
/// </summary>
public Organization Org { get; set; }
/// <summary>
/// The date the activity event was created.
/// </summary>
public DateTimeOffset CreatedAt { get; set; }
/// <summary>
/// The activity event Id.
/// </summary>
public int Id { get; set; }
}
}
+1
View File
@@ -53,6 +53,7 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="Clients\ActivitiesClient.cs" />
<Compile Include="Models\Response\Activity.cs" />
<Compile Include="Clients\AssigneesClient.cs" />
<Compile Include="Clients\CommitStatusClient.cs" />
<Compile Include="Clients\GitDatabaseClient.cs" />