@@ -23,52 +23,52 @@ def check_kraftwerk_manifest() -> bool:
23
23
24
24
25
25
async def post_to_all_products (
26
- url_suffix : str , data : Mapping [str , Any ], respose_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
26
+ url_suffix : str , data : Mapping [str , Any ], response_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
27
27
) -> Optional [Dict [str , Optional [pydantic .BaseModel ]]]:
28
28
"""Call given POST endpoint on all products in the manifest"""
29
- return await _method_to_all_products ("post" , url_suffix , data , respose_schema , collect_responses )
29
+ return await _method_to_all_products ("post" , url_suffix , data , response_schema , collect_responses )
30
30
31
31
32
32
async def put_to_all_products (
33
- url_suffix : str , data : Mapping [str , Any ], respose_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
33
+ url_suffix : str , data : Mapping [str , Any ], response_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
34
34
) -> Optional [Dict [str , Optional [pydantic .BaseModel ]]]:
35
35
"""Call given PUT endpoint on all products in the manifest"""
36
- return await _method_to_all_products ("put" , url_suffix , data , respose_schema , collect_responses )
36
+ return await _method_to_all_products ("put" , url_suffix , data , response_schema , collect_responses )
37
37
38
38
39
39
async def get_from_all_products (
40
- url_suffix : str , respose_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
40
+ url_suffix : str , response_schema : Type [pydantic .BaseModel ], collect_responses : bool = True
41
41
) -> Optional [Dict [str , Optional [pydantic .BaseModel ]]]:
42
42
"""Call given GET endpoint on all products in the manifest"""
43
- return await _method_to_all_products ("get" , url_suffix , None , respose_schema , collect_responses )
43
+ return await _method_to_all_products ("get" , url_suffix , None , response_schema , collect_responses )
44
44
45
45
46
46
async def get_from_product (
47
- name : str , url_suffix : str , respose_schema : Type [pydantic .BaseModel ]
47
+ name : str , url_suffix : str , response_schema : Type [pydantic .BaseModel ]
48
48
) -> Optional [pydantic .BaseModel ]:
49
49
"""Call given GET endpoint on named product in the manifest"""
50
- return await _method_to_product (name , "get" , url_suffix , None , respose_schema )
50
+ return await _method_to_product (name , "get" , url_suffix , None , response_schema )
51
51
52
52
53
53
async def post_to_product (
54
- name : str , url_suffix : str , data : Mapping [str , Any ], respose_schema : Type [pydantic .BaseModel ]
54
+ name : str , url_suffix : str , data : Mapping [str , Any ], response_schema : Type [pydantic .BaseModel ]
55
55
) -> Optional [pydantic .BaseModel ]:
56
56
"""Call given POST endpoint on named product in the manifest"""
57
- return await _method_to_product (name , "post" , url_suffix , data , respose_schema )
57
+ return await _method_to_product (name , "post" , url_suffix , data , response_schema )
58
58
59
59
60
60
async def put_to_product (
61
- name : str , url_suffix : str , data : Mapping [str , Any ], respose_schema : Type [pydantic .BaseModel ]
61
+ name : str , url_suffix : str , data : Mapping [str , Any ], response_schema : Type [pydantic .BaseModel ]
62
62
) -> Optional [pydantic .BaseModel ]:
63
63
"""Call given PUT endpoint on named product in the manifest"""
64
- return await _method_to_product (name , "put" , url_suffix , data , respose_schema )
64
+ return await _method_to_product (name , "put" , url_suffix , data , response_schema )
65
65
66
66
67
67
async def _method_to_all_products (
68
68
methodname : str ,
69
69
url_suffix : str ,
70
70
data : Optional [Mapping [str , Any ]],
71
- respose_schema : Type [pydantic .BaseModel ],
71
+ response_schema : Type [pydantic .BaseModel ],
72
72
collect_responses : bool = True ,
73
73
) -> Optional [Dict [str , Optional [pydantic .BaseModel ]]]:
74
74
"""Call given POST endpoint on call products in the manifest"""
@@ -83,9 +83,9 @@ async def _method_to_all_products(
83
83
84
84
async def handle_one (name : str ) -> Tuple [str , Optional [pydantic .BaseModel ]]:
85
85
"""Do one call"""
86
- nonlocal url_suffix , methodname , respose_schema , data
86
+ nonlocal url_suffix , methodname , response_schema , data
87
87
try :
88
- return name , await _method_to_product (name , methodname , url_suffix , data , respose_schema )
88
+ return name , await _method_to_product (name , methodname , url_suffix , data , response_schema )
89
89
except Exception as exc : # pylint: disable=W0718
90
90
LOGGER .exception (exc )
91
91
return name , None
@@ -107,7 +107,7 @@ async def _method_to_product(
107
107
methodname : str ,
108
108
url_suffix : str ,
109
109
data : Optional [Mapping [str , Any ]],
110
- respose_schema : Type [pydantic .BaseModel ],
110
+ response_schema : Type [pydantic .BaseModel ],
111
111
) -> Optional [Optional [pydantic .BaseModel ]]:
112
112
"""Do a call to named product"""
113
113
@@ -130,7 +130,7 @@ async def _method_to_product(
130
130
resp .raise_for_status ()
131
131
payload = await resp .json ()
132
132
LOGGER .debug ("{}({}) payload={}" .format (methodname , url , payload ))
133
- retval = respose_schema .parse_obj (payload )
133
+ retval = response_schema .parse_obj (payload )
134
134
# Log a common error case here for DRY
135
135
if isinstance (retval , OperationResultResponse ):
136
136
if not retval .success :
0 commit comments