my-aws-helpers 2.5.0__tar.gz → 2.6.0__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.
Potentially problematic release.
This version of my-aws-helpers might be problematic. Click here for more details.
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/PKG-INFO +1 -1
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/api.py +16 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/PKG-INFO +1 -1
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/setup.py +1 -1
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/README.md +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/auth.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/cognito.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/dynamo.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/errors.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/event.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/logging.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/s3.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers/sfn.py +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/SOURCES.txt +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/dependency_links.txt +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/requires.txt +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/top_level.txt +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/my_aws_helpers.egg-info/zip-safe +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/setup.cfg +0 -0
- {my_aws_helpers-2.5.0 → my_aws_helpers-2.6.0}/tests/test_event.py +0 -0
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
from typing import Optional, Dict, Any
|
|
2
|
+
from datetime import datetime, date
|
|
2
3
|
import json
|
|
3
4
|
from my_aws_helpers.errors import *
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class API:
|
|
8
|
+
|
|
9
|
+
def _serialise(obj):
|
|
10
|
+
if isinstance(obj, datetime) or isinstance(obj, date):
|
|
11
|
+
return obj.isoformat()
|
|
12
|
+
return obj
|
|
13
|
+
|
|
14
|
+
def response_serialiser(response: Any):
|
|
15
|
+
if isinstance(response, list):
|
|
16
|
+
return [API.response_serialiser(obj) for obj in response]
|
|
17
|
+
if isinstance(response, dict):
|
|
18
|
+
for k, v in response.items():
|
|
19
|
+
response[k] = API.response_serialiser(v)
|
|
20
|
+
return response
|
|
21
|
+
return API._serialise(response)
|
|
22
|
+
|
|
7
23
|
def response(code: int, body: Optional[str] = None):
|
|
8
24
|
return {
|
|
9
25
|
"statusCode": code,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|