Skip to content

Commit

Permalink
🐛 fix timeline reviewed event body type
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu committed Oct 20, 2022
1 parent fa650a2 commit c040a49
Show file tree
Hide file tree
Showing 7 changed files with 1,697 additions and 470 deletions.
45 changes: 22 additions & 23 deletions githubkit/rest/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,11 @@

from githubkit.utils import UNSET, Unset, exclude_unset

from .types import (
ReposOwnerRepoCheckSuitesPostBodyType,
ReposOwnerRepoCheckRunsPostBodyOneof0Type,
ReposOwnerRepoCheckRunsPostBodyOneof1Type,
ReposOwnerRepoCheckRunsPostBodyPropOutputType,
ReposOwnerRepoCheckSuitesPreferencesPatchBodyType,
ReposOwnerRepoCheckRunsPostBodyPropActionsItemsType,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0Type,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1Type,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropOutputType,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropActionsItemsType,
ReposOwnerRepoCheckSuitesPreferencesPatchBodyPropAutoTriggerChecksItemsType,
)
from .models import (
CheckRun,
BasicError,
CheckSuite,
EmptyObject,
CheckAnnotation,
CheckSuitePreference,
ReposOwnerRepoCheckSuitesPostBody,
Expand All @@ -39,9 +27,20 @@
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
ReposOwnerRepoCommitsRefCheckSuitesGetResponse200,
ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
ReposOwnerRepoCheckSuitesCheckSuiteIdCheckRunsGetResponse200,
ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
)
from .types import (
ReposOwnerRepoCheckSuitesPostBodyType,
ReposOwnerRepoCheckRunsPostBodyOneof0Type,
ReposOwnerRepoCheckRunsPostBodyOneof1Type,
ReposOwnerRepoCheckRunsPostBodyPropOutputType,
ReposOwnerRepoCheckSuitesPreferencesPatchBodyType,
ReposOwnerRepoCheckRunsPostBodyPropActionsItemsType,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0Type,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1Type,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropOutputType,
ReposOwnerRepoCheckRunsCheckRunIdPatchBodyPropActionsItemsType,
ReposOwnerRepoCheckSuitesPreferencesPatchBodyPropAutoTriggerChecksItemsType,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -598,13 +597,13 @@ def rerequest_run(
owner: str,
repo: str,
check_run_id: int,
) -> "Response[ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"

return self._github.request(
"POST",
url,
response_model=ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
response_model=EmptyObject,
error_models={
"403": BasicError,
"422": BasicError,
Expand All @@ -617,13 +616,13 @@ async def async_rerequest_run(
owner: str,
repo: str,
check_run_id: int,
) -> "Response[ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"

return await self._github.arequest(
"POST",
url,
response_model=ReposOwnerRepoCheckRunsCheckRunIdRerequestPostResponse201,
response_model=EmptyObject,
error_models={
"403": BasicError,
"422": BasicError,
Expand Down Expand Up @@ -902,27 +901,27 @@ def rerequest_suite(
owner: str,
repo: str,
check_suite_id: int,
) -> "Response[ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"

return self._github.request(
"POST",
url,
response_model=ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
response_model=EmptyObject,
)

async def async_rerequest_suite(
self,
owner: str,
repo: str,
check_suite_id: int,
) -> "Response[ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"

return await self._github.arequest(
"POST",
url,
response_model=ReposOwnerRepoCheckSuitesCheckSuiteIdRerequestPostResponse201,
response_model=EmptyObject,
)

def list_for_ref(
Expand Down
4 changes: 0 additions & 4 deletions githubkit/rest/code_scanning.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def list_alerts_for_enterprise(
params=exclude_unset(params),
response_model=List[CodeScanningOrganizationAlertItems],
error_models={
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
Expand Down Expand Up @@ -113,7 +112,6 @@ async def async_list_alerts_for_enterprise(
params=exclude_unset(params),
response_model=List[CodeScanningOrganizationAlertItems],
error_models={
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
Expand Down Expand Up @@ -152,7 +150,6 @@ def list_alerts_for_org(
params=exclude_unset(params),
response_model=List[CodeScanningOrganizationAlertItems],
error_models={
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
Expand Down Expand Up @@ -191,7 +188,6 @@ async def async_list_alerts_for_org(
params=exclude_unset(params),
response_model=List[CodeScanningOrganizationAlertItems],
error_models={
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
Expand Down
41 changes: 23 additions & 18 deletions githubkit/rest/codespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
OrgsOrgCodespacesSecretsSecretNamePutBody,
ReposOwnerRepoCodespacesNewGetResponse200,
ReposOwnerRepoCodespacesSecretsGetResponse200,
UserCodespacesSecretsSecretNamePutResponse201,
OrgsOrgMembersUsernameCodespacesGetResponse200,
ReposOwnerRepoCodespacesMachinesGetResponse200,
ReposOwnerRepoPullsPullNumberCodespacesPostBody,
Expand All @@ -59,8 +58,8 @@
AppHookDeliveriesDeliveryIdAttemptsPostResponse202,
UserCodespacesSecretsSecretNameRepositoriesPutBody,
ReposOwnerRepoCodespacesDevcontainersGetResponse200,
EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
OrgsOrgCodespacesSecretsSecretNameRepositoriesPutBody,
ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
UserCodespacesSecretsSecretNameRepositoriesGetResponse200,
OrgsOrgCodespacesSecretsSecretNameRepositoriesGetResponse200,
)
Expand Down Expand Up @@ -915,6 +914,7 @@ def create_with_repo_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -975,6 +975,7 @@ async def async_create_with_repo_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -1244,7 +1245,7 @@ def create_or_update_repo_secret(
secret_name: str,
*,
data: ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

@overload
Expand All @@ -1257,7 +1258,7 @@ def create_or_update_repo_secret(
data: Unset = UNSET,
encrypted_value: Union[Unset, str] = UNSET,
key_id: Union[Unset, str] = UNSET,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

def create_or_update_repo_secret(
Expand All @@ -1270,7 +1271,7 @@ def create_or_update_repo_secret(
Unset, ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType
] = UNSET,
**kwargs,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}"

if not kwargs:
Expand All @@ -1284,7 +1285,7 @@ def create_or_update_repo_secret(
"PUT",
url,
json=exclude_unset(json),
response_model=ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
response_model=EmptyObject,
)

@overload
Expand All @@ -1295,7 +1296,7 @@ async def async_create_or_update_repo_secret(
secret_name: str,
*,
data: ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

@overload
Expand All @@ -1308,7 +1309,7 @@ async def async_create_or_update_repo_secret(
data: Unset = UNSET,
encrypted_value: Union[Unset, str] = UNSET,
key_id: Union[Unset, str] = UNSET,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

async def async_create_or_update_repo_secret(
Expand All @@ -1321,7 +1322,7 @@ async def async_create_or_update_repo_secret(
Unset, ReposOwnerRepoCodespacesSecretsSecretNamePutBodyType
] = UNSET,
**kwargs,
) -> "Response[ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}"

if not kwargs:
Expand All @@ -1335,7 +1336,7 @@ async def async_create_or_update_repo_secret(
"PUT",
url,
json=exclude_unset(json),
response_model=ReposOwnerRepoCodespacesSecretsSecretNamePutResponse201,
response_model=EmptyObject,
)

def delete_repo_secret(
Expand Down Expand Up @@ -1426,6 +1427,7 @@ def create_with_pr_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -1491,6 +1493,7 @@ async def async_create_with_pr_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -1618,6 +1621,7 @@ def create_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -1691,6 +1695,7 @@ async def async_create_for_authenticated_user(
"401": BasicError,
"403": BasicError,
"404": BasicError,
"503": EnterprisesEnterpriseCodeScanningAlertsGetResponse503,
},
)

Expand Down Expand Up @@ -1781,7 +1786,7 @@ async def async_get_secret_for_authenticated_user(
@overload
def create_or_update_secret_for_authenticated_user(
self, secret_name: str, *, data: UserCodespacesSecretsSecretNamePutBodyType
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

@overload
Expand All @@ -1793,7 +1798,7 @@ def create_or_update_secret_for_authenticated_user(
encrypted_value: Union[Unset, str] = UNSET,
key_id: str,
selected_repository_ids: Union[Unset, List[str]] = UNSET,
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

def create_or_update_secret_for_authenticated_user(
Expand All @@ -1802,7 +1807,7 @@ def create_or_update_secret_for_authenticated_user(
*,
data: Union[Unset, UserCodespacesSecretsSecretNamePutBodyType] = UNSET,
**kwargs,
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
url = f"/user/codespaces/secrets/{secret_name}"

if not kwargs:
Expand All @@ -1816,7 +1821,7 @@ def create_or_update_secret_for_authenticated_user(
"PUT",
url,
json=exclude_unset(json),
response_model=UserCodespacesSecretsSecretNamePutResponse201,
response_model=EmptyObject,
error_models={
"422": ValidationError,
"404": BasicError,
Expand All @@ -1826,7 +1831,7 @@ def create_or_update_secret_for_authenticated_user(
@overload
async def async_create_or_update_secret_for_authenticated_user(
self, secret_name: str, *, data: UserCodespacesSecretsSecretNamePutBodyType
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

@overload
Expand All @@ -1838,7 +1843,7 @@ async def async_create_or_update_secret_for_authenticated_user(
encrypted_value: Union[Unset, str] = UNSET,
key_id: str,
selected_repository_ids: Union[Unset, List[str]] = UNSET,
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
...

async def async_create_or_update_secret_for_authenticated_user(
Expand All @@ -1847,7 +1852,7 @@ async def async_create_or_update_secret_for_authenticated_user(
*,
data: Union[Unset, UserCodespacesSecretsSecretNamePutBodyType] = UNSET,
**kwargs,
) -> "Response[UserCodespacesSecretsSecretNamePutResponse201]":
) -> "Response[EmptyObject]":
url = f"/user/codespaces/secrets/{secret_name}"

if not kwargs:
Expand All @@ -1861,7 +1866,7 @@ async def async_create_or_update_secret_for_authenticated_user(
"PUT",
url,
json=exclude_unset(json),
response_model=UserCodespacesSecretsSecretNamePutResponse201,
response_model=EmptyObject,
error_models={
"422": ValidationError,
"404": BasicError,
Expand Down
Loading

0 comments on commit c040a49

Please sign in to comment.