mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-31 18:13:21 +00:00
add create and update methods
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user