-
Notifications
You must be signed in to change notification settings - Fork 10
/
configuration.py
166 lines (117 loc) · 3.12 KB
/
configuration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"""
Automatically generated file from a JSON schema.
"""
from typing import Any, Callable, Literal, Optional, TypedDict, Union
from typing_extensions import Required
from jsonschema_gentypes import jsonschema_draft_04, jsonschema_draft_2019_09_meta_data
AdditionalProperties = Union[Literal["Always"], Literal["Only explicit"]]
"""
Additional properties.
Describe how to deal with additional properties
"""
ADDITIONALPROPERTIES_ALWAYS: Literal["Always"] = "Always"
"""The values for the 'Additional properties' enum"""
ADDITIONALPROPERTIES_ONLY_EXPLICIT: Literal["Only explicit"] = "Only explicit"
"""The values for the 'Additional properties' enum"""
GetNameFunction = Callable[
[
Optional[
Union[
jsonschema_draft_04.JSONSchemaD4,
jsonschema_draft_2019_09_meta_data.JSONSchemaItemD2019,
]
],
Optional[str],
bool,
],
str,
]
class ApiArguments(TypedDict, total=False):
"""
API arguments.
The argument passed to the API
"""
additional_properties: "AdditionalProperties"
custom_get_name: GetNameFunction
"""
Additional properties.
Describe how to deal with additional properties
"""
class Configuration(TypedDict, total=False):
"""
Configuration.
The JSON Schema generate Python types configuration
"""
headers: str
callbacks: list[list[str]]
pre_commit: "PreCommitConfiguration"
"""
Pre-commit configuration.
The pre-commit configuration
"""
lineLength: int
""" The maximum line length """
python_version: str
""" The minimum Python version to support. """
generate: Required[list["GenerateItem"]]
""" Required property """
class GenerateItem(TypedDict, total=False):
"""Generate item."""
source: Required[str]
"""
The JSON schema file name
Required property
"""
destination: Required[str]
"""
The generated Python file name
Required property
"""
root_name: str
""" The name of the root element """
api_arguments: "ApiArguments"
"""
API arguments.
The argument passed to the API
"""
name_mapping: dict[str, str]
"""
Name mapping.
Used to map the name of an alternate name
"""
vocabularies: dict[str, str]
"""
vocabularies.
Used to add some vocabularies
"""
PRE_COMMIT_ARGUMENTS_DEFAULT: list[Any] = []
""" Default value of the field path 'Pre-commit configuration arguments' """
PRE_COMMIT_ENABLE_DEFAULT = False
""" Default value of the field path 'Pre-commit configuration enable' """
class PreCommitConfiguration(TypedDict, total=False):
"""
Pre-commit configuration.
The pre-commit configuration
"""
enable: bool
"""
Pre-commit enable.
default: False
"""
arguments: list[str]
"""
Pre-commit arguments.
Additional pre-commit arguments
default:
[]
"""
hooks: list[str]
"""
Pre-commit hooks.
The hooks to run, all by default
"""
hooks_skip: list[str]
"""
Pre-commit skipped hooks.
The hooks to skip, none by default
"""