From 03fce7001c6e8b0035853472c60fb5bf794ccd06 Mon Sep 17 00:00:00 2001 From: Haacked Date: Thu, 7 Nov 2013 10:05:35 -0800 Subject: [PATCH] Add Member property to observable Orgs client --- .../Clients/IObservableEventsClient.cs | 10 +++---- .../IObservableOrganizationMembersClient.cs | 28 ++++++++---------- .../Clients/IObservableOrganizationsClient.cs | 7 ++++- .../Clients/IObservableUsersClient.cs | 2 +- .../Clients/ObservableEventsClient.cs | 10 +++---- .../ObservableOrganizationMembersClient.cs | 29 ++++++++++--------- .../Clients/ObservableOrganizationsClient.cs | 25 ++++++++++++++++ Octokit/Clients/EventsClient.cs | 10 +++---- Octokit/Clients/IEventsClient.cs | 10 +++---- Octokit/Clients/IOrganizationMembersClient.cs | 24 +++++++-------- Octokit/Clients/IOrganizationsClient.cs | 3 ++ Octokit/Clients/IUsersClient.cs | 2 +- Octokit/Clients/OrganizationMembersClient.cs | 24 +++++++-------- Octokit/Clients/UsersClient.cs | 2 +- Octokit/Helpers/ApiUrls.cs | 10 +++---- 15 files changed, 114 insertions(+), 82 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableEventsClient.cs b/Octokit.Reactive/Clients/IObservableEventsClient.cs index 5dbf588f..ced8b7ff 100644 --- a/Octokit.Reactive/Clients/IObservableEventsClient.cs +++ b/Octokit.Reactive/Clients/IObservableEventsClient.cs @@ -52,7 +52,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. IObservable GetUserReceived(string user); @@ -62,7 +62,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. IObservable GetUserReceivedPublic(string user); @@ -72,7 +72,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the s that a particular user has performed. IObservable GetUserPerformed(string user); @@ -82,7 +82,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the public s that a particular user has performed. IObservable GetUserPerformedPublic(string user); @@ -92,7 +92,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-for-an-organization /// - /// The name of the user + /// The login of the user /// The name of the organization /// All the public s that are associated with an organization. IObservable GetForAnOrganization(string user, string organization); diff --git a/Octokit.Reactive/Clients/IObservableOrganizationMembersClient.cs b/Octokit.Reactive/Clients/IObservableOrganizationMembersClient.cs index aa803168..78a5b7f4 100644 --- a/Octokit.Reactive/Clients/IObservableOrganizationMembersClient.cs +++ b/Octokit.Reactive/Clients/IObservableOrganizationMembersClient.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Reactive; -using System.Text; -using System.Threading.Tasks; namespace Octokit.Reactive { @@ -27,7 +23,7 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// + /// The login for the organization. /// IObservable GetAll(string org); @@ -35,7 +31,7 @@ namespace Octokit.Reactive /// List all users who have publicized their membership of the organization. /// /// http://developer.github.com/v3/orgs/members/#public-members-list - /// + /// The login for the organization. /// IObservable GetPublic(string org); @@ -46,8 +42,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// IObservable CheckMember(string org, string user); @@ -58,8 +54,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// IObservable CheckMemberPublic(string org, string user); @@ -72,8 +68,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// IObservable Delete(string org, string user); @@ -85,8 +81,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// IObservable Publicize(string org, string user); @@ -98,8 +94,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// IObservable Conceal(string org, string user); } diff --git a/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs b/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs index 7fb43aa4..a5ff6e14 100644 --- a/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs +++ b/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs @@ -5,6 +5,11 @@ namespace Octokit.Reactive { public interface IObservableOrganizationsClient { + /// + /// Returns a client to manage members of an organization. + /// + IObservableOrganizationMembersClient Member { get; } + /// /// Returns the specified organization. /// @@ -25,7 +30,7 @@ namespace Octokit.Reactive /// /// Returns all the organizations for the specified user /// - /// + /// The login for the user. /// IObservable GetAll(string user); } diff --git a/Octokit.Reactive/Clients/IObservableUsersClient.cs b/Octokit.Reactive/Clients/IObservableUsersClient.cs index a671df61..2786a6fc 100644 --- a/Octokit.Reactive/Clients/IObservableUsersClient.cs +++ b/Octokit.Reactive/Clients/IObservableUsersClient.cs @@ -23,7 +23,7 @@ namespace Octokit.Reactive /// /// Update the specified . /// - /// + /// The login for the user. /// Thrown if the client is not authenticated. /// A IObservable Update(UserUpdate user); diff --git a/Octokit.Reactive/Clients/ObservableEventsClient.cs b/Octokit.Reactive/Clients/ObservableEventsClient.cs index df5d8fdc..ccfb6ebb 100644 --- a/Octokit.Reactive/Clients/ObservableEventsClient.cs +++ b/Octokit.Reactive/Clients/ObservableEventsClient.cs @@ -81,7 +81,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. public IObservable GetUserReceived(string user) { @@ -96,7 +96,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. public IObservable GetUserReceivedPublic(string user) { @@ -111,7 +111,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the s that a particular user has performed. public IObservable GetUserPerformed(string user) { @@ -126,7 +126,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the public s that a particular user has performed. public IObservable GetUserPerformedPublic(string user) { @@ -141,7 +141,7 @@ namespace Octokit.Reactive /// /// http://developer.github.com/v3/activity/events/#list-events-for-an-organization /// - /// The name of the user + /// The login of the user /// The name of the organization /// All the public s that are associated with an organization. public IObservable GetForAnOrganization(string user, string organization) diff --git a/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs b/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs index 2aa18de2..b448a58a 100644 --- a/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs +++ b/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Reactive; using System.Reactive.Threading.Tasks; using Octokit.Reactive.Internal; @@ -11,6 +10,10 @@ namespace Octokit.Reactive readonly IOrganizationMembersClient _client; readonly IConnection _connection; + /// + /// Initializes a new Organization Members API client. + /// + /// An used to make the requests public ObservableOrganizationMembersClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); @@ -37,7 +40,7 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// + /// The login for the organization. /// public IObservable GetAll(string org) { @@ -50,7 +53,7 @@ namespace Octokit.Reactive /// List all users who have publicized their membership of the organization. /// /// http://developer.github.com/v3/orgs/members/#public-members-list - /// + /// The login for the organization. /// public IObservable GetPublic(string org) { @@ -66,8 +69,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public IObservable CheckMember(string org, string user) { @@ -84,8 +87,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public IObservable CheckMemberPublic(string org, string user) { @@ -104,8 +107,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public IObservable Delete(string org, string user) { @@ -123,8 +126,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public IObservable Publicize(string org, string user) { @@ -142,8 +145,8 @@ namespace Octokit.Reactive /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public IObservable Conceal(string org, string user) { diff --git a/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs b/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs index 1db9f492..ff40d801 100644 --- a/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs @@ -9,14 +9,30 @@ namespace Octokit.Reactive readonly IOrganizationsClient _client; readonly IConnection _connection; + /// + /// Initializes a new Organization API client. + /// + /// An used to make the requests public ObservableOrganizationsClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); + Member = new ObservableOrganizationMembersClient(client); + _client = client.Organization; _connection = client.Connection; } + /// + /// Returns a client to manage members of an organization. + /// + public IObservableOrganizationMembersClient Member { get; private set; } + + /// + /// Returns the specified organization. + /// + /// The login of the specified organization, + /// public IObservable Get(string org) { Ensure.ArgumentNotNullOrEmptyString(org, "org"); @@ -24,11 +40,20 @@ namespace Octokit.Reactive return _client.Get(org).ToObservable(); } + /// + /// Returns all the organizations for the current user. + /// + /// public IObservable GetAllForCurrent() { return _connection.GetAndFlattenAllPages(ApiUrls.Organizations()); } + /// + /// Returns all the organizations for the specified user + /// + /// The login for the user. + /// public IObservable GetAll(string user) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); diff --git a/Octokit/Clients/EventsClient.cs b/Octokit/Clients/EventsClient.cs index 45a21471..f21ed214 100644 --- a/Octokit/Clients/EventsClient.cs +++ b/Octokit/Clients/EventsClient.cs @@ -77,7 +77,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. public Task> GetUserReceived(string user) { @@ -92,7 +92,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. public Task> GetUserReceivedPublic(string user) { @@ -107,7 +107,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the s that a particular user has performed. public Task> GetUserPerformed(string user) { @@ -122,7 +122,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the public s that a particular user has performed. public Task> GetUserPerformedPublic(string user) { @@ -137,7 +137,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-for-an-organization /// - /// The name of the user + /// The login of the user /// The name of the organization /// All the public s that are associated with an organization. public Task> GetForAnOrganization(string user, string organization) diff --git a/Octokit/Clients/IEventsClient.cs b/Octokit/Clients/IEventsClient.cs index 9f436818..378cc91a 100644 --- a/Octokit/Clients/IEventsClient.cs +++ b/Octokit/Clients/IEventsClient.cs @@ -53,7 +53,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. Task> GetUserReceived(string user); @@ -63,7 +63,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received /// - /// The name of the user + /// The login of the user /// All the s that a particular user has received. Task> GetUserReceivedPublic(string user); @@ -73,7 +73,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the s that a particular user has performed. Task> GetUserPerformed(string user); @@ -83,7 +83,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user /// - /// The name of the user + /// The login of the user /// All the public s that a particular user has performed. Task> GetUserPerformedPublic(string user); @@ -93,7 +93,7 @@ namespace Octokit /// /// http://developer.github.com/v3/activity/events/#list-events-for-an-organization /// - /// The name of the user + /// The login of the user /// The name of the organization /// All the public s that are associated with an organization. Task> GetForAnOrganization(string user, string organization); diff --git a/Octokit/Clients/IOrganizationMembersClient.cs b/Octokit/Clients/IOrganizationMembersClient.cs index a4cbdace..60d82812 100644 --- a/Octokit/Clients/IOrganizationMembersClient.cs +++ b/Octokit/Clients/IOrganizationMembersClient.cs @@ -23,7 +23,7 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// + /// The login for the organization. /// Task> GetAll(string org); @@ -31,7 +31,7 @@ namespace Octokit /// List all users who have publicized their membership of the organization. /// /// http://developer.github.com/v3/orgs/members/#public-members-list - /// + /// The login for the organization. /// Task> GetPublic(string org); @@ -42,8 +42,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// Task CheckMember(string org, string user); @@ -54,8 +54,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// Task CheckMemberPublic(string org, string user); @@ -68,8 +68,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// Task Delete(string org, string user); @@ -81,8 +81,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// Task Publicize(string org, string user); @@ -94,8 +94,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// Task Conceal(string org, string user); } diff --git a/Octokit/Clients/IOrganizationsClient.cs b/Octokit/Clients/IOrganizationsClient.cs index 01d8c94b..8f65c0af 100644 --- a/Octokit/Clients/IOrganizationsClient.cs +++ b/Octokit/Clients/IOrganizationsClient.cs @@ -14,6 +14,9 @@ namespace Octokit /// public interface IOrganizationsClient { + /// + /// Returns a client to manage members of an organization. + /// IOrganizationMembersClient Member { get; } /// diff --git a/Octokit/Clients/IUsersClient.cs b/Octokit/Clients/IUsersClient.cs index 6e96c525..0d8767ec 100644 --- a/Octokit/Clients/IUsersClient.cs +++ b/Octokit/Clients/IUsersClient.cs @@ -24,7 +24,7 @@ namespace Octokit /// /// Update the specified . /// - /// + /// The login for the user. /// Thrown if the client is not authenticated. /// A Task Update(UserUpdate user); diff --git a/Octokit/Clients/OrganizationMembersClient.cs b/Octokit/Clients/OrganizationMembersClient.cs index dcc4aa71..ba474286 100644 --- a/Octokit/Clients/OrganizationMembersClient.cs +++ b/Octokit/Clients/OrganizationMembersClient.cs @@ -32,7 +32,7 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// + /// The login for the organization. /// public Task> GetAll(string org) { @@ -45,7 +45,7 @@ namespace Octokit /// List all users who have publicized their membership of the organization. /// /// http://developer.github.com/v3/orgs/members/#public-members-list - /// + /// The login for the organization. /// public Task> GetPublic(string org) { @@ -61,8 +61,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public async Task CheckMember(string org, string user) { @@ -94,8 +94,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public async Task CheckMemberPublic(string org, string user) { @@ -128,8 +128,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public Task Delete(string org, string user) { @@ -147,8 +147,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public async Task Publicize(string org, string user) { @@ -180,8 +180,8 @@ namespace Octokit /// See the API documentation /// for more information. /// - /// - /// + /// The login for the organization. + /// The login for the user. /// public Task Conceal(string org, string user) { diff --git a/Octokit/Clients/UsersClient.cs b/Octokit/Clients/UsersClient.cs index cb53c7d5..00a89a7b 100644 --- a/Octokit/Clients/UsersClient.cs +++ b/Octokit/Clients/UsersClient.cs @@ -46,7 +46,7 @@ namespace Octokit /// /// Update the specified . /// - /// + /// The login for the user. /// Thrown if the client is not authenticated. /// A public Task Update(UserUpdate user) diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index 734cddce..d280186f 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -433,7 +433,7 @@ namespace Octokit /// /// Returns the for the received events for a user. /// - /// The name of the user + /// The login of the user /// public static Uri ReceivedEvents(string user) { @@ -443,7 +443,7 @@ namespace Octokit /// /// Returns the for the received events for a user. /// - /// The name of the user + /// The login of the user /// Whether to return public events or not /// public static Uri ReceivedEvents(string user, bool isPublic) @@ -459,7 +459,7 @@ namespace Octokit /// /// Returns the for events performed by a user. /// - /// The name of the user + /// The login of the user /// public static Uri PerformedEvents(string user) { @@ -469,7 +469,7 @@ namespace Octokit /// /// Returns the for events performed by a user. /// - /// The name of the user + /// The login of the user /// Whether to return public events or not /// public static Uri PerformedEvents(string user, bool isPublic) @@ -485,7 +485,7 @@ namespace Octokit /// /// Returns the for events associated with an organization. /// - /// The name of the user + /// The login of the user /// The name of the organization /// public static Uri OrganizationEvents(string user, string organization)