Ejemplo n.º 1
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, nameof(connection));

            Connection = connection;
            var apiConnection = new ApiConnection(connection);

            Activity      = new ActivitiesClient(apiConnection);
            Authorization = new AuthorizationsClient(apiConnection);
            Enterprise    = new EnterpriseClient(apiConnection);
            Gist          = new GistsClient(apiConnection);
            Git           = new GitDatabaseClient(apiConnection);
            GitHubApps    = new GitHubAppsClient(apiConnection);
            Issue         = new IssuesClient(apiConnection);
            Migration     = new MigrationClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(apiConnection);
            Oauth         = new OauthClient(connection);
            Organization  = new OrganizationsClient(apiConnection);
            PullRequest   = new PullRequestsClient(apiConnection);
            Repository    = new RepositoriesClient(apiConnection);
            Search        = new SearchClient(apiConnection);
            User          = new UsersClient(apiConnection);
            Reaction      = new ReactionsClient(apiConnection);
            Check         = new ChecksClient(apiConnection);
        }
Ejemplo n.º 2
0
        public List<Developer> page(int page = 1, int size = 40)
        {
            var credentials = new Octokit.Credentials(ConfigurationManager.AppSettings["user_git"], ConfigurationManager.AppSettings["pass_git"]);
            Octokit.Connection connection = new Connection(new ProductHeaderValue("DevStore"));
            Octokit.ApiConnection apiConn = new ApiConnection(connection);
            Octokit.SearchUsersRequest search = new SearchUsersRequest("a");
            search.AccountType = AccountSearchType.User;
            search.PerPage = size;
            search.Page = page;
            Octokit.UsersClient userCliente = new UsersClient(apiConn);
            Octokit.SearchClient searchUserService = new SearchClient(apiConn);
            SearchUsersResult usersResult = searchUserService.SearchUsers(search).Result;
            Octokit.GitHubClient gitClient = new GitHubClient(connection);
            Octokit.UsersClient userClient = new UsersClient(apiConn);
            List<Developer> developers = (from userGit in usersResult.Items
                                          select new Developer
                                          {
                                              User = userGit.Login,
                                              UrlAvatar = userGit.AvatarUrl.ToString(),
                                              TotalRepo = userGit.PublicRepos,
                                              TotalFollowers = userGit.Followers,
                                              Price = ((userGit.PublicRepos * pesoTotalRepository) + (userGit.Followers * pesoTotalFollowers)) / (pesoTotalRepository + pesoTotalFollowers)
                                          }).ToList();

            return developers;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);

            Activity      = new ActivitiesClient(apiConnection);
            Authorization = new AuthorizationsClient(apiConnection);
            Deployment    = new DeploymentsClient(apiConnection);
            Enterprise    = new EnterpriseClient(apiConnection);
            Gist          = new GistsClient(apiConnection);
            Git           = new GitDatabaseClient(apiConnection);
            Issue         = new IssuesClient(apiConnection);
            Migration     = new MigrationClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification  = new NotificationsClient(apiConnection);
            Oauth         = new OauthClient(connection);
            Organization  = new OrganizationsClient(apiConnection);
            PullRequest   = new PullRequestsClient(apiConnection);
            Repository    = new RepositoriesClient(apiConnection);
            Search        = new SearchClient(apiConnection);
            SshKey        = new SshKeysClient(apiConnection);
            User          = new UsersClient(apiConnection);
            Reaction      = new ReactionsClient(apiConnection);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests.</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);

            Authorization = new AuthorizationsClient(apiConnection);
            Issue         = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification  = new NotificationsClient(apiConnection);
            Organization  = new OrganizationsClient(apiConnection);
            Repository    = new RepositoriesClient(apiConnection);
            Release       = new ReleasesClient(apiConnection);
            User          = new UsersClient(apiConnection);
            SshKey        = new SshKeysClient(apiConnection);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests.</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);
            Authorization = new AuthorizationsClient(apiConnection);
            Issue = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification = new NotificationsClient(apiConnection);
            Organization = new OrganizationsClient(apiConnection);
            Repository = new RepositoriesClient(apiConnection);
            Release = new ReleasesClient(apiConnection);
            User = new UsersClient(apiConnection);
            SshKey = new SshKeysClient(apiConnection);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);
            Authorization = new AuthorizationsClient(apiConnection);
            Activity = new ActivitiesClient(apiConnection);
            Issue = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification = new NotificationsClient(apiConnection);
            Oauth = new OauthClient(connection);
            Organization = new OrganizationsClient(apiConnection);
            PullRequest = new PullRequestsClient(apiConnection);
            Repository = new RepositoriesClient(apiConnection);
            Gist = new GistsClient(apiConnection);
            Release = new ReleasesClient(apiConnection);
            User = new UsersClient(apiConnection);
            SshKey = new SshKeysClient(apiConnection);
            GitDatabase = new GitDatabaseClient(apiConnection);
            Search = new SearchClient(apiConnection);
            Deployment = new DeploymentsClient(apiConnection);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);
            Activity = new ActivitiesClient(apiConnection);
            Authorization = new AuthorizationsClient(apiConnection);
            Enterprise = new EnterpriseClient(apiConnection);
            Gist = new GistsClient(apiConnection);
            Git = new GitDatabaseClient(apiConnection);
            Issue = new IssuesClient(apiConnection);
            Migration = new MigrationClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Oauth = new OauthClient(connection);
            Organization = new OrganizationsClient(apiConnection);
            PullRequest = new PullRequestsClient(apiConnection);
            Repository = new RepositoriesClient(apiConnection);
            Search = new SearchClient(apiConnection);
            User = new UsersClient(apiConnection);
            Reaction = new ReactionsClient(apiConnection);
        }