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