예제 #1
0
        private async Task LoadMembersAsync(CachedOrg cachedOrg)
        {
            await GitHubClient.PrintProgressAsync(Log, "Loading owner list");

            var owners = await GitHubClient.Organization.Member.GetAll(cachedOrg.Name, OrganizationMembersFilter.All, OrganizationMembersRole.Admin, ApiOptions.None);

            await GitHubClient.PrintProgressAsync(Log, "Loading non-owner list");

            var nonOwners = await GitHubClient.Organization.Member.GetAll(cachedOrg.Name, OrganizationMembersFilter.All, OrganizationMembersRole.Member, ApiOptions.None);

            foreach (var owner in owners)
            {
                var member = new CachedUser
                {
                    Login    = owner.Login,
                    IsMember = true,
                    IsOwner  = true
                };
                cachedOrg.Users.Add(member);
            }

            foreach (var nonOwner in nonOwners)
            {
                var member = new CachedUser
                {
                    Login    = nonOwner.Login,
                    IsMember = true,
                    IsOwner  = false
                };
                cachedOrg.Users.Add(member);
            }
        }
예제 #2
0
        private async Task LoadExternalUsersAsync(CachedOrg cachedOrg)
        {
            await GitHubClient.PrintProgressAsync(Log, "Loading outside collaborators");

            var outsideCollaborators = await GitHubClient.Organization.OutsideCollaborator.GetAll(cachedOrg.Name, OrganizationMembersFilter.All, ApiOptions.None);

            foreach (var user in outsideCollaborators)
            {
                var cachedUser = new CachedUser
                {
                    Login    = user.Login,
                    IsOwner  = false,
                    IsMember = false
                };
                cachedOrg.Users.Add(cachedUser);
            }
        }