Post to an endpooint in the GitHub API. Args: github_org (str): The name of the GitHub organization to search. repo (str): The name of the repository to search. endpoint (str): The endpoint for the resource.
(self, github_org: str, repo: str, endpoint: str, payload: dict)
| 81 | return requests.get(url, headers=self.headers, params=query_params, timeout=timeout) |
| 82 | |
| 83 | def post(self, github_org: str, repo: str, endpoint: str, payload: dict): |
| 84 | """Post to an endpooint in the GitHub API. |
| 85 | |
| 86 | Args: |
| 87 | github_org (str): |
| 88 | The name of the GitHub organization to search. |
| 89 | repo (str): |
| 90 | The name of the repository to search. |
| 91 | endpoint (str): |
| 92 | The endpoint for the resource. For example, issues. This means we'd be |
| 93 | making a request to https://api.github.com/repos/{github_org}/{repo}/issues. |
| 94 | payload (dict): |
| 95 | The payload to post. |
| 96 | |
| 97 | Returns: |
| 98 | requests.models.Response |
| 99 | """ |
| 100 | url = self._construct_url(github_org, repo, endpoint) |
| 101 | return requests.post(url, headers=self.headers, json=payload) |
no test coverage detected