add create and update methods

This commit is contained in:
Haroon
2013-11-06 12:53:33 +00:00
parent e0cf9ff1ba
commit d5226534cc
5 changed files with 82 additions and 0 deletions
+14
View File
@@ -20,5 +20,19 @@ namespace Octokit
/// <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);
/// <summary>
/// Returns newly created <see cref="Team" /> for the current org.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>Newly created <see cref="Team"/></returns>
Task<Team> CreateTeam(string org, NewTeam team);
/// <summary>
/// Returns updated <see cref="Team" /> for the current org.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>Updated <see cref="Team"/></returns>
Task<Team> UpdateTeam(string org, int id, UpdateTeam team);
}
}
+21
View File
@@ -37,5 +37,26 @@ namespace Octokit
return ApiConnection.GetAll<Team>(endpoint);
}
/// <summary>
/// Returns newly created <see cref="Team" /> for the current org.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>Newly created <see cref="Team"/></returns>
public Task<Team> CreateTeam(string org, NewTeam team)
{
throw new System.NotImplementedException();
}
/// <summary>
/// Returns updated <see cref="Team" /> for the current org.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>Updated <see cref="Team"/></returns>
public Task<Team> UpdateTeam(string org, int id, UpdateTeam team)
{
throw new System.NotImplementedException();
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
public class NewTeam
{
/// <summary>
/// team name
/// </summary>
public string Name { get; set; }
/// <summary>
/// permission associated to this team
/// </summary>
public Permission Permission { get; set; }
/// <summary>
/// array of repo_names this team has permissions to
/// </summary>
public string[] RepoNames { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
public class UpdateTeam
{
/// <summary>
/// team name
/// </summary>
public string Name { get; set; }
/// <summary>
/// permission for this team
/// </summary>
public Permission Permission { get; set; }
}
}
+2
View File
@@ -75,6 +75,8 @@
<Compile Include="Clients\IMilestonesClient.cs" />
<Compile Include="Helpers\ParameterAttribute.cs" />
<Compile Include="Helpers\ReflectionExtensions.cs" />
<Compile Include="Models\Request\NewTeam.cs" />
<Compile Include="Models\Request\UpdateTeam.cs" />
<Compile Include="Models\Request\MilestoneUpdate.cs" />
<Compile Include="Models\Request\NewCommitStatus.cs" />
<Compile Include="Models\Request\NewMilestone.cs" />