diff --git a/Octokit.Reactive/Clients/ObservableTeamsClient.cs b/Octokit.Reactive/Clients/ObservableTeamsClient.cs index cf21e0c93b..1711f78c6f 100644 --- a/Octokit.Reactive/Clients/ObservableTeamsClient.cs +++ b/Octokit.Reactive/Clients/ObservableTeamsClient.cs @@ -47,6 +47,8 @@ public IObservable Get(int id) /// A list of the orgs's teams s. public IObservable GetAll(string org) { + Ensure.ArgumentNotNullOrEmptyString(org, "org"); + return GetAll(org, ApiOptions.None); } @@ -126,6 +128,9 @@ public IObservable GetAllMembers(int id, ApiOptions options) /// Newly created public IObservable Create(string org, NewTeam team) { + Ensure.ArgumentNotNullOrEmptyString(org, "org"); + Ensure.ArgumentNotNull(team, "team"); + return _client.Create(org, team).ToObservable(); } @@ -136,6 +141,8 @@ public IObservable Create(string org, NewTeam team) /// Updated public IObservable Update(int id, UpdateTeam team) { + Ensure.ArgumentNotNull(team, "team"); + return _client.Update(id, team).ToObservable(); } @@ -161,6 +168,8 @@ public IObservable Delete(int id) /// A result indicating the membership status public IObservable AddMembership(int id, string login) { + Ensure.ArgumentNotNullOrEmptyString(login, "login"); + return _client.AddMembership(id, login).ToObservable(); } @@ -175,6 +184,8 @@ public IObservable AddMembership(int id, string login) /// if the user was removed from the team; otherwise. public IObservable RemoveMembership(int id, string login) { + Ensure.ArgumentNotNullOrEmptyString(login, "login"); + return _client.RemoveMembership(id, login).ToObservable(); } @@ -188,6 +199,8 @@ public IObservable RemoveMembership(int id, string login) [Obsolete("Use GetMembership(id, login) to detect pending memberships")] public IObservable IsMember(int id, string login) { + Ensure.ArgumentNotNullOrEmptyString(login, "login"); + return _client.IsMember(id, login).ToObservable(); } @@ -200,6 +213,8 @@ public IObservable IsMember(int id, string login) /// A result indicating the membership status public IObservable GetMembership(int id, string login) { + Ensure.ArgumentNotNullOrEmptyString(login, "login"); + return _client.GetMembership(id, login).ToObservable(); } @@ -240,6 +255,9 @@ public IObservable GetAllRepositories(int id, ApiOptions options) /// if the repository was added to the team; otherwise. public IObservable AddRepository(int id, string organization, string repoName) { + Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); + Ensure.ArgumentNotNullOrEmptyString(repoName, "repoName"); + return _client.AddRepository(id, organization, repoName).ToObservable(); } @@ -251,6 +269,9 @@ public IObservable AddRepository(int id, string organization, string repoN /// public IObservable RemoveRepository(int id, string organization, string repoName) { + Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); + Ensure.ArgumentNotNullOrEmptyString(repoName, "repoName"); + return _client.RemoveRepository(id, organization, repoName).ToObservable(); } @@ -266,6 +287,8 @@ public IObservable RemoveRepository(int id, string organization, string re /// if the repository is managed by the given team; otherwise. public IObservable IsRepositoryManagedByTeam(int id, string owner, string repo) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(repo, "repo"); return _client.IsRepositoryManagedByTeam(id, owner, repo).ToObservable(); } }