GitHubKit-schemas 26.6.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- githubkit_schemas-26.6.7/PKG-INFO +95 -0
- githubkit_schemas-26.6.7/README.md +57 -0
- githubkit_schemas-26.6.7/githubkit_schemas/core/__init__.py +22 -0
- githubkit_schemas-26.6.7/githubkit_schemas/core/rest.py +150 -0
- githubkit_schemas-26.6.7/githubkit_schemas/core/webhooks.py +91 -0
- githubkit_schemas-26.6.7/githubkit_schemas/latest/__init__.py +8 -0
- githubkit_schemas-26.6.7/githubkit_schemas/latest/models.py +14721 -0
- githubkit_schemas-26.6.7/githubkit_schemas/latest/types.py +14875 -0
- githubkit_schemas-26.6.7/githubkit_schemas/latest/webhooks.py +745 -0
- githubkit_schemas-26.6.7/githubkit_schemas/versions.lock +179 -0
- githubkit_schemas-26.6.7/pyproject.toml +57 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: GitHubKit-schemas
|
|
3
|
+
Version: 26.6.7
|
|
4
|
+
Summary: GitHub Schemas for GitHubKit
|
|
5
|
+
Keywords: github,octokit
|
|
6
|
+
Author: yanyongyu
|
|
7
|
+
Author-email: yanyongyu <yyy@yyydl.top>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Requires-Dist: githubkit>=0.16.0
|
|
10
|
+
Requires-Dist: githubkit-schemas-2026-03-10==26.6.7
|
|
11
|
+
Requires-Dist: githubkit-schemas-2022-11-28==26.6.7 ; extra == '2022-11-28'
|
|
12
|
+
Requires-Dist: githubkit-schemas-2026-03-10==26.6.7 ; extra == '2026-03-10'
|
|
13
|
+
Requires-Dist: githubkit-schemas-2022-11-28==26.6.7 ; extra == 'all'
|
|
14
|
+
Requires-Dist: githubkit-schemas-2026-03-10==26.6.7 ; extra == 'all'
|
|
15
|
+
Requires-Dist: githubkit-schemas-ghec-2022-11-28==26.6.7 ; extra == 'all'
|
|
16
|
+
Requires-Dist: githubkit-schemas-ghec-2026-03-10==26.6.7 ; extra == 'all'
|
|
17
|
+
Requires-Dist: githubkit-schemas-2022-11-28==26.6.7 ; extra == 'all-gh'
|
|
18
|
+
Requires-Dist: githubkit-schemas-2026-03-10==26.6.7 ; extra == 'all-gh'
|
|
19
|
+
Requires-Dist: githubkit-schemas-ghec-2022-11-28==26.6.7 ; extra == 'all-ghec'
|
|
20
|
+
Requires-Dist: githubkit-schemas-ghec-2026-03-10==26.6.7 ; extra == 'all-ghec'
|
|
21
|
+
Requires-Dist: githubkit-schemas-ghec-2026-03-10==26.6.7 ; extra == 'ghec'
|
|
22
|
+
Requires-Dist: githubkit-schemas-ghec-2022-11-28==26.6.7 ; extra == 'ghec-2022-11-28'
|
|
23
|
+
Requires-Dist: githubkit-schemas-ghec-2026-03-10==26.6.7 ; extra == 'ghec-2026-03-10'
|
|
24
|
+
Requires-Python: >=3.10, <4.0
|
|
25
|
+
Project-URL: Homepage, https://github.com/yanyongyu/githubkit
|
|
26
|
+
Project-URL: Repository, https://github.com/yanyongyu/githubkit
|
|
27
|
+
Project-URL: Documentation, https://github.com/yanyongyu/githubkit
|
|
28
|
+
Project-URL: Bug Tracker, https://github.com/yanyongyu/githubkit/issues
|
|
29
|
+
Provides-Extra: 2022-11-28
|
|
30
|
+
Provides-Extra: 2026-03-10
|
|
31
|
+
Provides-Extra: all
|
|
32
|
+
Provides-Extra: all-gh
|
|
33
|
+
Provides-Extra: all-ghec
|
|
34
|
+
Provides-Extra: ghec
|
|
35
|
+
Provides-Extra: ghec-2022-11-28
|
|
36
|
+
Provides-Extra: ghec-2026-03-10
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
<!-- markdownlint-disable MD041 -->
|
|
40
|
+
<div align="center">
|
|
41
|
+
|
|
42
|
+
[](https://github.com/yanyongyu/githubkit)
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<p align="center">
|
|
47
|
+
<a href="https://raw.githubusercontent.com/yanyongyu/githubkit/master/LICENSE">
|
|
48
|
+
<img src="https://img.shields.io/github/license/yanyongyu/githubkit" alt="license">
|
|
49
|
+
</a>
|
|
50
|
+
<a href="https://pypi.python.org/pypi/githubkit-schemas">
|
|
51
|
+
<img src="https://img.shields.io/pypi/v/githubkit-schemas?logo=python&logoColor=edb641" alt="pypi">
|
|
52
|
+
</a>
|
|
53
|
+
<img src="https://img.shields.io/badge/python-3.10+-blue?logo=python&logoColor=edb641" alt="python">
|
|
54
|
+
<a href="https://github.com/psf/black">
|
|
55
|
+
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=edb641" alt="black">
|
|
56
|
+
</a>
|
|
57
|
+
<a href="https://github.com/Microsoft/pyright">
|
|
58
|
+
<img src="https://img.shields.io/badge/types-pyright-797952.svg?logo=python&logoColor=edb641" alt="pyright">
|
|
59
|
+
</a>
|
|
60
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
61
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json" alt="ruff">
|
|
62
|
+
</a>
|
|
63
|
+
<a href="https://results.pre-commit.ci/latest/github/yanyongyu/githubkit/master">
|
|
64
|
+
<img src="https://results.pre-commit.ci/badge/github/yanyongyu/githubkit/master.svg" alt="pre-commit" />
|
|
65
|
+
</a>
|
|
66
|
+
</p>
|
|
67
|
+
|
|
68
|
+
<div align="center">
|
|
69
|
+
|
|
70
|
+
<!-- markdownlint-capture -->
|
|
71
|
+
<!-- markdownlint-disable MD036 -->
|
|
72
|
+
|
|
73
|
+
_✨ The modern, all-batteries-included GitHub SDK for Python ✨_
|
|
74
|
+
|
|
75
|
+
_✨ Support both **sync** and **async** calls, **fully typed** ✨_
|
|
76
|
+
|
|
77
|
+
_✨ Always up to date, like octokit ✨_
|
|
78
|
+
|
|
79
|
+
<!-- markdownlint-restore -->
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<p align="center">
|
|
84
|
+
<a href="https://yanyongyu.github.io/githubkit/"><b>Documentation</b></a> |
|
|
85
|
+
<a href="https://github.com/yanyongyu/githubkit/issues"><b>Report Bug</b></a> |
|
|
86
|
+
<a href="https://docs.github.com/"><b>GitHub Docs</b></a>
|
|
87
|
+
</p>
|
|
88
|
+
|
|
89
|
+
This package provides the models and GitHub schemas for GitHubKit. It is installed as a dependency of GitHubKit by default, so you don't need to install it separately.
|
|
90
|
+
|
|
91
|
+
When GitHub schemas are updated, this package will be updated accordingly. You can also lock the version of this package using a dependency manager like `uv` to ensure that your project is using a specific version of the schemas.
|
|
92
|
+
|
|
93
|
+
## Getting Started
|
|
94
|
+
|
|
95
|
+
For more, see the [documentation](https://yanyongyu.github.io/githubkit).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD041 -->
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
[](https://github.com/yanyongyu/githubkit)
|
|
5
|
+
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://raw.githubusercontent.com/yanyongyu/githubkit/master/LICENSE">
|
|
10
|
+
<img src="https://img.shields.io/github/license/yanyongyu/githubkit" alt="license">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://pypi.python.org/pypi/githubkit-schemas">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/githubkit-schemas?logo=python&logoColor=edb641" alt="pypi">
|
|
14
|
+
</a>
|
|
15
|
+
<img src="https://img.shields.io/badge/python-3.10+-blue?logo=python&logoColor=edb641" alt="python">
|
|
16
|
+
<a href="https://github.com/psf/black">
|
|
17
|
+
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=edb641" alt="black">
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/Microsoft/pyright">
|
|
20
|
+
<img src="https://img.shields.io/badge/types-pyright-797952.svg?logo=python&logoColor=edb641" alt="pyright">
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
23
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json" alt="ruff">
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://results.pre-commit.ci/latest/github/yanyongyu/githubkit/master">
|
|
26
|
+
<img src="https://results.pre-commit.ci/badge/github/yanyongyu/githubkit/master.svg" alt="pre-commit" />
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
<!-- markdownlint-capture -->
|
|
33
|
+
<!-- markdownlint-disable MD036 -->
|
|
34
|
+
|
|
35
|
+
_✨ The modern, all-batteries-included GitHub SDK for Python ✨_
|
|
36
|
+
|
|
37
|
+
_✨ Support both **sync** and **async** calls, **fully typed** ✨_
|
|
38
|
+
|
|
39
|
+
_✨ Always up to date, like octokit ✨_
|
|
40
|
+
|
|
41
|
+
<!-- markdownlint-restore -->
|
|
42
|
+
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<a href="https://yanyongyu.github.io/githubkit/"><b>Documentation</b></a> |
|
|
47
|
+
<a href="https://github.com/yanyongyu/githubkit/issues"><b>Report Bug</b></a> |
|
|
48
|
+
<a href="https://docs.github.com/"><b>GitHub Docs</b></a>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
This package provides the models and GitHub schemas for GitHubKit. It is installed as a dependency of GitHubKit by default, so you don't need to install it separately.
|
|
52
|
+
|
|
53
|
+
When GitHub schemas are updated, this package will be updated accordingly. You can also lock the version of this package using a dependency manager like `uv` to ensure that your project is using a specific version of the schemas.
|
|
54
|
+
|
|
55
|
+
## Getting Started
|
|
56
|
+
|
|
57
|
+
For more, see the [documentation](https://yanyongyu.github.io/githubkit).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""DO NOT EDIT THIS FILE!
|
|
2
|
+
|
|
3
|
+
This file is automatically @generated by githubkit using the follow command:
|
|
4
|
+
|
|
5
|
+
bash ./scripts/run-codegen.sh
|
|
6
|
+
|
|
7
|
+
See https://github.com/github/rest-api-description for more information.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Literal
|
|
11
|
+
|
|
12
|
+
VERSIONS = {
|
|
13
|
+
"2022-11-28": "v2022_11_28",
|
|
14
|
+
"ghec-2022-11-28": "ghec_v2022_11_28",
|
|
15
|
+
"2026-03-10": "v2026_03_10",
|
|
16
|
+
"ghec-2026-03-10": "ghec_v2026_03_10",
|
|
17
|
+
}
|
|
18
|
+
LATEST_VERSION = "2026-03-10"
|
|
19
|
+
VERSION_TYPE = Literal["2022-11-28", "ghec-2022-11-28", "2026-03-10", "ghec-2026-03-10"]
|
|
20
|
+
|
|
21
|
+
from .rest import RestVersionSwitcher as RestVersionSwitcher
|
|
22
|
+
from .webhooks import WebhooksVersionSwitcher as WebhooksVersionSwitcher
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"""DO NOT EDIT THIS FILE!
|
|
2
|
+
|
|
3
|
+
This file is automatically @generated by githubkit using the follow command:
|
|
4
|
+
|
|
5
|
+
bash ./scripts/run-codegen.sh
|
|
6
|
+
|
|
7
|
+
See https://github.com/github/rest-api-description for more information.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from collections.abc import Awaitable, Callable
|
|
11
|
+
import importlib
|
|
12
|
+
from typing import (
|
|
13
|
+
TYPE_CHECKING,
|
|
14
|
+
Any,
|
|
15
|
+
Literal,
|
|
16
|
+
TypeVar,
|
|
17
|
+
overload,
|
|
18
|
+
)
|
|
19
|
+
from typing_extensions import ParamSpec
|
|
20
|
+
from weakref import WeakKeyDictionary, ref
|
|
21
|
+
|
|
22
|
+
from githubkit.rest.paginator import Paginator
|
|
23
|
+
|
|
24
|
+
from . import LATEST_VERSION, VERSION_TYPE, VERSIONS
|
|
25
|
+
|
|
26
|
+
if TYPE_CHECKING:
|
|
27
|
+
from githubkit_schemas.ghec_v2022_11_28.rest import (
|
|
28
|
+
RestNamespace as GhecV20221128RestNamespace,
|
|
29
|
+
)
|
|
30
|
+
from githubkit_schemas.ghec_v2026_03_10.rest import (
|
|
31
|
+
RestNamespace as GhecV20260310RestNamespace,
|
|
32
|
+
)
|
|
33
|
+
from githubkit_schemas.v2022_11_28.rest import (
|
|
34
|
+
RestNamespace as V20221128RestNamespace,
|
|
35
|
+
)
|
|
36
|
+
from githubkit_schemas.v2026_03_10.rest import (
|
|
37
|
+
RestNamespace as V20260310RestNamespace,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
from githubkit import GitHubCore, Response
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
CP = ParamSpec("CP")
|
|
44
|
+
CT = TypeVar("CT")
|
|
45
|
+
RT = TypeVar("RT")
|
|
46
|
+
|
|
47
|
+
R = Callable[CP, "Response[RT]"] | Callable[CP, Awaitable["Response[RT]"]]
|
|
48
|
+
|
|
49
|
+
if TYPE_CHECKING:
|
|
50
|
+
|
|
51
|
+
class _VersionProxy(V20260310RestNamespace): ...
|
|
52
|
+
|
|
53
|
+
else:
|
|
54
|
+
_VersionProxy = object
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class RestVersionSwitcher(_VersionProxy):
|
|
58
|
+
_cached_namespaces: "WeakKeyDictionary[GitHubCore, dict[VERSION_TYPE, Any]]" = (
|
|
59
|
+
WeakKeyDictionary()
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if not TYPE_CHECKING:
|
|
63
|
+
|
|
64
|
+
def __getattr__(self, name: str) -> Any:
|
|
65
|
+
if name.startswith("_"):
|
|
66
|
+
raise AttributeError(
|
|
67
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
68
|
+
)
|
|
69
|
+
namespace = self()
|
|
70
|
+
return getattr(namespace, name)
|
|
71
|
+
|
|
72
|
+
def __init__(self, github: "GitHubCore"):
|
|
73
|
+
self._github_ref = ref(github)
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def _github(self) -> "GitHubCore":
|
|
77
|
+
if g := self._github_ref():
|
|
78
|
+
return g
|
|
79
|
+
raise RuntimeError(
|
|
80
|
+
"GitHub client has already been collected. "
|
|
81
|
+
"Do not use the namespace after the client has been collected."
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
@overload
|
|
85
|
+
def paginate(
|
|
86
|
+
self,
|
|
87
|
+
request: "R[CP, list[RT]]",
|
|
88
|
+
map_func: None = None,
|
|
89
|
+
*args: CP.args,
|
|
90
|
+
**kwargs: CP.kwargs,
|
|
91
|
+
) -> "Paginator[RT]": ...
|
|
92
|
+
|
|
93
|
+
@overload
|
|
94
|
+
def paginate(
|
|
95
|
+
self,
|
|
96
|
+
request: "R[CP, CT]",
|
|
97
|
+
map_func: Callable[["Response[CT]"], list[RT]],
|
|
98
|
+
*args: CP.args,
|
|
99
|
+
**kwargs: CP.kwargs,
|
|
100
|
+
) -> "Paginator[RT]": ...
|
|
101
|
+
|
|
102
|
+
def paginate(
|
|
103
|
+
self,
|
|
104
|
+
request: "R[CP, CT]",
|
|
105
|
+
map_func: Callable[["Response[CT]"], list[RT]] | None = None,
|
|
106
|
+
*args: CP.args,
|
|
107
|
+
**kwargs: CP.kwargs,
|
|
108
|
+
) -> "Paginator[RT]":
|
|
109
|
+
return Paginator(self, request, map_func, *args, **kwargs) # type: ignore
|
|
110
|
+
|
|
111
|
+
@overload
|
|
112
|
+
def __call__(self, version: Literal["2022-11-28"]) -> "V20221128RestNamespace": ...
|
|
113
|
+
@overload
|
|
114
|
+
def __call__(
|
|
115
|
+
self, version: Literal["ghec-2022-11-28"]
|
|
116
|
+
) -> "GhecV20221128RestNamespace": ...
|
|
117
|
+
@overload
|
|
118
|
+
def __call__(self, version: Literal["2026-03-10"]) -> "V20260310RestNamespace": ...
|
|
119
|
+
@overload
|
|
120
|
+
def __call__(
|
|
121
|
+
self, version: Literal["ghec-2026-03-10"]
|
|
122
|
+
) -> "GhecV20260310RestNamespace": ...
|
|
123
|
+
|
|
124
|
+
@overload
|
|
125
|
+
def __call__(self) -> "V20260310RestNamespace": ...
|
|
126
|
+
|
|
127
|
+
def __call__(self, version: VERSION_TYPE = LATEST_VERSION) -> Any:
|
|
128
|
+
g = self._github
|
|
129
|
+
cache = self._cached_namespaces.setdefault(g, {})
|
|
130
|
+
if version in cache:
|
|
131
|
+
return cache[version]
|
|
132
|
+
|
|
133
|
+
if version not in VERSIONS:
|
|
134
|
+
raise ValueError(
|
|
135
|
+
f"Version {version!r} is not a valid version. "
|
|
136
|
+
f"Valid versions are: {', '.join(VERSIONS.keys())}"
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
try:
|
|
140
|
+
module = importlib.import_module(
|
|
141
|
+
f"githubkit_schemas.{VERSIONS[version]}.rest"
|
|
142
|
+
)
|
|
143
|
+
except ModuleNotFoundError:
|
|
144
|
+
raise RuntimeError(
|
|
145
|
+
f"Version {version!r} is not installed. "
|
|
146
|
+
f"Please install it via 'pip install githubkit-schemas[{version}]'"
|
|
147
|
+
)
|
|
148
|
+
namespace = module.RestNamespace(g)
|
|
149
|
+
cache[version] = namespace
|
|
150
|
+
return namespace
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""DO NOT EDIT THIS FILE!
|
|
2
|
+
|
|
3
|
+
This file is automatically @generated by githubkit using the follow command:
|
|
4
|
+
|
|
5
|
+
bash ./scripts/run-codegen.sh
|
|
6
|
+
|
|
7
|
+
See https://github.com/github/rest-api-description for more information.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import importlib
|
|
11
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Literal, overload
|
|
12
|
+
|
|
13
|
+
from . import LATEST_VERSION, VERSION_TYPE, VERSIONS
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from githubkit_schemas.ghec_v2022_11_28.webhooks import (
|
|
17
|
+
WebhookNamespace as GhecV20221128WebhookNamespace,
|
|
18
|
+
)
|
|
19
|
+
from githubkit_schemas.ghec_v2026_03_10.webhooks import (
|
|
20
|
+
WebhookNamespace as GhecV20260310WebhookNamespace,
|
|
21
|
+
)
|
|
22
|
+
from githubkit_schemas.v2022_11_28.webhooks import (
|
|
23
|
+
WebhookNamespace as V20221128WebhookNamespace,
|
|
24
|
+
)
|
|
25
|
+
from githubkit_schemas.v2026_03_10.webhooks import (
|
|
26
|
+
WebhookNamespace as V20260310WebhookNamespace,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
if TYPE_CHECKING:
|
|
30
|
+
|
|
31
|
+
class _VersionProxy(V20260310WebhookNamespace): ...
|
|
32
|
+
|
|
33
|
+
else:
|
|
34
|
+
_VersionProxy = object
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class WebhooksVersionSwitcher(_VersionProxy):
|
|
38
|
+
_cached_namespaces: ClassVar[dict[VERSION_TYPE, Any]] = {}
|
|
39
|
+
|
|
40
|
+
if not TYPE_CHECKING:
|
|
41
|
+
|
|
42
|
+
def __getattr__(self, name: str) -> Any:
|
|
43
|
+
if name.startswith("_"):
|
|
44
|
+
raise AttributeError(
|
|
45
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
46
|
+
)
|
|
47
|
+
namespace = self()
|
|
48
|
+
return getattr(namespace, name)
|
|
49
|
+
|
|
50
|
+
@overload
|
|
51
|
+
def __call__(
|
|
52
|
+
self, version: Literal["2022-11-28"]
|
|
53
|
+
) -> "V20221128WebhookNamespace": ...
|
|
54
|
+
@overload
|
|
55
|
+
def __call__(
|
|
56
|
+
self, version: Literal["ghec-2022-11-28"]
|
|
57
|
+
) -> "GhecV20221128WebhookNamespace": ...
|
|
58
|
+
@overload
|
|
59
|
+
def __call__(
|
|
60
|
+
self, version: Literal["2026-03-10"]
|
|
61
|
+
) -> "V20260310WebhookNamespace": ...
|
|
62
|
+
@overload
|
|
63
|
+
def __call__(
|
|
64
|
+
self, version: Literal["ghec-2026-03-10"]
|
|
65
|
+
) -> "GhecV20260310WebhookNamespace": ...
|
|
66
|
+
|
|
67
|
+
@overload
|
|
68
|
+
def __call__(self) -> "V20260310WebhookNamespace": ...
|
|
69
|
+
|
|
70
|
+
def __call__(self, version: VERSION_TYPE = LATEST_VERSION) -> Any:
|
|
71
|
+
if version in self._cached_namespaces:
|
|
72
|
+
return self._cached_namespaces[version]
|
|
73
|
+
|
|
74
|
+
if version not in VERSIONS:
|
|
75
|
+
raise ValueError(
|
|
76
|
+
f"Version {version!r} is not a valid version. "
|
|
77
|
+
f"Valid versions are: {', '.join(VERSIONS.keys())}"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
try:
|
|
81
|
+
module = importlib.import_module(
|
|
82
|
+
f"githubkit_schemas.{VERSIONS[version]}.webhooks"
|
|
83
|
+
)
|
|
84
|
+
except ModuleNotFoundError:
|
|
85
|
+
raise RuntimeError(
|
|
86
|
+
f"Version {version!r} is not installed. "
|
|
87
|
+
f"Please install it via 'pip install githubkit-schemas[{version}]'"
|
|
88
|
+
)
|
|
89
|
+
namespace = module.WebhookNamespace()
|
|
90
|
+
self._cached_namespaces[version] = namespace
|
|
91
|
+
return namespace
|