mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 19:46:07 +00:00
split out teamitem from teams
looking at github api only id and name is returned for the list.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user