rapid-api-client 0.3.3__tar.gz → 0.3.4__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.
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/PKG-INFO +1 -1
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/pyproject.toml +1 -1
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/annotations.py +5 -7
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/client.py +1 -1
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/LICENSE +0 -0
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/README.md +0 -0
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/__init__.py +0 -0
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/decorator.py +0 -0
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/py.typed +0 -0
- {rapid_api_client-0.3.3 → rapid_api_client-0.3.4}/rapid_api_client/utils.py +0 -0
|
@@ -3,7 +3,7 @@ Model classes
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any, Literal
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
|
|
@@ -43,11 +43,14 @@ class Header(BaseAnnotation):
|
|
|
43
43
|
alias: str | None = None
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
@dataclass
|
|
46
47
|
class Body(BaseAnnotation):
|
|
47
48
|
"""
|
|
48
49
|
Annotation to declare an argument used as http content for post/put/...
|
|
49
50
|
"""
|
|
50
51
|
|
|
52
|
+
target: Literal["content", "data", "files"] = "content"
|
|
53
|
+
|
|
51
54
|
def serialize(self, body: Any) -> str | bytes:
|
|
52
55
|
"""
|
|
53
56
|
Serialize the annotated parameter value
|
|
@@ -61,14 +64,9 @@ class FileBody(Body):
|
|
|
61
64
|
Annotation to declare an argument used as file to be uploaded
|
|
62
65
|
"""
|
|
63
66
|
|
|
67
|
+
target: Literal["content", "data", "files"] = "files"
|
|
64
68
|
alias: str | None = None
|
|
65
69
|
|
|
66
|
-
def serialize(self, body: Any) -> str | bytes:
|
|
67
|
-
"""
|
|
68
|
-
Serialize the annotated parameter value
|
|
69
|
-
"""
|
|
70
|
-
return body
|
|
71
|
-
|
|
72
70
|
|
|
73
71
|
@dataclass
|
|
74
72
|
class PydanticBody(Body):
|
|
@@ -104,7 +104,7 @@ class RapidApi:
|
|
|
104
104
|
files = build_kwargs.setdefault("files", {})
|
|
105
105
|
files[annot.alias or param] = annot.serialize(value)
|
|
106
106
|
else:
|
|
107
|
-
build_kwargs[
|
|
107
|
+
build_kwargs[annot.target] = annot.serialize(value)
|
|
108
108
|
|
|
109
109
|
# handle extra optional kwargs
|
|
110
110
|
if timeout is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|