split out teamitem from teams

looking at github api only id and name is returned for the list.
This commit is contained in:
Haroon
2013-11-06 12:55:08 +00:00
parent d5226534cc
commit 375cc244de
4 changed files with 28 additions and 4 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ namespace Octokit
/// Returns all <see cref="Team" />s for the current org.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
Task<IReadOnlyList<Team>> GetAllTeams(string org);
/// <returns>A list of the orgs's teams <see cref="TeamItem"/>s.</returns>
Task<IReadOnlyList<TeamItem>> GetAllTeams(string org);
/// <summary>
/// Returns newly created <see cref="Team" /> for the current org.
+2 -2
View File
@@ -29,13 +29,13 @@ namespace Octokit
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
public Task<IReadOnlyList<Team>> GetAllTeams(string org)
public Task<IReadOnlyList<TeamItem>> GetAllTeams(string org)
{
Ensure.ArgumentNotNullOrEmptyString(org, "org");
var endpoint = "orgs/{0}/teams".FormatUri(org);
return ApiConnection.GetAll<Team>(endpoint);
return ApiConnection.GetAll<TeamItem>(endpoint);
}
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// organization teams - used for the list
/// </summary>
public class TeamItem
{
/// <summary>
/// team id
/// </summary>
public int Id { get; set; }
/// <summary>
/// team name
/// </summary>
public string Name { get; set; }
}
}
+1
View File
@@ -83,6 +83,7 @@
<Compile Include="Models\Request\RequestParameters.cs" />
<Compile Include="Models\Response\CommitStatus.cs" />
<Compile Include="Models\Request\Permission.cs" />
<Compile Include="Models\Response\TeamItem.cs" />
<Compile Include="Models\Response\Team.cs" />
<Compile Include="Models\Response\EventInfo.cs" />
<Compile Include="Models\Response\Issue.cs" />