-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi_python_client.online.diff
97 lines (77 loc) · 3.13 KB
/
openapi_python_client.online.diff
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
diff --git a/ksef/online/api/sesja/init_token.py b/ksef/online/api/sesja/init_token.py
index 3f1621f..f089c37 100644
--- a/ksef/online/api/sesja/init_token.py
+++ b/ksef/online/api/sesja/init_token.py
@@ -23,6 +23,10 @@ def _get_kwargs(
) -> Dict[str, Any]:
+ headers = {
+ 'Content-Type': 'application/octet-stream',
+ 'Accept': 'application/json',
+ }
cookies = {}
@@ -36,6 +40,7 @@ def _get_kwargs(
"method": "post",
"url": "/online/Session/InitToken",
"content": content.to_bytes(),
+ "headers": headers,
}
diff --git a/ksef/online/models/credentials_role_response_base_type_object_role_type.py b/ksef/online/models/credentials_role_response_base_type_object_role_type.py
index 74e06f7..35a1fd9 100644
--- a/ksef/online/models/credentials_role_response_base_type_object_role_type.py
+++ b/ksef/online/models/credentials_role_response_base_type_object_role_type.py
@@ -38,7 +38,8 @@ class CredentialsRoleResponseBaseTypeObjectRoleType:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
- d = src_dict.copy()
+ #d = src_dict.copy()
+ d = {src_dict:src_dict}
credentials_role_response_base_type_object_role_type = cls(
)
diff --git a/ksef/online/api/faktury/get.py b/ksef/online/api/faktury/get.py
index 815623e..f68bc3e 100644
--- a/ksef/online/api/faktury/get.py
+++ b/ksef/online/api/faktury/get.py
@@ -20,6 +20,9 @@ def _get_kwargs(
) -> Dict[str, Any]:
+ headers = {
+ 'Accept': 'application/octet-stream',
+ }
cookies = {}
@@ -32,6 +35,7 @@ def _get_kwargs(
return {
"method": "get",
"url": "/online/Invoice/Get/{KSeFReferenceNumber}".format(KSeFReferenceNumber=k_se_f_reference_number,),
+ "headers": headers,
}
diff --git a/ksef/online/models/get_response_200.py b/ksef/online/models/get_response_200.py
index d3cd000..4f9eea4 100644
--- a/ksef/online/models/get_response_200.py
+++ b/ksef/online/models/get_response_200.py
@@ -38,7 +38,7 @@ class GetResponse200:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
- d = src_dict.copy()
+ d = {'content': src_dict}
get_response_200 = cls(
)
diff --git a/ksef/online/models/hash_sha_type.py b/ksef/online/models/hash_sha_type.py
index 52b4b27..90b7682 100644
--- a/ksef/online/models/hash_sha_type.py
+++ b/ksef/online/models/hash_sha_type.py
@@ -60,7 +60,7 @@ class HashSHAType:
encoding = d.pop("encoding")
value = File(
- payload = BytesIO(d.pop("value"))
+ payload = BytesIO(d.pop("value").encode())
)
diff --git a/ksef/online/models/subject_name_type.py b/ksef/online/models/subject_name_type.py
index 1107cbc..05d844d 100644
--- a/ksef/online/models/subject_name_type.py
+++ b/ksef/online/models/subject_name_type.py
@@ -51,7 +51,7 @@ class SubjectNameType:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
- type = d.pop("type")
+ type = d.pop("type", None)
trade_name = d.pop("tradeName", UNSET)