private static Repository BuildRepository(Octokit.Repository repository) { return(new Repository { Id = repository.Id, Owner = repository.Owner.Login, Name = repository.Name, Url = repository.Url }); }
private static AccountType GetAccountType(Octokit.Repository repository) { switch (repository.Owner.Type) { case Octokit.AccountType.User: return(AccountType.User); case Octokit.AccountType.Organization: return(AccountType.Organization); case Octokit.AccountType.Bot: throw new InvalidOperationException("A bot cannot own a repository."); default: throw new ArgumentOutOfRangeException(); } }