App and Installation API Objects¶
This section of the documentation covers the representations of various objects related to the Apps API.
- class github3.apps.App(json, session: GitHubSession)¶
An object representing a GitHub App.
New in version 1.2.0.
See also
- GitHub Apps
Documentation for Apps on GitHub
- GitHub Apps API Documentation
API documentation of what’s available about an App.
This object has the following attributes:
- created_at¶
A
datetime
object representing the day and time the App was created.
- description¶
The description of the App provided by the owner.
- events¶
An array of the event types an App receives
- external_url¶
The URL provided for the App by the owner.
- html_url¶
The HTML URL provided for the App by the owner.
- id¶
The unique identifier for the App. This is useful in cases where you may want to authenticate either as an App or as a specific installation of an App.
- name¶
The display name of the App that the user sees.
- node_id¶
A base64-encoded blob returned by the GitHub API for who knows what reason.
- permissions¶
A dictionary describing the permissions the App has
- slug¶
A short string used to identify the App
- updated_at¶
A
datetime
object representing the day and time the App was last updated.
- as_dict()¶
Return the attributes for this object as a dictionary.
This is equivalent to calling:
json.loads(obj.as_json())
- Returns
this object’s attributes serialized to a dictionary
- Return type
dict
- as_json()¶
Return the json data for this object.
This is equivalent to calling:
json.dumps(obj.as_dict())
- Returns
this object’s attributes as a JSON string
- Return type
str
- classmethod from_dict(json_dict, session)¶
Return an instance of this class formed from
json_dict
.
- classmethod from_json(json, session)¶
Return an instance of this class formed from
json
.
- new_session()¶
Generate a new session.
- Returns
A brand new session
- Return type
- property ratelimit_remaining¶
Number of requests before GitHub imposes a ratelimit.
- Returns
int
- refresh(conditional: bool = False) GitHubCore ¶
Re-retrieve the information for this object.
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.repositories_by('kennethreitz')]
Without the return value, that would be an array of
None
’s and you would otherwise have to do:repos = [r for i in g.repositories_by('kennethreitz')] [r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
- Parameters
conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs
- Returns
self
- class github3.apps.Installation(json, session: GitHubSession)¶
An installation of a GitHub App either on a User or Org.
New in version 1.2.0.
This has the following attributes:
- access_tokens_url¶
- account¶
- app_id¶
- created_at¶
- events¶
- html_url¶
- id¶
- permissions¶
- repositories_url¶
- repository_selection¶
- single_file_name¶
- target_id¶
- target_type¶
- updated_at¶
- as_dict()¶
Return the attributes for this object as a dictionary.
This is equivalent to calling:
json.loads(obj.as_json())
- Returns
this object’s attributes serialized to a dictionary
- Return type
dict
- as_json()¶
Return the json data for this object.
This is equivalent to calling:
json.dumps(obj.as_dict())
- Returns
this object’s attributes as a JSON string
- Return type
str
- classmethod from_dict(json_dict, session)¶
Return an instance of this class formed from
json_dict
.
- classmethod from_json(json, session)¶
Return an instance of this class formed from
json
.
- new_session()¶
Generate a new session.
- Returns
A brand new session
- Return type
- property ratelimit_remaining¶
Number of requests before GitHub imposes a ratelimit.
- Returns
int
- refresh(conditional: bool = False) GitHubCore ¶
Re-retrieve the information for this object.
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.repositories_by('kennethreitz')]
Without the return value, that would be an array of
None
’s and you would otherwise have to do:repos = [r for i in g.repositories_by('kennethreitz')] [r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
- Parameters
conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs
- Returns
self