diff --git a/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseLdapClient.cs b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseLdapClient.cs index 883980e3..d5f4bd1f 100644 --- a/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseLdapClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseLdapClient.cs @@ -21,8 +21,8 @@ namespace Octokit.Reactive /// /// The username to update LDAP mapping /// The - /// The object. - IObservable UpdateUserMapping(string userName, NewLdapMapping newLdapMapping); + /// The object. + IObservable UpdateUserMapping(string userName, NewLdapMapping newLdapMapping); /// /// Queue an LDAP Sync job for a user on a GitHub Enterprise appliance (must be Site Admin user). @@ -31,7 +31,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user /// /// The username to sync LDAP mapping - /// The of the queue request. + /// The of the queue request. IObservable QueueSyncUserMapping(string userName); /// @@ -42,8 +42,8 @@ namespace Octokit.Reactive /// /// The teamId to update LDAP mapping /// The - /// The object. - IObservable UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping); + /// The object. + IObservable UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping); /// /// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user). @@ -52,7 +52,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping - /// The of the queue request. + /// The of the queue request. IObservable QueueSyncTeamMapping(int teamId); } } diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs index 95b5b6bc..f096e496 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs @@ -31,8 +31,8 @@ namespace Octokit.Reactive /// /// The username to update LDAP mapping /// The - /// The object. - public IObservable UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) + /// The object. + public IObservable UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) { return _client.UpdateUserMapping(userName, newLdapMapping).ToObservable(); } @@ -44,7 +44,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user /// /// The username to sync LDAP mapping - /// The of the queue request. + /// The of the queue request. public IObservable QueueSyncUserMapping(string userName) { return _client.QueueSyncUserMapping(userName).ToObservable(); @@ -58,8 +58,8 @@ namespace Octokit.Reactive /// /// The teamId to update LDAP mapping /// The - /// The object. - public IObservable UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) + /// The object. + public IObservable UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) { return _client.UpdateTeamMapping(teamId, newLdapMapping).ToObservable(); } @@ -71,7 +71,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping - /// The of the queue request. + /// The of the queue request. public IObservable QueueSyncTeamMapping(int teamId) { return _client.QueueSyncTeamMapping(teamId).ToObservable(); diff --git a/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs b/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs index 62aaff4d..0073384e 100644 --- a/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs @@ -23,15 +23,15 @@ namespace Octokit /// /// The username to update LDAP mapping /// The - /// The object. - public async Task UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) + /// The object. + public async Task UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) { Ensure.ArgumentNotNull(userName, "userName"); Ensure.ArgumentNotNull(newLdapMapping, "newLdapMapping"); var endpoint = ApiUrls.EnterpriseLdapUserMapping(userName); - return await ApiConnection.Patch(endpoint, newLdapMapping); + return await ApiConnection.Patch(endpoint, newLdapMapping); } /// @@ -41,7 +41,7 @@ namespace Octokit /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user /// /// The userName to sync LDAP mapping - /// The of the queue request. + /// The of the queue request. public async Task QueueSyncUserMapping(string userName) { Ensure.ArgumentNotNull(userName, "userName"); @@ -65,17 +65,17 @@ namespace Octokit /// /// The teamId to update LDAP mapping /// The - /// The object. - public async Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) + /// The object. + public async Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) { Ensure.ArgumentNotNull(teamId, "teamId"); Ensure.ArgumentNotNull(newLdapMapping, "newLdapMapping"); var endpoint = ApiUrls.EnterpriseLdapTeamMapping(teamId); - return await ApiConnection.Patch(endpoint, newLdapMapping); + return await ApiConnection.Patch(endpoint, newLdapMapping); } - + /// /// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user). /// @@ -83,7 +83,7 @@ namespace Octokit /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping - /// The of the queue request. + /// The of the queue request. public async Task QueueSyncTeamMapping(int teamId) { Ensure.ArgumentNotNull(teamId, "teamId"); diff --git a/Octokit/Clients/Enterprise/IEnterpriseLdapClient.cs b/Octokit/Clients/Enterprise/IEnterpriseLdapClient.cs index 9de08422..68f30cdd 100644 --- a/Octokit/Clients/Enterprise/IEnterpriseLdapClient.cs +++ b/Octokit/Clients/Enterprise/IEnterpriseLdapClient.cs @@ -18,8 +18,8 @@ namespace Octokit /// /// The username to update LDAP mapping /// The - /// The object. - Task UpdateUserMapping(string userName, NewLdapMapping newLdapMapping); + /// The object. + Task UpdateUserMapping(string userName, NewLdapMapping newLdapMapping); /// /// Queue an LDAP Sync job for a user on a GitHub Enterprise appliance (must be Site Admin user). @@ -28,7 +28,7 @@ namespace Octokit /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user /// /// The username to sync LDAP mapping - /// The of the queue request. + /// The of the queue request. Task QueueSyncUserMapping(string userName); /// @@ -39,8 +39,8 @@ namespace Octokit /// /// The teamId to update LDAP mapping /// The - /// The object. - Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping); + /// The object. + Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping); /// /// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user). @@ -49,7 +49,7 @@ namespace Octokit /// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team /// /// The teamId to update LDAP mapping - /// The of the queue request. + /// The of the queue request. Task QueueSyncTeamMapping(int teamId); } } diff --git a/Octokit/Models/Request/Enterprise/NewLdapMapping.cs b/Octokit/Models/Request/Enterprise/NewLdapMapping.cs index b12e7843..f660a7a1 100644 --- a/Octokit/Models/Request/Enterprise/NewLdapMapping.cs +++ b/Octokit/Models/Request/Enterprise/NewLdapMapping.cs @@ -1,6 +1,7 @@ using System; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Octokit @@ -15,21 +16,25 @@ namespace Octokit /// Initializes a new instance of the class. /// /// The LDAP Distinguished Name - public NewLdapMapping(string ldapDN) + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public NewLdapMapping(string ldapDn) { - LdapDN = ldapDN; + LdapDn = ldapDn; } /// /// The LDAP Distinguished Name (required) /// - public string LdapDN { get; private set; } + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public string LdapDn { get; private set; } internal string DebuggerDisplay { get { - return string.Format(CultureInfo.InvariantCulture, "LdapDn: {0}", LdapDN); + return string.Format(CultureInfo.InvariantCulture, "LdapDn: {0}", LdapDn); } } } diff --git a/Octokit/Models/Response/Enterprise/LdapSyncResponse.cs b/Octokit/Models/Response/Enterprise/LdapSyncResponse.cs index 65872c4e..2ed74f9a 100644 --- a/Octokit/Models/Response/Enterprise/LdapSyncResponse.cs +++ b/Octokit/Models/Response/Enterprise/LdapSyncResponse.cs @@ -11,12 +11,12 @@ namespace Octokit { public LdapSyncResponse() { } - public LdapSyncResponse(IReadOnlyList status) + public LdapSyncResponse(string status) { Status = status; } - public IReadOnlyList Status + public string Status { get; private set; @@ -26,7 +26,7 @@ namespace Octokit { get { - return String.Format(CultureInfo.InvariantCulture, "Status: {0}", string.Join("\r\n", Status)); + return String.Format(CultureInfo.InvariantCulture, "Status: {0}", Status); } } } diff --git a/Octokit/Models/Response/Enterprise/LdapTeam.cs b/Octokit/Models/Response/Enterprise/LdapTeam.cs deleted file mode 100644 index 1a1ce545..00000000 --- a/Octokit/Models/Response/Enterprise/LdapTeam.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; - -namespace Octokit -{ - [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class LdapTeam : Team - { - public LdapTeam() { } - - public LdapTeam(Uri url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization, string ldapDN) - : base(url, id, name, permission, membersCount, reposCount, organization) - { - LdapDN = ldapDN; - } - - public string LdapDN { get; protected set; } - - internal new string DebuggerDisplay - { - get { return base.DebuggerDisplay; } - } - } -} diff --git a/Octokit/Models/Response/Enterprise/LdapUser.cs b/Octokit/Models/Response/Enterprise/LdapUser.cs deleted file mode 100644 index e34634d8..00000000 --- a/Octokit/Models/Response/Enterprise/LdapUser.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; - -namespace Octokit -{ - [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class LdapUser : User - { - public LdapUser() { } - - public LdapUser(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin, string ldapDN) - : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, url, siteAdmin) - { - LdapDN = ldapDN; - } - - public string LdapDN { get; protected set; } - - internal new string DebuggerDisplay - { - get { return base.DebuggerDisplay; } - } - } -} diff --git a/Octokit/Models/Response/Team.cs b/Octokit/Models/Response/Team.cs index 314c1b0a..60f54946 100644 --- a/Octokit/Models/Response/Team.cs +++ b/Octokit/Models/Response/Team.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Octokit @@ -12,7 +13,9 @@ namespace Octokit { public Team() { } - public Team(Uri url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization) + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public Team(Uri url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization, string ldapDn) { Url = url; Id = id; @@ -21,6 +24,7 @@ namespace Octokit MembersCount = membersCount; ReposCount = reposCount; Organization = organization; + LdapDn = ldapDn; } /// @@ -58,6 +62,13 @@ namespace Octokit /// public Organization Organization { get; protected set; } + /// + /// LDAP Binding (GitHub Enterprise only) + /// + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public string LdapDn { get; protected set; } + internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Name: {0} ", Name); } diff --git a/Octokit/Models/Response/User.cs b/Octokit/Models/Response/User.cs index 31b3d40a..4eb745ae 100644 --- a/Octokit/Models/Response/User.cs +++ b/Octokit/Models/Response/User.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Octokit @@ -12,10 +13,13 @@ namespace Octokit { public User() { } - public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin) + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin, string ldapDn) : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, AccountType.User, url) { SiteAdmin = siteAdmin; + LdapDn = ldapDn; } /// @@ -23,6 +27,13 @@ namespace Octokit /// public bool SiteAdmin { get; protected set; } + /// + /// LDAP Binding (GitHub Enterprise only) + /// + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dn")] + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Dn")] + public string LdapDn { get; protected set; } + internal string DebuggerDisplay { get diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 9eb6dec6..34776289 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -450,8 +450,6 @@ - - diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index d42ba1df..f57c2adf 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -458,8 +458,6 @@ - - diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index 91023b16..fab21afa 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -454,8 +454,6 @@ - - diff --git a/Octokit/Octokit-Portable.csproj b/Octokit/Octokit-Portable.csproj index bbb7bebd..93d40338 100644 --- a/Octokit/Octokit-Portable.csproj +++ b/Octokit/Octokit-Portable.csproj @@ -447,8 +447,6 @@ - - diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index 02578d49..00a65ff9 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -454,8 +454,6 @@ - - diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 72354fbd..7616a418 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -154,8 +154,6 @@ - -