class GitHub::Client

Overview

The basic class which represents a GitHub client / user the client will be used to send REST requests to the GitHub API.

client = GitHub::Client.new(username: "TheOnlyArtz", token: "4f10YOU8654d442b5be610054e9sWISH7a813c4")

With this client you will be able to make API requests to GitHub

Included Modules

Defined in:

githubcr/client.cr

Constructors

Instance Method Summary

Instance methods inherited from module GitHub::REST::Issues

add_issue_assignees(owner : String, repository : String, issue_number : Int32, payload : AssigneePayload) : Issue add_issue_assignees, add_labels_to_issue(owner : String, repository : String, issue_number : Int32, payload : IssueLabelPayload) : Array(Issue::Label) add_labels_to_issue, can_assignee_be_assigned?(owner : String, repository : String, assignee : String) : Nil can_assignee_be_assigned?, create_issue(owner : String, repository : String, payload : IssuePayload) : Issue create_issue, create_issue_comment(owner : String, repository : String, issue_number : Int32, payload : CommentPayload) : Issue::Comment create_issue_comment, create_label(owner : String, repository : String, payload : LabelPayload) : Issue::Label create_label, delete_issue_comment(owner : String, repository : String, comment_id : Int32) : Nil delete_issue_comment, delete_label(owner : String, repository : String, name : String) : Nil delete_label, edit_issue_comment(owner : String, repository : String, issue_number : Int32, payload : CommentPayload) : Issue::Comment edit_issue_comment, edit_label(owner : String, repository : String, payload : LabelPayload) : Issue::Label edit_label, get_comment(owner : String, repository : String, comment_id : Int32) : Issue::Comment get_comment, get_event get_event, get_issue(owner : String, repository : String, issue_number : Int32) : Issue get_issue, get_issue_labels(owner : String, repository : String, issue_number : Int32) : Array(Issue::Label) get_issue_labels, get_label(owner : String, repository : String, name : String) : Issue::Label get_label, get_milestone_issues_labels(owner : String, repository : String, milestone_number : Int32) : Array(Issue::Label) get_milestone_issues_labels, get_repository_labels(owner : String, repository : String) : Array(Issue::Label) get_repository_labels, list_issue_assignees(owner : String, repository : String) : Array(User) list_issue_assignees, list_issue_comments(owner : String, repository : String, issue_number : Int23) : Array(Issue::Comment) list_issue_comments, list_issue_events list_issue_events, list_my_assigned_issues list_my_assigned_issues, list_my_issues list_my_issues, list_my_org_assigned_issues list_my_org_assigned_issues, list_repo_issues list_repo_issues, list_repository_comments(owner : String, repository : String) : Array(Issue::Comment) list_repository_comments, list_repository_events list_repository_events, lock_issue(owner : String, repository : String, issue_number : Int32, payload : IssueLockPayload | Nil = nil) : Nil lock_issue, remove_all_labels_from_issue(owner : String, repository : String, issue_number : Int32) : Nil remove_all_labels_from_issue, remove_issue_assignees(owner : String, repository : String, issue_number : Int32, payload : AssigneePayload) : Issue remove_issue_assignees, remove_label_from_issue(owner : String, repository : String, issue_number : Int32, name : String) : Array(Issue::Label) remove_label_from_issue, replace_all_labels_in_issue(owner : String, repository : String, issue_number, payload : IssueLabelPayload) : Array(Issue::Label) replace_all_labels_in_issue, unlock_issue(owner : String, repository : String, issue_number : Int32) : Nil unlock_issue, update_issue(owner : String, repository : String, payload : IssuePayload) : Issue update_issue

Instance methods inherited from module GitHub::REST::Installations

add_repo_to_installation(installation_id : String, repository_id : String) : Nil add_repo_to_installation, create_content_attachment(token : String, content_reference_id : String, payload : ContentAttachmentPayload) : Installations::ContentAttachment create_content_attachment, create_installation_token(token : String, installation_id : String, payload : TokenInstallationPayload) : InstallationToken create_installation_token, delete_installation(token : String, installation_id : String) : Nil delete_installation, get_installation(token : String, installation_id : String) : Installation get_installation, get_org_installation(token : String, organization : String) : Installation get_org_installation, get_repo_installation(token : String, owner : String, repository : String) : Installation get_repo_installation, get_this_app_installations(token : String) : Installation get_this_app_installations, get_user_installation(token : String, username : String) : Installation get_user_installation, list_accessible_repos(token : String, installation_id : String) : Installation::InstallationRepositories list_accessible_repos, list_repositories_installations(token : String) : Installation::InstallationRepositories list_repositories_installations, list_user_installations(token : String) : Installation::InstallationUsers list_user_installations, remove_repo_from_installation(installation_id : String, repository_id : String) : Nil remove_repo_from_installation, revoke_installation_token(token : String) : Nil revoke_installation_token

Instance methods inherited from module GitHub::REST::GitHubApps

create_app_from_manifest(code : String) : GitHubApp create_app_from_manifest, get_github_app(name : String) : GitHubApp get_github_app, get_this_app(token : String) : GitHubApp get_this_app

Instance methods inherited from module GitHub::REST::WorkflowRuns

cancel_workflow(owner : String, repository : String, run_id : String) : Nil cancel_workflow, get_workflow_run(owner : String, repository : String, run_id : String) : WorkflowRun::WorkflowRunData get_workflow_run, list_repository_workflow_runs(owner : String, repository : String) : WorkflowRun list_repository_workflow_runs, list_workflow_run_logs list_workflow_run_logs, list_workflow_runs(owner : String, repository : String, workflow_id : String) : WorkflowRun list_workflow_runs, rerun_workflow(owner : String, repository : String, run_id : String) : Nil rerun_workflow

Instance methods inherited from module GitHub::REST::WorkflowJobs

get_workflow_job(owner : String, repository : String, job_id : String) : WorkflowJob get_workflow_job, get_workflow_job_logs get_workflow_job_logs, list_workflow_run_jobs(owner : String, repository : String, run_id : String) : WorkflowRunJobs list_workflow_run_jobs

Instance methods inherited from module GitHub::REST::Workflows

get_workflows(owner : String, repository : String, workflow_id : String) : Workflow get_workflows, list_workflows(owner : String, repository : String) : Workflow list_workflows

Instance methods inherited from module GitHub::REST::SelfHostedWorkflowRunners

create_registration_token(owner : String, repository : String) : RegistrationToken create_registration_token, create_remove_token(owner : String, repository : String) : RegistrationToken create_remove_token, get_self_hosted_runner(owner : String, repository : String, runner_id : String) : SeldHostedRunners::SelfHostedRunnerData get_self_hosted_runner, list_self_hosted_runner_downloads(owner : String, repository : String) : Array(SelfHostedRunners::SelfHostedRunnerData) list_self_hosted_runner_downloads, list_self_hosted_runners(owner : String, repository : String) : SelfHostedRunners list_self_hosted_runners, remove_self_hosted_runner(owner : String, repository : String, runner_id : String) : Nil remove_self_hosted_runner

Instance methods inherited from module GitHub::REST::Secrets

create_or_update_secret create_or_update_secret, delete_secret(owner : String, repository : String, name : String) : Nil delete_secret, get_my_public_key(owner : String, repository : String) : PublicKey get_my_public_key, get_secret(owner : String, repository : String, name : String) : Secrets::SecretData get_secret, list_secrets(owner : String, repository : String) : Secrets list_secrets

Instance methods inherited from module GitHub::REST::Artifacts

delete_artifact(owner : String, repository : String, artifact_id : String) : Nil delete_artifact, download_artifact download_artifact, get_artifact(owner : String, repository : String, artifact_id : String) : Artifact get_artifact, list_repo_artifacts(owner : String, repository : String) : Artifact list_repo_artifacts, list_run_artifacts(owner : String, repository : String, run_id : String) : Artifact list_run_artifacts

Instance methods inherited from module GitHub::REST::Trees

create_tree(owner : String, repository : String, payload : TreePayload) : Tree create_tree, get_tree(owner : String, repository : String, tree_sha : String) : Tree get_tree

Instance methods inherited from module GitHub::REST::Tags

create_tag(owner : String, repository : String, payload : TagPayload) : Tag create_tag, get_tag(owner : String, repository : String, tag_sha : String) : Tag get_tag

Instance methods inherited from module GitHub::REST::References

create_reference(owner : String, repository : String, payload : RefPayload) : Ref create_reference, delete_reference(owner : String, repository : String, reference : String) : Nil delete_reference, delete_reference_tag delete_reference_tag, get_matching_references(owner : String, repository : String, reference : String) : Array(Ref) get_matching_references, get_reference(owner : String, repository : String, reference : String) : Ref get_reference, update_reference(owner : String, repository : String, payload : RefPatchPayload) : Ref update_reference

Instance methods inherited from module GitHub::REST::Commits

create_commit(owner : String, repository : String, payload : CommitPayload) : Commit create_commit, get_commit(owner : String, repository : String, commit_sha : String) : Commit get_commit

Instance methods inherited from module GitHub::REST::Blobs

create_blob(owner : String, repository : String, payload : BlobPayload) create_blob, get_blob(owner : String, repository : String, file_sha : String) : Blob get_blob

Instance methods inherited from module GitHub::REST::Gists

create_gist(payload : GistPayload) : Gist create_gist, delete_gist(id : String) : Nil delete_gist, fork_gist(id : String) : Gist fork_gist, get_all_gists(owner : String) : Array(Gist) get_all_gists, get_gist(id : String) : Gist get_gist, get_gist_revision(id : String, sha : String) : Gist get_gist_revision, get_my_gists : Array(Gist) get_my_gists, get_public_gists(since : Time) : Array(Gist) get_public_gists, get_starred_gists(since : Time) : Array(Gist) get_starred_gists, gist_starred?(id : String) : Bool gist_starred?, list_gist_commits(id : String) : Array(GistCommit) list_gist_commits, star_gist(id : String) : Nil star_gist, unstar_gist(id : String) : Nil unstar_gist, update_gist(id : String, payload : GistPayload) : Gist update_gist

Constructor Detail

def self.new(username : String, access_token : String) #

[View source]

Instance Method Detail

def get_auth_header #

This method will generate the auth header to GitHub


[View source]