-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathcommon.py
44 lines (37 loc) · 1022 Bytes
/
common.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
from enum import Enum
from typing import Dict
from typing import Optional
from openapi_python_generator.models import LibraryConfig
class HTTPLibrary(str, Enum):
"""
Enum for the available HTTP libraries.
"""
httpx = "httpx"
requests = "requests"
aiohttp = "aiohttp"
class PydanticVersion(str, Enum):
V1 = "v1"
V2 = "v2"
library_config_dict: Dict[Optional[HTTPLibrary], LibraryConfig] = {
HTTPLibrary.httpx: LibraryConfig(
name="httpx",
library_name="httpx",
template_name="httpx.jinja2",
include_async=True,
include_sync=True,
),
HTTPLibrary.requests: LibraryConfig(
name="requests",
library_name="requests",
template_name="requests.jinja2",
include_async=False,
include_sync=True,
),
HTTPLibrary.aiohttp: LibraryConfig(
name="aiohttp",
library_name="aiohttp",
template_name="aiohttp.jinja2",
include_async=True,
include_sync=False,
),
}