/// <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> public IObservable <Team> GetProtectedBranchTeamRestrictions(string owner, string name, string branch) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(branch, "branch"); return(_client.GetProtectedBranchTeamRestrictions(owner, name, branch).ToObservable().SelectMany(x => x)); }
public async Task GetsProtectedBranchTeamRestrictionsForOrgRepo() { var repoOwner = _orgRepoContext.RepositoryContext.RepositoryOwner; var repoName = _orgRepoContext.RepositoryContext.RepositoryName; var restrictions = await _client.GetProtectedBranchTeamRestrictions(repoOwner, repoName, "master"); Assert.NotNull(restrictions); Assert.Equal(1, restrictions.Count); }