Skip to content

Commit dd15d4e

Browse files
committed
Align more paths with OpenAPI spec
1 parent 64d1840 commit dd15d4e

File tree

14 files changed

+50
-33
lines changed

14 files changed

+50
-33
lines changed

doc/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,14 @@ def get_base_classes(class_definition: str) -> Iterable[str]:
368368
]:
369369
method = None
370370
isProperty = False
371-
if line.startswith(" :calls: `"):
371+
if line.startswith(" :calls: `") and method:
372372
for callee in line[16:].split(" or "):
373373
verb, url = callee[1:].split(" ")[0:2]
374374
if url not in methods:
375375
methods[url] = dict()
376376
if verb not in methods[url]:
377377
methods[url][verb] = set()
378378
methods[url][verb].add(":meth:`" + module + "." + githubObjectClass + "." + method + "`")
379-
method = None
380379

381380
methods["/markdown/raw"] = dict()
382381
methods["/markdown/raw"]["POST"] = ["Not implemented, see ``/markdown``"]

github/Deployment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def url(self) -> str:
191191

192192
def get_statuses(self) -> PaginatedList[github.DeploymentStatus.DeploymentStatus]:
193193
"""
194-
:calls: `GET /repos/{owner}/deployments/{deployment_id}/statuses <https://docs.github.com/en/rest/reference/repos#list-deployments>`_
194+
:calls: `GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses <https://docs.github.com/en/rest/reference/repos#list-deployments>`_
195195
"""
196196
return PaginatedList(
197197
github.DeploymentStatus.DeploymentStatus,
@@ -203,7 +203,7 @@ def get_statuses(self) -> PaginatedList[github.DeploymentStatus.DeploymentStatus
203203

204204
def get_status(self, id_: int) -> github.DeploymentStatus.DeploymentStatus:
205205
"""
206-
:calls: `GET /repos/{owner}/deployments/{deployment_id}/statuses/{status_id} <https://docs.github.com/en/rest/reference/repos#get-a-deployment>`_
206+
:calls: `GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} <https://docs.github.com/en/rest/reference/repos#get-a-deployment>`_
207207
"""
208208
assert isinstance(id_, int), id_
209209
headers, data = self._requester.requestJsonAndCheck(

github/Environment.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ def create_secret(self, secret_name: str, unencrypted_value: str) -> Secret:
182182
def get_secrets(self) -> PaginatedList[Secret]:
183183
"""
184184
Gets all repository secrets.
185+
186+
:calls: `GET /repos/{owner}/{repo}/environments/{environment_name}/secrets </repos/{owner}/{repo}/environments/{environment_name}/secrets>`_
187+
185188
"""
186189
return PaginatedList(
187190
github.Secret.Secret,
@@ -241,7 +244,7 @@ def get_variables(self) -> PaginatedList[Variable]:
241244

242245
def get_variable(self, variable_name: str) -> Variable:
243246
"""
244-
:calls: `GET /orgs/{org}/variables/{variable_name} <https://docs.github.com/en/rest/variables#get-an-organization-variable>`_
247+
:calls: `GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} <https://docs.github.com/rest/actions/variables#get-an-environment-variable>`_
245248
:param variable_name: string
246249
:rtype: Variable
247250
"""

github/GitRelease.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def upload_asset(
312312
self, path: str, label: str = "", content_type: Opt[str] = NotSet, name: Opt[str] = NotSet
313313
) -> github.GitReleaseAsset.GitReleaseAsset:
314314
"""
315-
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-assett>`__
315+
:calls: `POST /repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-assett>`__
316316
"""
317317
assert isinstance(path, str), path
318318
assert isinstance(label, str), label
@@ -348,7 +348,7 @@ def upload_asset_from_memory(
348348
349349
Unlike ``upload_asset()`` this method allows you to pass in a file-like object to upload.
350350
Note that this method is more strict and requires you to specify the ``name``, since there's no file name to infer these from.
351-
:calls: `POST https://<upload_url>/repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/reference/repos#upload-a-release-asset>`__
351+
:calls: `POST /repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/reference/repos#upload-a-release-asset>`__
352352
:param file_like: binary file-like object, such as those returned by ``open("file_name", "rb")``. At the very minimum, this object must implement ``read()``.
353353
:param file_size: int, size in bytes of ``file_like``
354354

github/Issue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def get_reactions(self) -> PaginatedList[Reaction]:
571571

572572
def get_sub_issues(self) -> PaginatedList[SubIssue]:
573573
"""
574-
:calls: `GET /repos/{owner}/{repo}/issues/{number}/sub_issues <https://docs.github.com/en/rest/issues/sub-issues?apiVersion=2022-11-28>`_
574+
:calls: `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues <https://docs.github.com/en/rest/issues/sub-issues?apiVersion=2022-11-28>`_
575575
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
576576
"""
577577
return PaginatedList(
@@ -584,7 +584,7 @@ def get_sub_issues(self) -> PaginatedList[SubIssue]:
584584

585585
def add_sub_issue(self, sub_issue: int | Issue) -> SubIssue:
586586
"""
587-
:calls: `POST /repos/{owner}/{repo}/issues/{number}/sub_issues <https://docs.github.com/en/rest/issues/sub-issues>`_
587+
:calls: `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues <https://docs.github.com/en/rest/issues/sub-issues>`_
588588
:param sub_issue: int (sub-issue ID) or Issue object. Note: Use sub_issue.id, not sub_issue.number
589589
:rtype: :class:`github.Issue.SubIssue`
590590
"""
@@ -607,7 +607,7 @@ def add_sub_issue(self, sub_issue: int | Issue) -> SubIssue:
607607

608608
def remove_sub_issue(self, sub_issue: int | Issue) -> SubIssue:
609609
"""
610-
:calls: `DELETE /repos/{owner}/{repo}/issues/{number}/sub_issue <https://docs.github.com/en/rest/issues/sub-issues>`_
610+
:calls: `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue <https://docs.github.com/en/rest/issues/sub-issues>`_
611611
:param sub_issue: int (sub-issue ID) or Issue object. Note: Use sub_issue.id, not sub_issue.number
612612
:rtype: :class:`github.Issue.SubIssue`
613613
"""
@@ -630,7 +630,7 @@ def remove_sub_issue(self, sub_issue: int | Issue) -> SubIssue:
630630

631631
def prioritize_sub_issue(self, sub_issue: int | Issue, after_sub_issue: int | Issue | None) -> SubIssue:
632632
"""
633-
:calls: `PATCH /repos/{owner}/{repo}/issues/{number}/sub_issues/priority <https://docs.github.com/en/rest/issues/sub-issues>`_
633+
:calls: `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority <https://docs.github.com/en/rest/issues/sub-issues>`_
634634
:param sub_issue: int (sub-issue ID) or Issue object. Note: Use sub_issue.id, not sub_issue.number
635635
:param after_sub_issue: int (sub-issue ID) or Issue object. Note: Use sub_issue.id, not sub_issue.number
636636
:rtype: :class:`github.Issue.SubIssue`

github/Organization.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ def create_secret(
886886
:param selected_repositories: list of repositrories that the secret will be available in
887887
:param secret_type: string options actions or dependabot
888888
889-
:calls: `PUT /orgs/{org}/{secret_type}/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret>`_
889+
:calls: `PUT /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/rest/actions/secrets#get-an-organization-secret>`_
890+
:calls: `PUT /orgs/{org}/dependabot/secrets/{secret_name} <https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret>`_
890891
"""
891892
assert isinstance(secret_name, str), secret_name
892893
assert isinstance(unencrypted_value, str), unencrypted_value
@@ -937,7 +938,9 @@ def get_secrets(self, secret_type: str = "actions") -> PaginatedList[Organizatio
937938
"""
938939
Gets all organization secrets :param secret_type: string options actions or dependabot :rtype:
939940
940-
:class:`PaginatedList` of :class:`github.OrganizationSecret.OrganizationSecret`
941+
:calls: `GET /orgs/{org}/actions/secrets <https://docs.github.com/rest/actions/secrets#list-organization-
942+
secrets>`_ :calls: `GET /orgs/{org}/dependabot/secrets
943+
<https://docs.github.com/rest/dependabot/secrets#list-organization-secrets>`_
941944
942945
"""
943946
assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot"
@@ -951,7 +954,8 @@ def get_secrets(self, secret_type: str = "actions") -> PaginatedList[Organizatio
951954

952955
def get_secret(self, secret_name: str, secret_type: str = "actions") -> OrganizationSecret:
953956
"""
954-
:calls: `GET /orgs/{org}/{secret_type}/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#get-an-organization-secret>`_
957+
:calls: `GET /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/rest/actions/secrets#get-an-organization-secret>`_
958+
:calls: `GET /orgs/{org}/dependabot/secrets/{secret_name} <https://docs.github.com/rest/actions/secrets#get-an-organization-secret>`_
955959
:param secret_name: string
956960
:param secret_type: string options actions or dependabot
957961
:rtype: github.OrganizationSecret.OrganizationSecret
@@ -1323,7 +1327,8 @@ def convert_to_outside_collaborator(self, member: NamedUser) -> None:
13231327

13241328
def get_public_key(self, secret_type: str = "actions") -> PublicKey:
13251329
"""
1326-
:calls: `GET /orgs/{org}/{secret_type}/secrets/public-key <https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key>`_
1330+
:calls: `GET /orgs/{org}/actions/secrets/public-key <http://docs.github.com/rest/actions/secrets#get-an-organization-public-key>`_
1331+
:calls: `GET /orgs/{org}/dependabot/secrets/public-key <http://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key>`_
13271332
:param secret_type: string options actions or dependabot
13281333
:rtype: :class:`github.PublicKey.PublicKey`
13291334
"""
@@ -1703,7 +1708,7 @@ def list_custom_property_values(
17031708
self, repository_query: Opt[str] = NotSet
17041709
) -> PaginatedList[RepositoryCustomPropertyValues]:
17051710
"""
1706-
:calls: `GET /orgs/{org}/properties <https://docs.github.com/en/rest/orgs/custom-properties#list-custom-property-values-for-an-organization>`_
1711+
:calls: `GET /orgs/{org}/properties/values <https://docs.github.com/en/rest/orgs/custom-properties#list-custom-property-values-for-an-organization>`_
17071712
:rtype: :class:`PaginatedList` of dict
17081713
"""
17091714
return PaginatedList(
@@ -1718,7 +1723,7 @@ def create_custom_property_values(
17181723
) -> None:
17191724
"""
17201725
Create or update custom property values for organization repositories
1721-
:calls: `PATCH /orgs/{org}/properties <https://docs.github.com/en/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories>`_
1726+
:calls: `PATCH /orgs/{org}/properties/values <https://docs.github.com/en/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories>`_
17221727
:param repository_names: list of strings
17231728
:param properties: dict of string to string, list or None
17241729
:rtype: None

github/OrganizationSecret.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def edit(
7979
secret_type: str = "actions",
8080
) -> bool:
8181
"""
82-
:calls: `PATCH /orgs/{org}/{secret_type}/secrets/{variable_name} <https://docs.github.com/en/rest/reference/actions/secrets#update-an-organization-variable>`_
82+
:calls: `PATCH /orgs/{org}/actions/secrets/{secret_name} <https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret>`_
83+
:calls: `PATCH /orgs/{org}/dependabot/secrets/{secret_name} <https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret>`_
8384
:param variable_name: string
8485
:param value: string
8586
:param visibility: string

github/OrganizationVariable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def edit(
101101

102102
def add_repo(self, repo: Repository) -> bool:
103103
"""
104-
:calls: `PUT {org_url}/actions/variables/{name} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
104+
:calls: `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
105105
:param repo: github.Repository.Repository
106106
:rtype: bool
107107
"""
@@ -112,7 +112,7 @@ def add_repo(self, repo: Repository) -> bool:
112112

113113
def remove_repo(self, repo: Repository) -> bool:
114114
"""
115-
:calls: `DELETE {org_url}/actions/variables/{name} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
115+
:calls: `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} <https://docs.github.com/en/rest/actions/variables#add-selected-repository-to-an-organization-secret>`_
116116
:param repo: github.Repository.Repository
117117
:rtype: bool
118118
"""

github/ProjectCard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def get_content(
155155
) -> github.PullRequest.PullRequest | github.Issue.Issue | None:
156156
"""
157157
:calls: `GET /repos/{owner}/{repo}/pulls/{pull_number} <https://docs.github.com/en/rest/reference/pulls#get-a-pull-request>`_
158+
:calls: `GET /repos/{owner}/{repo}/issues/{pull_number} <https://docs.github.com/en/rest/reference/pulls#get-a-pull-request>`_
158159
"""
159160
assert content_type is NotSet or isinstance(content_type, str), content_type
160161
if self.content_url is None:

github/PullRequest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def get_review_comments(
694694

695695
def get_single_review_comments(self, id: int) -> PaginatedList[PullRequestComment]:
696696
"""
697-
:calls: `GET /repos/{owner}/{repo}/pulls/{pull_number}/review/{review_id}/comments <https://docs.github.com/en/rest/reference/pulls#reviews>`_
697+
:calls: `GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments <https://docs.github.com/en/rest/reference/pulls#reviews>`_
698698
"""
699699
assert isinstance(id, int), id
700700
return PaginatedList(

0 commit comments

Comments
 (0)