diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0051.py b/githubkit/versions/ghec_v2022_11_28/models/group_0051.py index ad8b037a..8f21b89e 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0051.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0051.py @@ -9,7 +9,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Literal from datetime import date, datetime from pydantic import Field @@ -55,6 +55,10 @@ class CopilotSeatDetails(GitHubModel): default=UNSET, description="Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format.", ) + plan_type: Missing[Literal["business", "enterprise", "unknown"]] = Field( + default=UNSET, + description="The Copilot plan of the organization, or the parent enterprise, when applicable.", + ) class EnterpriseTeam(GitHubModel): diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0098.py b/githubkit/versions/ghec_v2022_11_28/models/group_0098.py index 81707263..19a68e11 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0098.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0098.py @@ -49,6 +49,10 @@ class CopilotOrganizationDetails(ExtraGitHubModel): seat_management_setting: Literal[ "assign_all", "assign_selected", "disabled", "unconfigured" ] = Field(description="The mode of assigning new seats.") + plan_type: Missing[Literal["business", "enterprise", "unknown"]] = Field( + default=UNSET, + description="The Copilot plan of the organization, or the parent enterprise, when applicable.", + ) class CopilotSeatBreakdown(GitHubModel): diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_1010.py b/githubkit/versions/ghec_v2022_11_28/models/group_1010.py index c855f38e..84281942 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_1010.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_1010.py @@ -38,7 +38,9 @@ class ReposOwnerRepoCheckRunsPostBodyOneof1(ExtraGitHubModel): external_id: Missing[str] = Field( default=UNSET, description="A reference for the run on the integrator's system." ) - status: Missing[Literal["queued", "in_progress"]] = Field(default=UNSET) + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = Field(default=UNSET) started_at: Missing[datetime] = Field( default=UNSET, description="The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.", diff --git a/githubkit/versions/ghec_v2022_11_28/rest/checks.py b/githubkit/versions/ghec_v2022_11_28/rest/checks.py index a522613c..73992d77 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/checks.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/checks.py @@ -10,10 +10,9 @@ from __future__ import annotations from weakref import ref -from typing_extensions import Annotated from typing import TYPE_CHECKING, Dict, Literal, Optional, overload -from pydantic import Field, BaseModel +from pydantic import BaseModel from githubkit.typing import Missing, UnsetType from githubkit.utils import UNSET, exclude_unset @@ -124,7 +123,9 @@ def create( head_sha: str, details_url: Missing[str] = UNSET, external_id: Missing[str] = UNSET, - status: Missing[Literal["queued", "in_progress"]] = UNSET, + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = UNSET, started_at: Missing[datetime] = UNSET, conclusion: Missing[ Literal[ @@ -178,12 +179,9 @@ def create( json = kwargs if data is UNSET else data json = type_validate_python( - Annotated[ - Union[ - ReposOwnerRepoCheckRunsPostBodyOneof0, - ReposOwnerRepoCheckRunsPostBodyOneof1, - ], - Field(discriminator="status"), + Union[ + ReposOwnerRepoCheckRunsPostBodyOneof0, + ReposOwnerRepoCheckRunsPostBodyOneof1, ], json, ) @@ -253,7 +251,9 @@ async def async_create( head_sha: str, details_url: Missing[str] = UNSET, external_id: Missing[str] = UNSET, - status: Missing[Literal["queued", "in_progress"]] = UNSET, + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = UNSET, started_at: Missing[datetime] = UNSET, conclusion: Missing[ Literal[ @@ -307,12 +307,9 @@ async def async_create( json = kwargs if data is UNSET else data json = type_validate_python( - Annotated[ - Union[ - ReposOwnerRepoCheckRunsPostBodyOneof0, - ReposOwnerRepoCheckRunsPostBodyOneof1, - ], - Field(discriminator="status"), + Union[ + ReposOwnerRepoCheckRunsPostBodyOneof0, + ReposOwnerRepoCheckRunsPostBodyOneof1, ], json, ) diff --git a/githubkit/versions/ghec_v2022_11_28/rest/repos.py b/githubkit/versions/ghec_v2022_11_28/rest/repos.py index af4a2a60..d8e8fe39 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/repos.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/repos.py @@ -10,10 +10,9 @@ from __future__ import annotations from weakref import ref -from typing_extensions import Annotated from typing import TYPE_CHECKING, Dict, Literal, Optional, overload -from pydantic import Field, BaseModel +from pydantic import BaseModel from githubkit.typing import Missing, UnsetType from githubkit.utils import UNSET, exclude_unset @@ -7142,14 +7141,8 @@ def get_content( *, headers: Optional[Dict[str, str]] = None, ) -> Response[ - Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + Union[ + List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule ] ]: """See also: https://docs.github.com/enterprise-cloud@latest//rest/repos/contents#get-repository-content""" @@ -7177,14 +7170,11 @@ def get_content( url, params=exclude_unset(params), headers=exclude_unset(headers), - response_model=Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + response_model=Union[ + List[ContentDirectoryItems], + ContentFile, + ContentSymlink, + ContentSubmodule, ], error_models={ "404": BasicError, @@ -7201,14 +7191,8 @@ async def async_get_content( *, headers: Optional[Dict[str, str]] = None, ) -> Response[ - Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + Union[ + List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule ] ]: """See also: https://docs.github.com/enterprise-cloud@latest//rest/repos/contents#get-repository-content""" @@ -7236,14 +7220,11 @@ async def async_get_content( url, params=exclude_unset(params), headers=exclude_unset(headers), - response_model=Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + response_model=Union[ + List[ContentDirectoryItems], + ContentFile, + ContentSymlink, + ContentSubmodule, ], error_models={ "404": BasicError, diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0051.py b/githubkit/versions/ghec_v2022_11_28/types/group_0051.py index 5669fd7b..e57d5489 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0051.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0051.py @@ -9,7 +9,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Literal from datetime import date, datetime from typing_extensions import TypedDict, NotRequired @@ -33,6 +33,7 @@ class CopilotSeatDetailsType(TypedDict): last_activity_editor: NotRequired[Union[str, None]] created_at: datetime updated_at: NotRequired[datetime] + plan_type: NotRequired[Literal["business", "enterprise", "unknown"]] class EnterpriseTeamType(TypedDict): diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0098.py b/githubkit/versions/ghec_v2022_11_28/types/group_0098.py index 546434db..ac7ed0c1 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0098.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0098.py @@ -28,6 +28,7 @@ class CopilotOrganizationDetailsType(TypedDict): seat_management_setting: Literal[ "assign_all", "assign_selected", "disabled", "unconfigured" ] + plan_type: NotRequired[Literal["business", "enterprise", "unknown"]] class CopilotSeatBreakdownType(TypedDict): diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_1010.py b/githubkit/versions/ghec_v2022_11_28/types/group_1010.py index f8dbc9ff..c11a76c8 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_1010.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_1010.py @@ -26,7 +26,9 @@ class ReposOwnerRepoCheckRunsPostBodyOneof1Type(TypedDict): head_sha: str details_url: NotRequired[str] external_id: NotRequired[str] - status: NotRequired[Literal["queued", "in_progress"]] + status: NotRequired[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] started_at: NotRequired[datetime] conclusion: NotRequired[ Literal[ diff --git a/githubkit/versions/v2022_11_28/models/group_0030.py b/githubkit/versions/v2022_11_28/models/group_0030.py index 5ed8ab3d..7093e3e8 100644 --- a/githubkit/versions/v2022_11_28/models/group_0030.py +++ b/githubkit/versions/v2022_11_28/models/group_0030.py @@ -9,7 +9,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Literal from datetime import date, datetime from pydantic import Field @@ -55,6 +55,10 @@ class CopilotSeatDetails(GitHubModel): default=UNSET, description="Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format.", ) + plan_type: Missing[Literal["business", "enterprise", "unknown"]] = Field( + default=UNSET, + description="The Copilot plan of the organization, or the parent enterprise, when applicable.", + ) class EnterpriseTeam(GitHubModel): diff --git a/githubkit/versions/v2022_11_28/models/group_0082.py b/githubkit/versions/v2022_11_28/models/group_0082.py index 81707263..19a68e11 100644 --- a/githubkit/versions/v2022_11_28/models/group_0082.py +++ b/githubkit/versions/v2022_11_28/models/group_0082.py @@ -49,6 +49,10 @@ class CopilotOrganizationDetails(ExtraGitHubModel): seat_management_setting: Literal[ "assign_all", "assign_selected", "disabled", "unconfigured" ] = Field(description="The mode of assigning new seats.") + plan_type: Missing[Literal["business", "enterprise", "unknown"]] = Field( + default=UNSET, + description="The Copilot plan of the organization, or the parent enterprise, when applicable.", + ) class CopilotSeatBreakdown(GitHubModel): diff --git a/githubkit/versions/v2022_11_28/models/group_0936.py b/githubkit/versions/v2022_11_28/models/group_0936.py index 7862e205..b62a7c18 100644 --- a/githubkit/versions/v2022_11_28/models/group_0936.py +++ b/githubkit/versions/v2022_11_28/models/group_0936.py @@ -38,7 +38,9 @@ class ReposOwnerRepoCheckRunsPostBodyOneof1(ExtraGitHubModel): external_id: Missing[str] = Field( default=UNSET, description="A reference for the run on the integrator's system." ) - status: Missing[Literal["queued", "in_progress"]] = Field(default=UNSET) + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = Field(default=UNSET) started_at: Missing[datetime] = Field( default=UNSET, description="The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.", diff --git a/githubkit/versions/v2022_11_28/rest/checks.py b/githubkit/versions/v2022_11_28/rest/checks.py index f1ad5ee5..0079d919 100644 --- a/githubkit/versions/v2022_11_28/rest/checks.py +++ b/githubkit/versions/v2022_11_28/rest/checks.py @@ -10,10 +10,9 @@ from __future__ import annotations from weakref import ref -from typing_extensions import Annotated from typing import TYPE_CHECKING, Dict, Literal, Optional, overload -from pydantic import Field, BaseModel +from pydantic import BaseModel from githubkit.typing import Missing, UnsetType from githubkit.utils import UNSET, exclude_unset @@ -124,7 +123,9 @@ def create( head_sha: str, details_url: Missing[str] = UNSET, external_id: Missing[str] = UNSET, - status: Missing[Literal["queued", "in_progress"]] = UNSET, + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = UNSET, started_at: Missing[datetime] = UNSET, conclusion: Missing[ Literal[ @@ -178,12 +179,9 @@ def create( json = kwargs if data is UNSET else data json = type_validate_python( - Annotated[ - Union[ - ReposOwnerRepoCheckRunsPostBodyOneof0, - ReposOwnerRepoCheckRunsPostBodyOneof1, - ], - Field(discriminator="status"), + Union[ + ReposOwnerRepoCheckRunsPostBodyOneof0, + ReposOwnerRepoCheckRunsPostBodyOneof1, ], json, ) @@ -253,7 +251,9 @@ async def async_create( head_sha: str, details_url: Missing[str] = UNSET, external_id: Missing[str] = UNSET, - status: Missing[Literal["queued", "in_progress"]] = UNSET, + status: Missing[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] = UNSET, started_at: Missing[datetime] = UNSET, conclusion: Missing[ Literal[ @@ -307,12 +307,9 @@ async def async_create( json = kwargs if data is UNSET else data json = type_validate_python( - Annotated[ - Union[ - ReposOwnerRepoCheckRunsPostBodyOneof0, - ReposOwnerRepoCheckRunsPostBodyOneof1, - ], - Field(discriminator="status"), + Union[ + ReposOwnerRepoCheckRunsPostBodyOneof0, + ReposOwnerRepoCheckRunsPostBodyOneof1, ], json, ) diff --git a/githubkit/versions/v2022_11_28/rest/repos.py b/githubkit/versions/v2022_11_28/rest/repos.py index a6cd48c3..5db01b28 100644 --- a/githubkit/versions/v2022_11_28/rest/repos.py +++ b/githubkit/versions/v2022_11_28/rest/repos.py @@ -10,10 +10,9 @@ from __future__ import annotations from weakref import ref -from typing_extensions import Annotated from typing import TYPE_CHECKING, Dict, Literal, Optional, overload -from pydantic import Field, BaseModel +from pydantic import BaseModel from githubkit.typing import Missing, UnsetType from githubkit.utils import UNSET, exclude_unset @@ -7142,14 +7141,8 @@ def get_content( *, headers: Optional[Dict[str, str]] = None, ) -> Response[ - Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + Union[ + List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule ] ]: """See also: https://docs.github.com/rest/repos/contents#get-repository-content""" @@ -7177,14 +7170,11 @@ def get_content( url, params=exclude_unset(params), headers=exclude_unset(headers), - response_model=Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + response_model=Union[ + List[ContentDirectoryItems], + ContentFile, + ContentSymlink, + ContentSubmodule, ], error_models={ "404": BasicError, @@ -7201,14 +7191,8 @@ async def async_get_content( *, headers: Optional[Dict[str, str]] = None, ) -> Response[ - Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + Union[ + List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule ] ]: """See also: https://docs.github.com/rest/repos/contents#get-repository-content""" @@ -7236,14 +7220,11 @@ async def async_get_content( url, params=exclude_unset(params), headers=exclude_unset(headers), - response_model=Annotated[ - Union[ - List[ContentDirectoryItems], - ContentFile, - ContentSymlink, - ContentSubmodule, - ], - Field(discriminator="type"), + response_model=Union[ + List[ContentDirectoryItems], + ContentFile, + ContentSymlink, + ContentSubmodule, ], error_models={ "404": BasicError, diff --git a/githubkit/versions/v2022_11_28/types/group_0030.py b/githubkit/versions/v2022_11_28/types/group_0030.py index bc3002e4..c092bedf 100644 --- a/githubkit/versions/v2022_11_28/types/group_0030.py +++ b/githubkit/versions/v2022_11_28/types/group_0030.py @@ -9,7 +9,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Literal from datetime import date, datetime from typing_extensions import TypedDict, NotRequired @@ -33,6 +33,7 @@ class CopilotSeatDetailsType(TypedDict): last_activity_editor: NotRequired[Union[str, None]] created_at: datetime updated_at: NotRequired[datetime] + plan_type: NotRequired[Literal["business", "enterprise", "unknown"]] class EnterpriseTeamType(TypedDict): diff --git a/githubkit/versions/v2022_11_28/types/group_0082.py b/githubkit/versions/v2022_11_28/types/group_0082.py index 546434db..ac7ed0c1 100644 --- a/githubkit/versions/v2022_11_28/types/group_0082.py +++ b/githubkit/versions/v2022_11_28/types/group_0082.py @@ -28,6 +28,7 @@ class CopilotOrganizationDetailsType(TypedDict): seat_management_setting: Literal[ "assign_all", "assign_selected", "disabled", "unconfigured" ] + plan_type: NotRequired[Literal["business", "enterprise", "unknown"]] class CopilotSeatBreakdownType(TypedDict): diff --git a/githubkit/versions/v2022_11_28/types/group_0936.py b/githubkit/versions/v2022_11_28/types/group_0936.py index 2b594af5..b1d258ac 100644 --- a/githubkit/versions/v2022_11_28/types/group_0936.py +++ b/githubkit/versions/v2022_11_28/types/group_0936.py @@ -26,7 +26,9 @@ class ReposOwnerRepoCheckRunsPostBodyOneof1Type(TypedDict): head_sha: str details_url: NotRequired[str] external_id: NotRequired[str] - status: NotRequired[Literal["queued", "in_progress"]] + status: NotRequired[ + Literal["queued", "in_progress", "waiting", "requested", "pending"] + ] started_at: NotRequired[datetime] conclusion: NotRequired[ Literal[ diff --git a/pyproject.toml b/pyproject.toml index 9d3a8f71..62c01d32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -374,6 +374,18 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des "submitted", ] } +# https://github.com/yanyongyu/githubkit/issues/148 +"/paths/~1repos~1{owner}~1{repo}~1check-runs/post/requestBody/content/application~1json/schema" = { discriminator = "" } +# repo check runs status enum may have more values (missing in oneOf) +"/paths/~1repos~1{owner}~1{repo}~1check-runs/post/requestBody/content/application~1json/schema/oneOf/1/properties/status/enum" = { "" = [ + "waiting", + "requested", + "pending", +] } + +# get repo content response discriminator not supported +"/paths/~1repos~1{owner}~1{repo}~1contents~1{path}/get/responses/200/content/application~1json/schema" = { discriminator = "" } + # Webhook schema overrides # webhook check run action is required "/components/schemas/webhook-check-run-completed/required" = { "" = [