diff --git a/Octokit.Reactive/Clients/IObservableTeamsClient.cs b/Octokit.Reactive/Clients/IObservableTeamsClient.cs index f4a72a62..101946a9 100644 --- a/Octokit.Reactive/Clients/IObservableTeamsClient.cs +++ b/Octokit.Reactive/Clients/IObservableTeamsClient.cs @@ -63,19 +63,6 @@ namespace Octokit.Reactive /// IObservable Delete(int id); - /// - /// Adds a to a . - /// - /// - /// See the API documentation for more information. - /// - /// The team identifier. - /// The user to add to the team. - /// Thrown if you attempt to add an organization to a team. - /// if the user was added to the team; otherwise. - [Obsolete("Use AddMembership(id, login) to track pending requests")] - IObservable AddMember(int id, string login); - /// /// Adds a to a . /// @@ -97,8 +84,7 @@ namespace Octokit.Reactive /// The team identifier. /// The user to remove from the team. /// if the user was removed from the team; otherwise. - IObservable RemoveMember(int id, string login); - + IObservable RemoveMembership(int id, string login); /// /// Gets whether the user with the given diff --git a/Octokit.Reactive/Clients/ObservableTeamsClient.cs b/Octokit.Reactive/Clients/ObservableTeamsClient.cs index 772166c6..a3e9af4f 100644 --- a/Octokit.Reactive/Clients/ObservableTeamsClient.cs +++ b/Octokit.Reactive/Clients/ObservableTeamsClient.cs @@ -95,22 +95,6 @@ namespace Octokit.Reactive return _client.Delete(id).ToObservable(); } - /// - /// Adds a to a . - /// - /// - /// See the API documentation for more information. - /// - /// The team identifier. - /// The user to add to the team. - /// Thrown if you attempt to add an organization to a team. - /// if the user was added to the team; otherwise. - [Obsolete("Use AddMembership(int, login) to get pending invitations")] - public IObservable AddMember(int id, string login) - { - return _client.AddMember(id, login).ToObservable(); - } - /// /// Adds a to a . /// @@ -135,9 +119,9 @@ namespace Octokit.Reactive /// The team identifier. /// The user to remove from the team. /// if the user was removed from the team; otherwise. - public IObservable RemoveMember(int id, string login) + public IObservable RemoveMembership(int id, string login) { - return _client.RemoveMember(id, login).ToObservable(); + return _client.RemoveMembership(id, login).ToObservable(); } /// diff --git a/Octokit.Tests/Clients/TeamsClientTests.cs b/Octokit.Tests/Clients/TeamsClientTests.cs index a06b3afc..16da07ff 100644 --- a/Octokit.Tests/Clients/TeamsClientTests.cs +++ b/Octokit.Tests/Clients/TeamsClientTests.cs @@ -143,7 +143,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new TeamsClient(connection); - client.AddMember(1, "user"); + client.AddMembership(1, "user"); connection.Connection.Received().Put(Arg.Is(u => u.ToString() == "teams/1/memberships/user")); } @@ -154,8 +154,8 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new TeamsClient(connection); - await Assert.ThrowsAsync(() => client.AddMember(1, null)); - await Assert.ThrowsAsync(() => client.AddMember(1, "")); + await Assert.ThrowsAsync(() => client.AddMembership(1, null)); + await Assert.ThrowsAsync(() => client.AddMembership(1, "")); } } @@ -187,7 +187,7 @@ namespace Octokit.Tests.Clients { var connection = Substitute.For(); var client = new TeamsClient(connection); - client.RemoveMember(1, "user"); + client.RemoveMembership(1, "user"); connection.Connection.Received().Delete(Arg.Is(u => u.ToString() == "teams/1/memberships/user")); } @@ -198,8 +198,8 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new TeamsClient(connection); - await Assert.ThrowsAsync(() => client.RemoveMember(1, null)); - await Assert.ThrowsAsync(() => client.RemoveMember(1, "")); + await Assert.ThrowsAsync(() => client.RemoveMembership(1, null)); + await Assert.ThrowsAsync(() => client.RemoveMembership(1, "")); } } diff --git a/Octokit/Clients/ITeamsClient.cs b/Octokit/Clients/ITeamsClient.cs index 69dba2c1..7049c268 100644 --- a/Octokit/Clients/ITeamsClient.cs +++ b/Octokit/Clients/ITeamsClient.cs @@ -65,19 +65,6 @@ namespace Octokit /// Task Delete(int id); - /// - /// Adds a to a . - /// - /// - /// See the API documentation for more information. - /// - /// The team identifier. - /// The user to add to the team. - /// Thrown if you attempt to add an organization to a team. - /// if the user was added to the team; otherwise. - [Obsolete("Use AddMembership(id, login) to track pending requests")] - Task AddMember(int id, string login); - /// /// Adds a to a . /// @@ -99,7 +86,7 @@ namespace Octokit /// The team identifier. /// The user to remove from the team. /// if the user was removed from the team; otherwise. - Task RemoveMember(int id, string login); + Task RemoveMembership(int id, string login); /// /// Gets whether the user with the given diff --git a/Octokit/Clients/TeamsClient.cs b/Octokit/Clients/TeamsClient.cs index 6b977e7a..ad7d154f 100644 --- a/Octokit/Clients/TeamsClient.cs +++ b/Octokit/Clients/TeamsClient.cs @@ -133,35 +133,6 @@ namespace Octokit return ApiConnection.Delete(endpoint); } - /// - /// Adds a to a . - /// - /// - /// See the API documentation for more information. - /// - /// The team identifier. - /// The user to add to the team. - /// Thrown if you attempt to add an organization to a team. - /// if the user was added to the team; otherwise. - [Obsolete("Use AddTeamMember(id, login) to track pending requests")] - public async Task AddMember(int id, string login) - { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); - - var endpoint = ApiUrls.TeamMember(id, login); - - try - { - var httpStatusCode = await ApiConnection.Connection.Put(endpoint); - - return httpStatusCode == HttpStatusCode.NoContent; - } - catch (NotFoundException) - { - return false; - } - } - /// /// Adds a to a . /// @@ -203,7 +174,7 @@ namespace Octokit /// The team identifier. /// The user to remove from the team. /// if the user was removed from the team; otherwise. - public async Task RemoveMember(int id, string login) + public async Task RemoveMembership(int id, string login) { Ensure.ArgumentNotNullOrEmptyString(login, "login");