Skip to content

Commit 4a85c6b

Browse files
committed
Updated response from API
1 parent c494a3c commit 4a85c6b

30 files changed

+233
-1
lines changed

marketstack/api/currencies/currencies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ def _parse_response(
4949
response_200 = PagedResponseListmodelsCurrency.from_dict(response.json())
5050

5151
return response_200
52+
if response.status_code == 401:
53+
response_401 = ErrorResponse.from_dict(response.json())
54+
55+
return response_401
5256
if response.status_code == 403:
5357
response_403 = ErrorResponse.from_dict(response.json())
5458

@@ -61,6 +65,10 @@ def _parse_response(
6165
response_429 = ErrorResponse.from_dict(response.json())
6266

6367
return response_429
68+
if response.status_code == 500:
69+
response_500 = ErrorResponse.from_dict(response.json())
70+
71+
return response_500
6472
if response.status_code == 422:
6573
response_422 = HTTPValidationError.from_dict(response.json())
6674

marketstack/api/dividends/dividends.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ def _parse_response(
6666
response_200 = PagedResponseListmodelsDividend.from_dict(response.json())
6767

6868
return response_200
69+
if response.status_code == 401:
70+
response_401 = ErrorResponse.from_dict(response.json())
71+
72+
return response_401
6973
if response.status_code == 403:
7074
response_403 = ErrorResponse.from_dict(response.json())
7175

@@ -78,6 +82,10 @@ def _parse_response(
7882
response_429 = ErrorResponse.from_dict(response.json())
7983

8084
return response_429
85+
if response.status_code == 500:
86+
response_500 = ErrorResponse.from_dict(response.json())
87+
88+
return response_500
8189
if response.status_code == 422:
8290
response_422 = HTTPValidationError.from_dict(response.json())
8391

marketstack/api/eod/eod.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ def _parse_response(
7171
response_200 = PagedResponseListmodelsEodPrice.from_dict(response.json())
7272

7373
return response_200
74+
if response.status_code == 401:
75+
response_401 = ErrorResponse.from_dict(response.json())
76+
77+
return response_401
7478
if response.status_code == 403:
7579
response_403 = ErrorResponse.from_dict(response.json())
7680

@@ -83,6 +87,10 @@ def _parse_response(
8387
response_429 = ErrorResponse.from_dict(response.json())
8488

8589
return response_429
90+
if response.status_code == 500:
91+
response_500 = ErrorResponse.from_dict(response.json())
92+
93+
return response_500
8694
if response.status_code == 422:
8795
response_422 = HTTPValidationError.from_dict(response.json())
8896

marketstack/api/eod/eod_date.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ def _parse_response(
7272
response_200 = PagedResponseListmodelsEodPrice.from_dict(response.json())
7373

7474
return response_200
75+
if response.status_code == 401:
76+
response_401 = ErrorResponse.from_dict(response.json())
77+
78+
return response_401
7579
if response.status_code == 403:
7680
response_403 = ErrorResponse.from_dict(response.json())
7781

@@ -84,6 +88,10 @@ def _parse_response(
8488
response_429 = ErrorResponse.from_dict(response.json())
8589

8690
return response_429
91+
if response.status_code == 500:
92+
response_500 = ErrorResponse.from_dict(response.json())
93+
94+
return response_500
8795
if response.status_code == 422:
8896
response_422 = HTTPValidationError.from_dict(response.json())
8997

marketstack/api/eod/eod_latest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ def _parse_response(
7171
response_200 = PagedResponseListmodelsEodPrice.from_dict(response.json())
7272

7373
return response_200
74+
if response.status_code == 401:
75+
response_401 = ErrorResponse.from_dict(response.json())
76+
77+
return response_401
7478
if response.status_code == 403:
7579
response_403 = ErrorResponse.from_dict(response.json())
7680

@@ -83,6 +87,10 @@ def _parse_response(
8387
response_429 = ErrorResponse.from_dict(response.json())
8488

8589
return response_429
90+
if response.status_code == 500:
91+
response_500 = ErrorResponse.from_dict(response.json())
92+
93+
return response_500
8694
if response.status_code == 422:
8795
response_422 = HTTPValidationError.from_dict(response.json())
8896

marketstack/api/exchanges/exchange_mic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ def _parse_response(
4242
response_200 = Exchange.from_dict(response.json())
4343

4444
return response_200
45+
if response.status_code == 401:
46+
response_401 = ErrorResponse.from_dict(response.json())
47+
48+
return response_401
4549
if response.status_code == 403:
4650
response_403 = ErrorResponse.from_dict(response.json())
4751

@@ -54,6 +58,10 @@ def _parse_response(
5458
response_429 = ErrorResponse.from_dict(response.json())
5559

5660
return response_429
61+
if response.status_code == 500:
62+
response_500 = ErrorResponse.from_dict(response.json())
63+
64+
return response_500
5765
if response.status_code == 422:
5866
response_422 = HTTPValidationError.from_dict(response.json())
5967

marketstack/api/exchanges/exchange_mic_eod.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def _parse_response(
6565
response_200 = PagedResponseExchangeEod.from_dict(response.json())
6666

6767
return response_200
68+
if response.status_code == 401:
69+
response_401 = ErrorResponse.from_dict(response.json())
70+
71+
return response_401
6872
if response.status_code == 403:
6973
response_403 = ErrorResponse.from_dict(response.json())
7074

@@ -77,6 +81,10 @@ def _parse_response(
7781
response_429 = ErrorResponse.from_dict(response.json())
7882

7983
return response_429
84+
if response.status_code == 500:
85+
response_500 = ErrorResponse.from_dict(response.json())
86+
87+
return response_500
8088
if response.status_code == 422:
8189
response_422 = HTTPValidationError.from_dict(response.json())
8290

marketstack/api/exchanges/exchange_mic_eod_date.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def _parse_response(
4646
response_200 = PagedResponseExchangeEod.from_dict(response.json())
4747

4848
return response_200
49+
if response.status_code == 401:
50+
response_401 = ErrorResponse.from_dict(response.json())
51+
52+
return response_401
4953
if response.status_code == 403:
5054
response_403 = ErrorResponse.from_dict(response.json())
5155

@@ -58,6 +62,10 @@ def _parse_response(
5862
response_429 = ErrorResponse.from_dict(response.json())
5963

6064
return response_429
65+
if response.status_code == 500:
66+
response_500 = ErrorResponse.from_dict(response.json())
67+
68+
return response_500
6169
if response.status_code == 422:
6270
response_422 = HTTPValidationError.from_dict(response.json())
6371

marketstack/api/exchanges/exchange_mic_eod_latest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def _parse_response(
4545
response_200 = PagedResponseExchangeEod.from_dict(response.json())
4646

4747
return response_200
48+
if response.status_code == 401:
49+
response_401 = ErrorResponse.from_dict(response.json())
50+
51+
return response_401
4852
if response.status_code == 403:
4953
response_403 = ErrorResponse.from_dict(response.json())
5054

@@ -57,6 +61,10 @@ def _parse_response(
5761
response_429 = ErrorResponse.from_dict(response.json())
5862

5963
return response_429
64+
if response.status_code == 500:
65+
response_500 = ErrorResponse.from_dict(response.json())
66+
67+
return response_500
6068
if response.status_code == 422:
6169
response_422 = HTTPValidationError.from_dict(response.json())
6270

marketstack/api/exchanges/exchange_mic_intraday.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def _parse_response(
7373
response_200 = PagedResponseExchangeIntraday.from_dict(response.json())
7474

7575
return response_200
76+
if response.status_code == 401:
77+
response_401 = ErrorResponse.from_dict(response.json())
78+
79+
return response_401
7680
if response.status_code == 403:
7781
response_403 = ErrorResponse.from_dict(response.json())
7882

@@ -85,6 +89,10 @@ def _parse_response(
8589
response_429 = ErrorResponse.from_dict(response.json())
8690

8791
return response_429
92+
if response.status_code == 500:
93+
response_500 = ErrorResponse.from_dict(response.json())
94+
95+
return response_500
8896
if response.status_code == 422:
8997
response_422 = HTTPValidationError.from_dict(response.json())
9098

0 commit comments

Comments
 (0)