GitHub class

The Main GitHub Client

Example

  var github = new GitHub(auth: new Authentication.withToken("SomeToken"));
  // Use the Client

Constructors

GitHub({Authentication? auth, String endpoint = 'https://api.github.com', Client? client})
Creates a new GitHub instance.

Properties

activity ActivityService
Service for activity related methods of the GitHub API.
no setter
auth Authentication?
Authentication Information
getter/setter pair
authorizations AuthorizationsService
Service for autorizations related methods of the GitHub API.
no setter
checks ChecksService
Service containing methods to interact with the Checks API.
no setter
client → Client
HTTP Client
final
endpoint String
API Endpoint
final
gists GistsService
Service for gist related methods of the GitHub API.
no setter
git GitService
Service for git data related methods of the GitHub API.
no setter
hashCode int
The hash code for this object.
no setterinherited
issues IssuesService
Service for issues related methods of the GitHub API.
no setter
misc MiscService
Service for misc related methods of the GitHub API.
no setter
organizations OrganizationsService
Service for organization related methods of the GitHub API.
no setter
pullRequests PullRequestsService
Service for pull requests related methods of the GitHub API.
no setter
rateLimitLimit int?
The maximum number of requests that the consumer is permitted to make per hour.
no setter
rateLimitRemaining int?
The number of requests remaining in the current rate limit window.
no setter
rateLimitReset DateTime?
The time at which the current rate limit window resets.
no setter
repositories RepositoriesService
Service for repository related methods of the GitHub API.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
Service for search related methods of the GitHub API.
no setter
urlShortener UrlShortenerService
Service to provide a handy method to access GitHub's url shortener.
no setter
users UsersService
Service for user related methods of the GitHub API.
no setter

Methods

dispose() → void
Disposes of this GitHub Instance. No other methods on this instance should be called after this method is called.
getJSON<S, T>(String path, {int? statusCode, void fail(Response response)?, Map<String, String>? headers, Map<String, String>? params, JSONConverter<S, T>? convert, String? preview}) Future<T>
Handles Get Requests that respond with JSON path can either be a path like '/repos' or a full url. statusCode is the expected status code. If it is null, it is ignored. If the status code that the response returns is not the status code you provide then the fail function will be called with the HTTP Response. If you don't throw an error or break out somehow, it will go into some error checking that throws exceptions when it finds a 404 or 401. If it doesn't find a general HTTP Status Code for errors, it throws an Unknown Error. headers are HTTP Headers. If it doesn't exist, the 'Accept' and 'Authorization' headers are added. params are query string parameters. convert is a simple function that is passed this GitHub instance and a JSON object. The future will pass the object returned from this function to the then method. The default convert function returns the input object.
handleStatusCode(Response response) → void
Internal method to handle status codes
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patchJSON<S, T>(String path, {int? statusCode, void fail(Response response)?, Map<String, String>? headers, Map<String, dynamic>? params, JSONConverter<S, T>? convert, dynamic body, String? preview}) Future<T>
Handles PATCH Requests that respond with JSON
postJSON<S, T>(String path, {int? statusCode, void fail(Response response)?, Map<String, String>? headers, Map<String, dynamic>? params, JSONConverter<S, T>? convert, dynamic body, String? preview}) Future<T>
Handles Post Requests that respond with JSON
putJSON<S, T>(String path, {int? statusCode, void fail(Response response)?, Map<String, String>? headers, Map<String, dynamic>? params, JSONConverter<S, T>? convert, dynamic body, String? preview}) Future<T>
Handles PUT Requests that respond with JSON
request(String method, String path, {Map<String, String>? headers, Map<String, dynamic>? params, dynamic body, int? statusCode, void fail(Response response)?, String? preview}) Future<Response>
Handles Authenticated Requests in an easy to understand way.
requestJson<S, T>(String method, String path, {int? statusCode, void fail(Response response)?, Map<String, String>? headers, Map<String, dynamic>? params, JSONConverter<S, T?>? convert, dynamic body, String? preview}) Future<T>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited