using System; using System.Reactive; using System.Reactive.Threading.Tasks; using Octokit; namespace Octokit.Reactive { /// /// A client for GitHub's Enterprise LDAP API /// /// /// See the Enterprise LDAP API documentation for more information. /// public class ObservableEnterpriseLdapClient : IObservableEnterpriseLdapClient { readonly IEnterpriseLdapClient _client; public ObservableEnterpriseLdapClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.Ldap; } /// /// Update the LDAP mapping for a user on a GitHub Enterprise appliance (must be Site Admin user). /// /// /// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user /// /// The username to update LDAP mapping /// The /// The object. public IObservable UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) { return _client.UpdateUserMapping(userName, newLdapMapping).ToObservable(); } /// /// Queue an LDAP Sync job for a user on a GitHub Enterprise appliance (must be Site Admin user). /// /// /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user /// /// The username to sync LDAP mapping /// The of the queue request. public IObservable QueueSyncUserMapping(string userName) { return _client.QueueSyncUserMapping(userName).ToObservable(); } /// /// Update the LDAP mapping for a team on a GitHub Enterprise appliance (must be Site Admin user). /// /// /// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping /// The /// The object. public IObservable UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) { return _client.UpdateTeamMapping(teamId, newLdapMapping).ToObservable(); } /// /// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user). /// /// /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping /// The of the queue request. public IObservable QueueSyncTeamMapping(int teamId) { return _client.QueueSyncTeamMapping(teamId).ToObservable(); } } }