Skip to content

Commit c040a49

Browse files
authored
🐛 fix timeline reviewed event body type
1 parent fa650a2 commit c040a49

File tree

7 files changed

+1697
-470
lines changed

7 files changed

+1697
-470
lines changed

githubkit/rest/checks.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,11 @@
1212

1313
from githubkit.utils import UNSET, Unset, exclude_unset
1414

15-
from .types import (
16-
ReposOwnerRepoCheckSuitesPostBodyType,
17-
ReposOwnerRepoCheckRunsPostBodyOneof0Type,
18-
ReposOwnerRepoCheckRunsPostBodyOneof1Type,
19-
ReposOwnerRepoCheckRunsPostBodyPropOutputType,
20-
ReposOwnerRepoCheckSuitesPreferencesPatchBodyType,
21-
ReposOwnerRepoCheckRunsPostBodyPropActionsItemsType,
22-
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0Type,
23-
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1Type,
24-
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropOutputType,
25-
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropActionsItemsType,
26-
ReposOwnerRepoCheckSuitesPreferencesPatchBodyPropAutoTriggerChecksItemsType,
27-
)
2815
from .models import (
2916
CheckRun,
3017
BasicError,
3118
CheckSuite,
19+
EmptyObject,
3220
CheckAnnotation,
3321
CheckSuitePreference,
3422
ReposOwnerRepoCheckSuitesPostBody,
@@ -39,9 +27,20 @@
3927
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
4028
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
4129
ReposOwnerRepoCommitsRefCheckSuitesGetResponse200,
42-
ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
4330
ReposOwnerRepoCheckSuitesCheckSuiteIdCheckRunsGetResponse200,
44-
ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
31+
)
32+
from .types import (
33+
ReposOwnerRepoCheckSuitesPostBodyType,
34+
ReposOwnerRepoCheckRunsPostBodyOneof0Type,
35+
ReposOwnerRepoCheckRunsPostBodyOneof1Type,
36+
ReposOwnerRepoCheckRunsPostBodyPropOutputType,
37+
ReposOwnerRepoCheckSuitesPreferencesPatchBodyType,
38+
ReposOwnerRepoCheckRunsPostBodyPropActionsItemsType,
39+
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0Type,
40+
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1Type,
41+
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropOutputType,
42+
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropActionsItemsType,
43+
ReposOwnerRepoCheckSuitesPreferencesPatchBodyPropAutoTriggerChecksItemsType,
4544
)
4645

4746
if TYPE_CHECKING:
@@ -598,13 +597,13 @@ def rerequest_run(
598597
owner: str,
599598
repo: str,
600599
check_run_id: int,
601-
) -> "Response[ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201]":
600+
) -> "Response[EmptyObject]":
602601
url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
603602

604603
return self._github.request(
605604
"POST",
606605
url,
607-
response_model=ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
606+
response_model=EmptyObject,
608607
error_models={
609608
"403": BasicError,
610609
"422": BasicError,
@@ -617,13 +616,13 @@ async def async_rerequest_run(
617616
owner: str,
618617
repo: str,
619618
check_run_id: int,
620-
) -> "Response[ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201]":
619+
) -> "Response[EmptyObject]":
621620
url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
622621

623622
return await self._github.arequest(
624623
"POST",
625624
url,
626-
response_model=ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
625+
response_model=EmptyObject,
627626
error_models={
628627
"403": BasicError,
629628
"422": BasicError,
@@ -902,27 +901,27 @@ def rerequest_suite(
902901
owner: str,
903902
repo: str,
904903
check_suite_id: int,
905-
) -> "Response[ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201]":
904+
) -> "Response[EmptyObject]":
906905
url = f"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
907906

908907
return self._github.request(
909908
"POST",
910909
url,
911-
response_model=ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
910+
response_model=EmptyObject,
912911
)
913912

914913
async def async_rerequest_suite(
915914
self,
916915
owner: str,
917916
repo: str,
918917
check_suite_id: int,
919-
) -> "Response[ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201]":
918+
) -> "Response[EmptyObject]":
920919
url = f"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
921920

922921
return await self._github.arequest(
923922
"POST",
924923
url,
925-
response_model=ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
924+
response_model=EmptyObject,
926925
)
927926

928927
def list_for_ref(

githubkit/rest/code_scanning.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def list_alerts_for_enterprise(
7474
params=exclude_unset(params),
7575
response_model=List[CodeScanningOrganizationAlertItems],
7676
error_models={
77-
"403": BasicError,
7877
"404": BasicError,
7978
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
8079
},
@@ -113,7 +112,6 @@ async def async_list_alerts_for_enterprise(
113112
params=exclude_unset(params),
114113
response_model=List[CodeScanningOrganizationAlertItems],
115114
error_models={
116-
"403": BasicError,
117115
"404": BasicError,
118116
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
119117
},
@@ -152,7 +150,6 @@ def list_alerts_for_org(
152150
params=exclude_unset(params),
153151
response_model=List[CodeScanningOrganizationAlertItems],
154152
error_models={
155-
"403": BasicError,
156153
"404": BasicError,
157154
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
158155
},
@@ -191,7 +188,6 @@ async def async_list_alerts_for_org(
191188
params=exclude_unset(params),
192189
response_model=List[CodeScanningOrganizationAlertItems],
193190
error_models={
194-
"403": BasicError,
195191
"404": BasicError,
196192
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
197193
},

githubkit/rest/codespaces.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
OrgsOrgCodespacesSecretsSecretNamePutBody,
5151
ReposOwnerRepoCodespacesNewGetResponse200,
5252
ReposOwnerRepoCodespacesSecretsGetResponse200,
53-
UserCodespacesSecretsSecretNamePutResponse201,
5453
OrgsOrgMembersUsernameCodespacesGetResponse200,
5554
ReposOwnerRepoCodespacesMachinesGetResponse200,
5655
ReposOwnerRepoPullsPullNumberCodespacesPostBody,
@@ -59,8 +58,8 @@
5958
AppHookDeliveriesDeliveryIdAttemptsPostResponse202,
6059
UserCodespacesSecretsSecretNameRepositoriesPutBody,
6160
ReposOwnerRepoCodespacesDevcontainersGetResponse200,
61+
EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
6262
OrgsOrgCodespacesSecretsSecretNameRepositoriesPutBody,
63-
ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
6463
UserCodespacesSecretsSecretNameRepositoriesGetResponse200,
6564
OrgsOrgCodespacesSecretsSecretNameRepositoriesGetResponse200,
6665
)
@@ -915,6 +914,7 @@ def create_with_repo_for_authenticated_user(
915914
"401": BasicError,
916915
"403": BasicError,
917916
"404": BasicError,
917+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
918918
},
919919
)
920920

@@ -975,6 +975,7 @@ async def async_create_with_repo_for_authenticated_user(
975975
"401": BasicError,
976976
"403": BasicError,
977977
"404": BasicError,
978+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
978979
},
979980
)
980981

@@ -1244,7 +1245,7 @@ def create_or_update_repo_secret(
12441245
secret_name: str,
12451246
*,
12461247
data: ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType,
1247-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1248+
) -> "Response[EmptyObject]":
12481249
...
12491250

12501251
@overload
@@ -1257,7 +1258,7 @@ def create_or_update_repo_secret(
12571258
data: Unset = UNSET,
12581259
encrypted_value: Union[Unset, str] = UNSET,
12591260
key_id: Union[Unset, str] = UNSET,
1260-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1261+
) -> "Response[EmptyObject]":
12611262
...
12621263

12631264
def create_or_update_repo_secret(
@@ -1270,7 +1271,7 @@ def create_or_update_repo_secret(
12701271
Unset, ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType
12711272
] = UNSET,
12721273
**kwargs,
1273-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1274+
) -> "Response[EmptyObject]":
12741275
url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
12751276

12761277
if not kwargs:
@@ -1284,7 +1285,7 @@ def create_or_update_repo_secret(
12841285
"PUT",
12851286
url,
12861287
json=exclude_unset(json),
1287-
response_model=ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
1288+
response_model=EmptyObject,
12881289
)
12891290

12901291
@overload
@@ -1295,7 +1296,7 @@ async def async_create_or_update_repo_secret(
12951296
secret_name: str,
12961297
*,
12971298
data: ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType,
1298-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1299+
) -> "Response[EmptyObject]":
12991300
...
13001301

13011302
@overload
@@ -1308,7 +1309,7 @@ async def async_create_or_update_repo_secret(
13081309
data: Unset = UNSET,
13091310
encrypted_value: Union[Unset, str] = UNSET,
13101311
key_id: Union[Unset, str] = UNSET,
1311-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1312+
) -> "Response[EmptyObject]":
13121313
...
13131314

13141315
async def async_create_or_update_repo_secret(
@@ -1321,7 +1322,7 @@ async def async_create_or_update_repo_secret(
13211322
Unset, ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType
13221323
] = UNSET,
13231324
**kwargs,
1324-
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
1325+
) -> "Response[EmptyObject]":
13251326
url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
13261327

13271328
if not kwargs:
@@ -1335,7 +1336,7 @@ async def async_create_or_update_repo_secret(
13351336
"PUT",
13361337
url,
13371338
json=exclude_unset(json),
1338-
response_model=ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
1339+
response_model=EmptyObject,
13391340
)
13401341

13411342
def delete_repo_secret(
@@ -1426,6 +1427,7 @@ def create_with_pr_for_authenticated_user(
14261427
"401": BasicError,
14271428
"403": BasicError,
14281429
"404": BasicError,
1430+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
14291431
},
14301432
)
14311433

@@ -1491,6 +1493,7 @@ async def async_create_with_pr_for_authenticated_user(
14911493
"401": BasicError,
14921494
"403": BasicError,
14931495
"404": BasicError,
1496+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
14941497
},
14951498
)
14961499

@@ -1618,6 +1621,7 @@ def create_for_authenticated_user(
16181621
"401": BasicError,
16191622
"403": BasicError,
16201623
"404": BasicError,
1624+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
16211625
},
16221626
)
16231627

@@ -1691,6 +1695,7 @@ async def async_create_for_authenticated_user(
16911695
"401": BasicError,
16921696
"403": BasicError,
16931697
"404": BasicError,
1698+
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
16941699
},
16951700
)
16961701

@@ -1781,7 +1786,7 @@ async def async_get_secret_for_authenticated_user(
17811786
@overload
17821787
def create_or_update_secret_for_authenticated_user(
17831788
self, secret_name: str, *, data: UserCodespacesSecretsSecretNamePutBodyType
1784-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1789+
) -> "Response[EmptyObject]":
17851790
...
17861791

17871792
@overload
@@ -1793,7 +1798,7 @@ def create_or_update_secret_for_authenticated_user(
17931798
encrypted_value: Union[Unset, str] = UNSET,
17941799
key_id: str,
17951800
selected_repository_ids: Union[Unset, List[str]] = UNSET,
1796-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1801+
) -> "Response[EmptyObject]":
17971802
...
17981803

17991804
def create_or_update_secret_for_authenticated_user(
@@ -1802,7 +1807,7 @@ def create_or_update_secret_for_authenticated_user(
18021807
*,
18031808
data: Union[Unset, UserCodespacesSecretsSecretNamePutBodyType] = UNSET,
18041809
**kwargs,
1805-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1810+
) -> "Response[EmptyObject]":
18061811
url = f"/user/codespaces/secrets/{secret_name}"
18071812

18081813
if not kwargs:
@@ -1816,7 +1821,7 @@ def create_or_update_secret_for_authenticated_user(
18161821
"PUT",
18171822
url,
18181823
json=exclude_unset(json),
1819-
response_model=UserCodespacesSecretsSecretNamePutResponse201,
1824+
response_model=EmptyObject,
18201825
error_models={
18211826
"422": ValidationError,
18221827
"404": BasicError,
@@ -1826,7 +1831,7 @@ def create_or_update_secret_for_authenticated_user(
18261831
@overload
18271832
async def async_create_or_update_secret_for_authenticated_user(
18281833
self, secret_name: str, *, data: UserCodespacesSecretsSecretNamePutBodyType
1829-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1834+
) -> "Response[EmptyObject]":
18301835
...
18311836

18321837
@overload
@@ -1838,7 +1843,7 @@ async def async_create_or_update_secret_for_authenticated_user(
18381843
encrypted_value: Union[Unset, str] = UNSET,
18391844
key_id: str,
18401845
selected_repository_ids: Union[Unset, List[str]] = UNSET,
1841-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1846+
) -> "Response[EmptyObject]":
18421847
...
18431848

18441849
async def async_create_or_update_secret_for_authenticated_user(
@@ -1847,7 +1852,7 @@ async def async_create_or_update_secret_for_authenticated_user(
18471852
*,
18481853
data: Union[Unset, UserCodespacesSecretsSecretNamePutBodyType] = UNSET,
18491854
**kwargs,
1850-
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
1855+
) -> "Response[EmptyObject]":
18511856
url = f"/user/codespaces/secrets/{secret_name}"
18521857

18531858
if not kwargs:
@@ -1861,7 +1866,7 @@ async def async_create_or_update_secret_for_authenticated_user(
18611866
"PUT",
18621867
url,
18631868
json=exclude_unset(json),
1864-
response_model=UserCodespacesSecretsSecretNamePutResponse201,
1869+
response_model=EmptyObject,
18651870
error_models={
18661871
"422": ValidationError,
18671872
"404": BasicError,

0 commit comments

Comments
 (0)