Add client for organization outside collaborators (#1639)

* Add client for organization outside collaborators

* Add unit/integration tests

* Add methods for removing an outside collaborator

* Add unit/integration tests

* Add new Put method to Connection which accepts a preview header

* Add methods for converting an org member to an outside collaborator

* Fix copy paste errors in new exceptions

* According to API docs, a 403 should be returned if the member is not a member of the org, but a 404 is actually returned

* Add unit/integration tests

* Remove unused using directives

* Got a bit overzealous with my removal of using directives

* Fix integration tests by using the configured Organization and test username rather than henrik's :)

* Remove ApiOptions overloads as it isn't currently supported

* Fix XML doc grammar

* Fix failing unit tests

* Missed a couple of nameof replacements
This commit is contained in:
Henrik Andersson
2017-08-07 10:20:57 +10:00
committed by Ryan Gribble
parent cda714bef6
commit 1d1ca0a572
18 changed files with 1224 additions and 0 deletions
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Octokit.Reactive
{
public interface IObservableOrganizationOutsideCollaboratorsClient
{
/// <summary>
/// List all users who are outside collaborators of an organization. An outside collaborator is a user that
/// is not a member of the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators">API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <returns>The users</returns>
IObservable<User> GetAll(string org);
/// <summary>
/// List all users who are outside collaborators of an organization. An outside collaborator is a user that
/// is not a member of the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators">API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <param name="filter">The filter to use when getting the users, <see cref="OrganizationMembersFilter"/></param>
/// <returns>The users</returns>
IObservable<User> GetAll(string org, OrganizationMembersFilter filter);
/// <summary>
/// Removes a user as an outside collaborator from the organization, this will remove them from all repositories
/// within the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator">API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <param name="user">The login of the user</param>
/// <returns></returns>
IObservable<bool> Delete(string org, string user);
/// <summary>
/// Converts an organization member to an outside collaborator,
/// when an organization member is converted to an outside collaborator,
/// they'll only have access to the repositories that their current team membership allows.
/// The user will no longer be a member of the organization.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/outside_collaborators/#convert-member-to-outside-collaborator"> API documentation</a>
/// for more information.
/// </remarks>
/// <param name="org">The login for the organization</param>
/// <param name="user">The login for the user</param>
/// <returns></returns>
IObservable<bool> ConvertFromMember(string org, string user);
}
}