Repository
NOTE: Intended instantiation via GitHubClient/organisation
get_repository
/get_repositories
methods, rather than direct initialisation.
This class represents aa Repository within GitHub.
It may be used to perform actions within the context of the Repository.
Attributes:
Name | Type | Description |
---|---|---|
identifier |
int
|
Unique identifier of the Repository |
client |
Session
|
Session used to make requests to the RESTAPI, intended to be passed in when instance is created via Client/Organisation |
base_url |
str
|
Base URL we should use for querying the RESTAPI within the context of the Repository |
full_name |
str
|
Full name of the Repository, in the form of owner/repository |
private |
bool
|
True if the Repository is private, else False |
__eq__(other)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
object
|
Object to compare against |
required |
Returns:
Type | Description |
---|---|
bool
|
True if instances are equal, False otherwise. |
__hash__()
Returns:
Type | Description |
---|---|
int
|
Unique int representation of instance. |
__str__()
Returns:
Type | Description |
---|---|
str
|
Information string representation |
get_pull_request(identifier)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
int
|
The ID of the pull request we are querying for |
required |
Examples:
get_pull_request(22)
Returns:
Type | Description |
---|---|
Union[PullRequest, None]
|
PullRequest instance if found, else None |
get_pull_requests(state='open')
Examples:
get_pull_requests()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
PullRequestState
|
Filter PullRequest instances to be of this state |
'open'
|
Returns:
Type | Description |
---|---|
List[PullRequest]
|
All PullRequests for the Repository, empty if none found or instance otherwise doesn't have access to, or fails to query, the RESTAPI. |