mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Remove method/members previously deprecated (#1780)
* removes obsolete OranizationsClient.GetAll (replaced with GetAllForUser) * removes obsolete PullRequestsClient.Comment (replaced with ReviewComment) * removes obsolete TeamsClient.GetMembership (replaced with GetMembershipDetails) removes obsolete TeamsClient.AddMembership (replaced with AddOrEditMembership) removes obsolete TeamsClient.AddMembership (replaced with AddOrEditMembership) removes obsolete TeamMembership response class (replaced with TeamMembershipDetails) * removes obsolete RepositoryBranchesClient.GetRequiredStatusChecksContexts (replaced with GetAllRequiredStatusChecksContexts) removes obsolete RepositoryBranchesClient.GetProtectedBranchTeamRestrictions (replaced with GetAllProtectedBranchTeamRestrictions) removes obsolete RepositoryBranchesClient.GetProtectedBranchUserRestrictions (replaced with GetAllProtectedBranchUserRestrictions) * removes obsolete RepositoryTrafficClient.GetReferrers (replaced with GetAllReferrers) removes obsolete RepositoryTrafficClient.GetPaths (replaced with GetAllPaths) * removes obsolete constructors from BranchProtectionUpdateSettings and UpdateTeam request models * removes obsolete Assignee property from NewIssue and IssueUpdate request models (replaced with Assignees)
This commit is contained in:
@@ -46,23 +46,6 @@ namespace Octokit.Reactive
|
||||
Justification = "Method makes a network request")]
|
||||
IObservable<Organization> GetAllForCurrent(ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
/// <param name="user">The login for the user</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use IObservableOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
IObservable<Organization> GetAll(string user);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
/// <param name="user">The login for the user</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use IObservableOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
IObservable<Organization> GetAll(string user, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
|
||||
@@ -11,12 +11,6 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
public interface IObservablePullRequestsClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Client for managing review comments.
|
||||
/// </summary>
|
||||
[Obsolete("Please use IObservablePullRequestsClient.ReviewComment. This will be removed in a future version")]
|
||||
IObservablePullRequestReviewCommentsClient Comment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing reviews.
|
||||
/// </summary>
|
||||
|
||||
@@ -205,29 +205,6 @@ namespace Octokit.Reactive
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
IObservable<bool> DeleteRequiredStatusChecks(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
IObservable<string> GetRequiredStatusChecksContexts(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
IObservable<string> GetRequiredStatusChecksContexts(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
@@ -488,29 +465,6 @@ namespace Octokit.Reactive
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
IObservable<bool> DeleteProtectedBranchRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
IObservable<Team> GetProtectedBranchTeamRestrictions(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
IObservable<Team> GetProtectedBranchTeamRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
@@ -601,29 +555,6 @@ namespace Octokit.Reactive
|
||||
/// <param name="teams">List of teams to remove</param>
|
||||
IObservable<Team> DeleteProtectedBranchTeamRestrictions(long repositoryId, string branch, BranchProtectionTeamCollection teams);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
IObservable<User> GetProtectedBranchUserRestrictions(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
IObservable<User> GetProtectedBranchUserRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
|
||||
@@ -10,23 +10,6 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
public interface IObservableRepositoryTrafficClient
|
||||
{
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
IObservable<RepositoryTrafficReferrer> GetReferrers(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
IObservable<RepositoryTrafficReferrer> GetReferrers(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
@@ -42,23 +25,6 @@ namespace Octokit.Reactive
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
IObservable<RepositoryTrafficReferrer> GetAllReferrers(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
IObservable<RepositoryTrafficPath> GetPaths(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
IObservable<RepositoryTrafficPath> GetPaths(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
|
||||
@@ -138,17 +138,6 @@ namespace Octokit.Reactive
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The team identifier.</param>
|
||||
/// <param name="login">The user to add to the team.</param>
|
||||
[Obsolete("Please use AddOrEditMembership instead")]
|
||||
IObservable<TeamMembership> AddMembership(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
@@ -171,15 +160,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>
|
||||
[Obsolete("Please use GetMembershipDetails instead")]
|
||||
IObservable<TeamMembership> GetMembership(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"/>.
|
||||
|
||||
@@ -73,34 +73,6 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Organization>(ApiUrls.UserOrganizations());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
/// <param name="user">The login for the user</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use ObservableOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
public IObservable<Organization> GetAll(string user)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(user, nameof(user));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Organization>(ApiUrls.UserOrganizations(user));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
/// <param name="user">The login for the user</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use ObservableOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
public IObservable<Organization> GetAll(string user, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(user, nameof(user));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Organization>(ApiUrls.UserOrganizations(user), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all the organizations for the specified user
|
||||
/// </summary>
|
||||
|
||||
@@ -15,12 +15,6 @@ namespace Octokit.Reactive
|
||||
readonly IPullRequestsClient _client;
|
||||
readonly IConnection _connection;
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing review comments.
|
||||
/// </summary>
|
||||
[Obsolete("Please use ObservablePullRequestsClient.ReviewComment. This will be removed in a future version")]
|
||||
public IObservablePullRequestReviewCommentsClient Comment { get { return this.ReviewComment; } }
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing reviews.
|
||||
/// </summary>
|
||||
|
||||
@@ -322,35 +322,6 @@ namespace Octokit.Reactive
|
||||
return _client.DeleteRequiredStatusChecks(repositoryId, branch).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
public IObservable<string> GetRequiredStatusChecksContexts(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllRequiredStatusChecksContexts(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
public IObservable<string> GetRequiredStatusChecksContexts(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllRequiredStatusChecksContexts(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
@@ -763,35 +734,6 @@ namespace Octokit.Reactive
|
||||
return _client.DeleteProtectedBranchRestrictions(repositoryId, branch).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
public IObservable<Team> GetProtectedBranchTeamRestrictions(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchTeamRestrictions(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
public IObservable<Team> GetProtectedBranchTeamRestrictions(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchTeamRestrictions(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
@@ -936,36 +878,6 @@ namespace Octokit.Reactive
|
||||
return _client.DeleteProtectedBranchTeamRestrictions(repositoryId, branch, teams).ToObservable().SelectMany(x => x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
public IObservable<User> GetProtectedBranchUserRestrictions(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchUserRestrictions(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
|
||||
public IObservable<User> GetProtectedBranchUserRestrictions(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchUserRestrictions(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
|
||||
@@ -15,29 +15,6 @@ namespace Octokit.Reactive
|
||||
_client = client.Repository.Traffic;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
public IObservable<RepositoryTrafficPath> GetPaths(long repositoryId)
|
||||
{
|
||||
return GetAllPaths(repositoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
public IObservable<RepositoryTrafficPath> GetPaths(string owner, string name)
|
||||
{
|
||||
return GetAllPaths(owner, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
@@ -62,29 +39,6 @@ namespace Octokit.Reactive
|
||||
return _client.GetAllPaths(owner, name).ToObservable().SelectMany(x => x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
public IObservable<RepositoryTrafficReferrer> GetReferrers(long repositoryId)
|
||||
{
|
||||
return GetAllReferrers(repositoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
public IObservable<RepositoryTrafficReferrer> GetReferrers(string owner, string name)
|
||||
{
|
||||
return GetAllReferrers(owner, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
|
||||
@@ -215,22 +215,6 @@ namespace Octokit.Reactive
|
||||
return _client.Delete(id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The team identifier.</param>
|
||||
/// <param name="login">The user to add to the team.</param>
|
||||
[Obsolete("Please use AddOrEditMembership instead")]
|
||||
public IObservable<TeamMembership> AddMembership(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, nameof(login));
|
||||
|
||||
return _client.AddMembership(id, login).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
@@ -264,20 +248,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>
|
||||
[Obsolete("Please use GetMembershipDetails instead")]
|
||||
public IObservable<TeamMembership> GetMembership(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, nameof(login));
|
||||
|
||||
return _client.GetMembership(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"/>.
|
||||
|
||||
@@ -612,12 +612,12 @@ public class RepositoryBranchesClientTests
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetRequiredStatusChecksContextsMethod : IDisposable
|
||||
public class TheGetAllRequiredStatusChecksContextsMethod : IDisposable
|
||||
{
|
||||
IRepositoryBranchesClient _client;
|
||||
RepositoryContext _userRepoContext;
|
||||
|
||||
public TheGetRequiredStatusChecksContextsMethod()
|
||||
public TheGetAllRequiredStatusChecksContextsMethod()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
_client = github.Repository.Branch;
|
||||
@@ -630,7 +630,7 @@ public class RepositoryBranchesClientTests
|
||||
{
|
||||
var repoOwner = _userRepoContext.RepositoryOwner;
|
||||
var repoName = _userRepoContext.RepositoryName;
|
||||
var requiredStatusChecksContexts = await _client.GetRequiredStatusChecksContexts(repoOwner, repoName, "master");
|
||||
var requiredStatusChecksContexts = await _client.GetAllRequiredStatusChecksContexts(repoOwner, repoName, "master");
|
||||
|
||||
Assert.NotNull(requiredStatusChecksContexts);
|
||||
Assert.Equal(2, requiredStatusChecksContexts.Count);
|
||||
@@ -640,7 +640,7 @@ public class RepositoryBranchesClientTests
|
||||
public async Task GetsRequiredStatusChecksContextsWithRepositoryId()
|
||||
{
|
||||
var repoId = _userRepoContext.RepositoryId;
|
||||
var requiredStatusChecksContexts = await _client.GetRequiredStatusChecksContexts(repoId, "master");
|
||||
var requiredStatusChecksContexts = await _client.GetAllRequiredStatusChecksContexts(repoId, "master");
|
||||
|
||||
Assert.NotNull(requiredStatusChecksContexts);
|
||||
Assert.Equal(2, requiredStatusChecksContexts.Count);
|
||||
|
||||
@@ -200,48 +200,6 @@ public class TeamsClientTests
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetMembershipMethod
|
||||
{
|
||||
readonly Team team;
|
||||
|
||||
public TheGetMembershipMethod()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
team = github.Organization.Team.GetAll(Helper.Organization).Result.First();
|
||||
}
|
||||
|
||||
[OrganizationTest]
|
||||
public async Task FailsWhenAuthenticatedWithBadCredentials()
|
||||
{
|
||||
var github = Helper.GetBadCredentialsClient();
|
||||
|
||||
var e = await Assert.ThrowsAsync<AuthorizationException>(
|
||||
() => github.Organization.Team.GetMembership(team.Id, Helper.UserName));
|
||||
Assert.Equal(HttpStatusCode.Unauthorized, e.StatusCode);
|
||||
}
|
||||
|
||||
[OrganizationTest]
|
||||
public async Task GetsIsMemberWhenAuthenticated()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var membership = await github.Organization.Team.GetMembership(team.Id, Helper.UserName);
|
||||
|
||||
Assert.Equal(TeamMembership.Active, membership);
|
||||
}
|
||||
|
||||
[OrganizationTest]
|
||||
public async Task GetsIsMemberFalseForNonMemberWhenAuthenticated()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var membership = await github.Organization.Team.GetMembership(team.Id, "foo");
|
||||
|
||||
Assert.Equal(TeamMembership.NotFound, membership);
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetMembershipDetailsMethod : IDisposable
|
||||
{
|
||||
private readonly IGitHubClient _github;
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace Octokit.Tests.Integration
|
||||
try
|
||||
{
|
||||
var client = new GitHubClient(connection);
|
||||
client.Organization.Team.AddMembership(teamId, login).Wait(TimeSpan.FromSeconds(15));
|
||||
client.Organization.Team.AddOrEditMembership(teamId, login, new UpdateTeamMembership(TeamRole.Member)).Wait(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
@@ -44,52 +44,6 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetAllMethod
|
||||
{
|
||||
[Fact]
|
||||
public async Task RequestsTheCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new OrganizationsClient(connection);
|
||||
|
||||
await client.GetAll("username");
|
||||
|
||||
connection.Received().GetAll<Organization>(Arg.Is<Uri>(u => u.ToString() == "users/username/orgs"), Args.ApiOptions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RequestsTheCorrectUrlWithApiOptions()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new OrganizationsClient(connection);
|
||||
|
||||
var options = new ApiOptions
|
||||
{
|
||||
StartPage = 1,
|
||||
PageCount = 1,
|
||||
PageSize = 1
|
||||
};
|
||||
|
||||
await client.GetAll("username", options);
|
||||
|
||||
connection.Received().GetAll<Organization>(Arg.Is<Uri>(u => u.ToString() == "users/username/orgs"), options);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullArguments()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new OrganizationsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll((string)null));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, ApiOptions.None));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("username", null));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll(""));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", ApiOptions.None));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetAllForUserMethod
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -213,49 +213,6 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheAddMembershipMethod
|
||||
{
|
||||
[Fact]
|
||||
public async Task RequestsTheCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
|
||||
var client = new TeamsClient(connection);
|
||||
|
||||
await client.AddMembership(1, "user");
|
||||
|
||||
connection.Received().Put<Dictionary<string, string>>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"),
|
||||
Args.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AllowsEmptyBody()
|
||||
{
|
||||
var connection = Substitute.For<IConnection>();
|
||||
|
||||
var apiConnection = new ApiConnection(connection);
|
||||
|
||||
var client = new TeamsClient(apiConnection);
|
||||
|
||||
await client.AddMembership(1, "user");
|
||||
|
||||
connection.Received().Put<Dictionary<string, string>>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"),
|
||||
Arg.Is<object>(u => u == RequestBody.Empty));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullOrEmptyLogin()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new TeamsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.AddMembership(1, null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.AddMembership(1, ""));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheAddOrEditMembershipMethod
|
||||
{
|
||||
[Fact]
|
||||
@@ -304,27 +261,6 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetMembershipMethod
|
||||
{
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullLogin()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new TeamsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetMembership(1, null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonEmptyLogin()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new TeamsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetMembership(1, ""));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetMembershipDetailsMethod
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Octokit.Tests.Reactive
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetAllMethod
|
||||
public class TheGetAllForUserMethod
|
||||
{
|
||||
[Fact]
|
||||
public void RequestsTheCorrectUrl()
|
||||
@@ -48,9 +48,9 @@ namespace Octokit.Tests.Reactive
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableOrganizationsClient(gitHubClient);
|
||||
|
||||
client.GetAll("username");
|
||||
client.GetAllForUser("username");
|
||||
|
||||
gitHubClient.Received().Organization.GetAll("username");
|
||||
gitHubClient.Received().Organization.GetAllForUser("username");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -66,9 +66,9 @@ namespace Octokit.Tests.Reactive
|
||||
PageSize = 1
|
||||
};
|
||||
|
||||
client.GetAll("username", options);
|
||||
client.GetAllForUser("username", options);
|
||||
|
||||
gitHubClient.Received().Organization.GetAll("username", options);
|
||||
gitHubClient.Received().Organization.GetAllForUser("username", options);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -77,12 +77,12 @@ namespace Octokit.Tests.Reactive
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableOrganizationsClient(gitHubClient);
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAll((string)null));
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAll(null, ApiOptions.None));
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAll("username", null));
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAllForUser((string)null));
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAllForUser(null, ApiOptions.None));
|
||||
Assert.Throws<ArgumentNullException>(() => client.GetAllForUser("username", null));
|
||||
|
||||
Assert.Throws<ArgumentException>(() => client.GetAll(""));
|
||||
Assert.Throws<ArgumentException>(() => client.GetAll("", ApiOptions.None));
|
||||
Assert.Throws<ArgumentException>(() => client.GetAllForUser(""));
|
||||
Assert.Throws<ArgumentException>(() => client.GetAllForUser("", ApiOptions.None));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,24 +58,6 @@ namespace Octokit
|
||||
Justification = "Method makes a network request")]
|
||||
Task<IReadOnlyList<Organization>> GetAllForCurrent(ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the specified user's <see cref="Organization"/>s.</returns>
|
||||
[Obsolete("Please use IOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
Task<IReadOnlyList<Organization>> GetAll(string user);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">The login of the user</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the specified user's <see cref="Organization"/>s.</returns>
|
||||
[Obsolete("Please use IOrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
Task<IReadOnlyList<Organization>> GetAll(string user, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
|
||||
@@ -13,12 +13,6 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
public interface IPullRequestsClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Client for managing review comments.
|
||||
/// </summary>
|
||||
[Obsolete("Please use IPullRequestsClient.ReviewComment instead. This method will be removed in a future version")]
|
||||
IPullRequestReviewCommentsClient Comment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing reviews.
|
||||
/// </summary>
|
||||
|
||||
@@ -207,29 +207,6 @@ namespace Octokit
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
Task<bool> DeleteRequiredStatusChecks(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusCheckContexts instead")]
|
||||
Task<IReadOnlyList<string>> GetRequiredStatusChecksContexts(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusCheckContexts instead")]
|
||||
Task<IReadOnlyList<string>> GetRequiredStatusChecksContexts(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
@@ -492,29 +469,6 @@ namespace Octokit
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
Task<bool> DeleteProtectedBranchRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
@@ -607,29 +561,6 @@ namespace Octokit
|
||||
/// <param name="teams">List of teams to remove</param>
|
||||
Task<IReadOnlyList<Team>> DeleteProtectedBranchTeamRestrictions(long repositoryId, string branch, BranchProtectionTeamCollection teams);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(string owner, string name, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(long repositoryId, string branch);
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
|
||||
@@ -12,29 +12,6 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
public interface IRepositoryTrafficClient
|
||||
{
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
Task<IReadOnlyList<RepositoryTrafficReferrer>> GetReferrers(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
Task<IReadOnlyList<RepositoryTrafficReferrer>> GetReferrers(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[ExcludeFromPaginationApiOptionsConventionTest("Pagination not supported by GitHub API (tested 29/08/2017)")]
|
||||
Task<IReadOnlyList<RepositoryTrafficReferrer>> GetAllReferrers(string owner, string name);
|
||||
|
||||
@@ -46,23 +23,6 @@ namespace Octokit
|
||||
[ExcludeFromPaginationApiOptionsConventionTest("Pagination not supported by GitHub API (tested 29/08/2017)")]
|
||||
Task<IReadOnlyList<RepositoryTrafficReferrer>> GetAllReferrers(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
Task<IReadOnlyList<RepositoryTrafficPath>> GetPaths(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
Task<IReadOnlyList<RepositoryTrafficPath>> GetPaths(long repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
|
||||
@@ -139,17 +139,6 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
Task Delete(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The team identifier.</param>
|
||||
/// <param name="login">The user to add to the team.</param>
|
||||
[Obsolete("Please use AddOrEditMembership instead")]
|
||||
Task<TeamMembership> AddMembership(int id, string login);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
@@ -172,15 +161,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>
|
||||
[Obsolete("Please use GetMembershipDetails instead")]
|
||||
Task<TeamMembership> GetMembership(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"/>.
|
||||
|
||||
@@ -74,36 +74,6 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<Organization>(ApiUrls.UserOrganizations(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">The login of the user</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the specified user's <see cref="Organization"/>s.</returns>
|
||||
[Obsolete("Please use OrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
public Task<IReadOnlyList<Organization>> GetAll(string user)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(user, nameof(user));
|
||||
|
||||
return GetAll(user, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">The login of the user</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the specified user's <see cref="Organization"/>s.</returns>
|
||||
[Obsolete("Please use OrganizationsClient.GetAllForUser() instead. This method will be removed in a future version")]
|
||||
public Task<IReadOnlyList<Organization>> GetAll(string user, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(user, nameof(user));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<Organization>(ApiUrls.UserOrganizations(user), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Organization" />s for the specified user.
|
||||
/// </summary>
|
||||
|
||||
@@ -20,12 +20,6 @@ namespace Octokit
|
||||
ReviewRequest = new PullRequestReviewRequestsClient(apiConnection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing review comments.
|
||||
/// </summary>
|
||||
[Obsolete("Please use PullRequestsClient.ReviewComment instead. This method will be removed in a future version")]
|
||||
public IPullRequestReviewCommentsClient Comment { get { return this.ReviewComment; } }
|
||||
|
||||
/// <summary>
|
||||
/// Client for managing reviews.
|
||||
/// </summary>
|
||||
|
||||
@@ -361,35 +361,6 @@ namespace Octokit
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
public Task<IReadOnlyList<string>> GetRequiredStatusChecksContexts(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllRequiredStatusChecksContexts(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllRequiredStatusChecksContexts instead")]
|
||||
public Task<IReadOnlyList<string>> GetRequiredStatusChecksContexts(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllRequiredStatusChecksContexts(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the required status checks contexts for the specified branch
|
||||
/// </summary>
|
||||
@@ -862,35 +833,6 @@ namespace Octokit
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
public Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchTeamRestrictions(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchTeamRestrictions instead")]
|
||||
public Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchTeamRestrictions(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get team restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
@@ -1035,35 +977,6 @@ namespace Octokit
|
||||
return ApiConnection.Delete<IReadOnlyList<Team>>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams, AcceptHeaders.ProtectedBranchesApiPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
public Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(string owner, string name, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchUserRestrictions(owner, name, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch">API documentation</a> for more details
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="branch">The name of the branch</param>
|
||||
[Obsolete("Please use GetAllProtectedBranchUserRestrictions instead")]
|
||||
public Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(long repositoryId, string branch)
|
||||
{
|
||||
return GetAllProtectedBranchUserRestrictions(repositoryId, branch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user restrictions for the specified branch (applies only to Organization owned repositories)
|
||||
/// </summary>
|
||||
|
||||
@@ -10,29 +10,6 @@ namespace Octokit
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
public Task<IReadOnlyList<RepositoryTrafficPath>> GetPaths(long repositoryId)
|
||||
{
|
||||
return GetAllPaths(repositoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-paths</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllPaths instead")]
|
||||
public Task<IReadOnlyList<RepositoryTrafficPath>> GetPaths(string owner, string name)
|
||||
{
|
||||
return GetAllPaths(owner, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 popular contents over the last 14 days
|
||||
/// </summary>
|
||||
@@ -57,29 +34,6 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<RepositoryTrafficPath>(ApiUrls.RepositoryTrafficPaths(owner, name), AcceptHeaders.RepositoryTrafficApiPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
public Task<IReadOnlyList<RepositoryTrafficReferrer>> GetReferrers(long repositoryId)
|
||||
{
|
||||
return GetAllReferrers(repositoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/repos/traffic/#list-referrers</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
[Obsolete("Please use GetAllReferrers instead")]
|
||||
public Task<IReadOnlyList<RepositoryTrafficReferrer>> GetReferrers(string owner, string name)
|
||||
{
|
||||
return GetAllReferrers(owner, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List the top 10 referrers over the last 14 days
|
||||
/// </summary>
|
||||
|
||||
@@ -181,35 +181,6 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<User>(endpoint, request.ToParametersDictionary(), AcceptHeaders.NestedTeamsPreview, options);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
[Obsolete("Please use GetMembershipDetails instead")]
|
||||
public async Task<TeamMembership> GetMembership(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, nameof(login));
|
||||
|
||||
var endpoint = ApiUrls.TeamMember(id, login);
|
||||
|
||||
Dictionary<string, string> response;
|
||||
|
||||
try
|
||||
{
|
||||
response = await ApiConnection.Get<Dictionary<string, string>>(endpoint, null, AcceptHeaders.NestedTeamsPreview).ConfigureAwait(false);
|
||||
}
|
||||
catch (NotFoundException)
|
||||
{
|
||||
return TeamMembership.NotFound;
|
||||
}
|
||||
|
||||
return response["state"] == "active"
|
||||
? TeamMembership.Active
|
||||
: TeamMembership.Pending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the user with the given <paramref name="login"/>
|
||||
/// is a member of the team with the given <paramref name="id"/>.
|
||||
@@ -268,42 +239,6 @@ namespace Octokit
|
||||
return ApiConnection.Delete(endpoint, new object(), AcceptHeaders.NestedTeamsPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The team identifier.</param>
|
||||
/// <param name="login">The user to add to the team.</param>
|
||||
[Obsolete("Please use AddOrEditMembership instead")]
|
||||
public async Task<TeamMembership> AddMembership(int id, string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, nameof(login));
|
||||
|
||||
var endpoint = ApiUrls.TeamMember(id, login);
|
||||
|
||||
Dictionary<string, string> response;
|
||||
|
||||
try
|
||||
{
|
||||
response = await ApiConnection.Put<Dictionary<string, string>>(endpoint, RequestBody.Empty).ConfigureAwait(false);
|
||||
}
|
||||
catch (NotFoundException)
|
||||
{
|
||||
return TeamMembership.NotFound;
|
||||
}
|
||||
|
||||
if (response == null || !response.ContainsKey("state"))
|
||||
{
|
||||
return TeamMembership.NotFound;
|
||||
}
|
||||
|
||||
return response["state"] == "active"
|
||||
? TeamMembership.Active
|
||||
: TeamMembership.Pending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
|
||||
/// </summary>
|
||||
|
||||
@@ -69,27 +69,6 @@ namespace Octokit
|
||||
return "orgs/{0}/repos".FormatUri(organization);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> that returns all of the organizations for the currently logged in user.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use ApiUrls.UserOrganizations() instead. This method will be removed in a future version")]
|
||||
public static Uri Organizations()
|
||||
{
|
||||
return _currentUserOrganizationsUrl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> that returns all of the organizations for the specified login.
|
||||
/// </summary>
|
||||
/// <param name="login">The login for the user</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Please use ApiUrls.UserOrganizations() instead. This method will be removed in a future version")]
|
||||
public static Uri Organizations(string login)
|
||||
{
|
||||
return "users/{0}/orgs".FormatUri(login);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> that returns all of the organizations for the currently logged in user.
|
||||
/// </summary>
|
||||
|
||||
@@ -64,21 +64,6 @@ namespace Octokit
|
||||
EnforceAdmins = enforceAdmins;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a BranchProtection update request
|
||||
/// </summary>
|
||||
/// <param name="requiredStatusChecks">Specifies the requested status check settings. Pass null to disable status checks</param>
|
||||
/// <param name="restrictions">Specifies the requested push access restrictions (applies only to Organization owned repositories). Pass null to disable push access restrictions</param>
|
||||
/// <param name="enforceAdmins">Specifies whether the protections applied to this branch also apply to repository admins</param>
|
||||
[Obsolete("This constructor will be removed for housekeeping purposes, please use another ctor")]
|
||||
public BranchProtectionSettingsUpdate(BranchProtectionRequiredStatusChecksUpdate requiredStatusChecks, BranchProtectionPushRestrictionsUpdate restrictions, bool enforceAdmins)
|
||||
{
|
||||
RequiredStatusChecks = requiredStatusChecks;
|
||||
RequiredPullRequestReviews = null;
|
||||
Restrictions = restrictions;
|
||||
EnforceAdmins = enforceAdmins;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a BranchProtection update request
|
||||
/// </summary>
|
||||
|
||||
@@ -22,15 +22,6 @@ namespace Octokit
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Login for the user that this issue should be assigned to.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise.
|
||||
/// </remarks>
|
||||
[Obsolete("Please use Assignees property. This property will no longer be supported by the GitHub API and will be removed in a future version")]
|
||||
public string Assignee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of logins for the multiple users that this issue should be assigned to
|
||||
/// </summary>
|
||||
|
||||
@@ -32,15 +32,6 @@ namespace Octokit
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Login for the user that this issue should be assigned to.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise.
|
||||
/// </remarks>
|
||||
[Obsolete("Please use Assignees property. This property will no longer be supported by the GitHub API and will be removed in a future version")]
|
||||
public string Assignee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of logins for the multiple users that this issue should be assigned to
|
||||
/// </summary>
|
||||
|
||||
@@ -19,18 +19,6 @@ namespace Octokit
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateTeam"/> class.
|
||||
/// </summary>
|
||||
/// <param name="name">The updated team name.</param>
|
||||
/// <param name="permission">The permission.</param>
|
||||
[Obsolete("This constructor will be removed for housekeeping purposes")]
|
||||
public UpdateTeam(string name, Permission permission)
|
||||
{
|
||||
Name = name;
|
||||
Permission = permission;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the team (required).
|
||||
/// </summary>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[Obsolete("Please use TeamMembershipDetails response class instead")]
|
||||
public enum TeamMembership
|
||||
{
|
||||
NotFound = 0,
|
||||
Pending = 1,
|
||||
Active = 2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user