-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
EnterpriseOrganizationClient.cs
35 lines (31 loc) · 1.36 KB
/
EnterpriseOrganizationClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Threading.Tasks;
namespace Octokit
{
/// <summary>
/// A client for GitHub's Enterprise Organization API
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/enterprise/orgs/">Enterprise Organization API documentation</a> for more information.
///</remarks>
public class EnterpriseOrganizationClient : ApiClient, IEnterpriseOrganizationClient
{
public EnterpriseOrganizationClient(IApiConnection apiConnection)
: base(apiConnection)
{ }
/// <summary>
/// Creates an Organization on a GitHub Enterprise appliance (must be Site Admin user).
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/enterprise/orgs/#create-an-organization
/// </remarks>
/// <param name="newOrganization">A <see cref="NewOrganization"/> instance describing the organization to be created</param>
/// <returns>The <see cref="Organization"/> created.</returns>
[ManualRoute("POST", "/admin/organizations")]
public Task<Organization> Create(NewOrganization newOrganization)
{
Ensure.ArgumentNotNull(newOrganization, nameof(newOrganization));
var endpoint = ApiUrls.EnterpriseOrganization();
return ApiConnection.Post<Organization>(endpoint, newOrganization);
}
}
}