mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
🔥 ITeamsClient.IsMember()
This commit is contained in:
@@ -125,16 +125,6 @@ namespace Octokit.Reactive
|
||||
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
|
||||
IObservable<bool> RemoveMembership(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">The team to check.</param>
|
||||
/// <param name="login">The user to check.</param>
|
||||
/// <returns><see langword="true"/> if the user is a member of the team; <see langword="false"/> otherwise.</returns>
|
||||
[Obsolete("Use GetMembership(id, login) to detect pending memberships")]
|
||||
IObservable<bool> IsMember(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
|
||||
@@ -189,21 +189,6 @@ namespace Octokit.Reactive
|
||||
return _client.RemoveMembership(id, login).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">The team to check.</param>
|
||||
/// <param name="login">The user to check.</param>
|
||||
/// <returns><see langword="true"/> if the user is a member of the team; <see langword="false"/> otherwise.</returns>
|
||||
[Obsolete("Use GetMembership(id, login) to detect pending memberships")]
|
||||
public IObservable<bool> IsMember(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, "login");
|
||||
|
||||
return _client.IsMember(id, login).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
|
||||
@@ -126,16 +126,6 @@ namespace Octokit
|
||||
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
|
||||
Task<bool> RemoveMembership(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">The team to check.</param>
|
||||
/// <param name="login">The user to check.</param>
|
||||
/// <returns><see langword="true"/> if the user is a member of the team; <see langword="false"/> otherwise.</returns>
|
||||
[Obsolete("Use GetMembership(id, login) as this will report on pending requests")]
|
||||
Task<bool> IsMember(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
|
||||
@@ -252,31 +252,6 @@ namespace Octokit
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">The team to check.</param>
|
||||
/// <param name="login">The user to check.</param>
|
||||
/// <returns><see langword="true"/> if the user is a member of the team; <see langword="false"/> otherwise.</returns>
|
||||
[Obsolete("Use GetMembership(id, login) as this will report on pending requests")]
|
||||
public async Task<bool> IsMember(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, "login");
|
||||
|
||||
var endpoint = ApiUrls.TeamMember(id, login);
|
||||
|
||||
try
|
||||
{
|
||||
var response = await ApiConnection.Connection.GetResponse<string>(endpoint).ConfigureAwait(false);
|
||||
return response.HttpResponse.StatusCode == HttpStatusCode.NoContent;
|
||||
}
|
||||
catch (NotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all team's repositories.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user