my-aws-helpers 2.0.0__tar.gz → 2.1.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.
Files changed (20) hide show
  1. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/PKG-INFO +1 -1
  2. my_aws_helpers-2.1.0/my_aws_helpers/event.py +38 -0
  3. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/PKG-INFO +1 -1
  4. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/SOURCES.txt +3 -1
  5. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/setup.py +1 -1
  6. my_aws_helpers-2.1.0/tests/test_event.py +12 -0
  7. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/README.md +0 -0
  8. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/api.py +0 -0
  9. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/auth.py +0 -0
  10. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/cognito.py +0 -0
  11. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/dynamo.py +0 -0
  12. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/errors.py +0 -0
  13. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/logging.py +0 -0
  14. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/s3.py +0 -0
  15. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers/sfn.py +0 -0
  16. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/dependency_links.txt +0 -0
  17. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/requires.txt +0 -0
  18. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/top_level.txt +0 -0
  19. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/my_aws_helpers.egg-info/zip-safe +0 -0
  20. {my_aws_helpers-2.0.0 → my_aws_helpers-2.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: my_aws_helpers
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: AWS Helpers
5
5
  Home-page: https://github.com/JarrodMccarthy/aws_helpers.git
6
6
  Author: Jarrod McCarthy
@@ -0,0 +1,38 @@
1
+ from __future__ import annotations
2
+ from dataclasses import dataclass
3
+ from datetime import datetime
4
+ from enum import Enum
5
+ from uuid import uuid4
6
+
7
+
8
+ class EventStatus(str, Enum):
9
+ in_progress = "in_progress"
10
+ success = "success"
11
+ fail = "fail"
12
+
13
+
14
+ @dataclass
15
+ class Event:
16
+ status: str
17
+ message: str
18
+ id: str
19
+ created_timestamp: datetime
20
+
21
+ def __init__(
22
+ self,
23
+ status: str,
24
+ message: str,
25
+ id: str = None,
26
+ created_timestamp: datetime = None,
27
+ ):
28
+ self.status: str = self.set_status(status=status)
29
+ self.message: str = message
30
+ self.id: str = id if id else uuid4().hex
31
+ self.created_timestamp: datetime = created_timestamp if created_timestamp else datetime.now()
32
+
33
+ def set_status(self, status: str) -> str:
34
+ if status not in list(EventStatus):
35
+ raise Exception("Status must be a member of EventStatus")
36
+ return status
37
+
38
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: my-aws-helpers
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: AWS Helpers
5
5
  Home-page: https://github.com/JarrodMccarthy/aws_helpers.git
6
6
  Author: Jarrod McCarthy
@@ -6,6 +6,7 @@ my_aws_helpers/auth.py
6
6
  my_aws_helpers/cognito.py
7
7
  my_aws_helpers/dynamo.py
8
8
  my_aws_helpers/errors.py
9
+ my_aws_helpers/event.py
9
10
  my_aws_helpers/logging.py
10
11
  my_aws_helpers/s3.py
11
12
  my_aws_helpers/sfn.py
@@ -14,4 +15,5 @@ my_aws_helpers.egg-info/SOURCES.txt
14
15
  my_aws_helpers.egg-info/dependency_links.txt
15
16
  my_aws_helpers.egg-info/requires.txt
16
17
  my_aws_helpers.egg-info/top_level.txt
17
- my_aws_helpers.egg-info/zip-safe
18
+ my_aws_helpers.egg-info/zip-safe
19
+ tests/test_event.py
@@ -3,7 +3,7 @@ from setuptools import find_namespace_packages, setup
3
3
 
4
4
  base_path = os.path.abspath(os.path.dirname(__file__))
5
5
 
6
- version = "2.0.0"
6
+ version = "2.1.0"
7
7
 
8
8
  setup(
9
9
  name="my_aws_helpers",
@@ -0,0 +1,12 @@
1
+ from my_aws_helpers.event import Event, EventStatus
2
+ import pytest
3
+
4
+
5
+ def test_event():
6
+ event = Event(status=EventStatus.success.value, message="test event")
7
+ assert event != None
8
+
9
+ def test_event_wrong_status():
10
+ with pytest.raises(Exception):
11
+ Event(status="not success", message="test event")
12
+
File without changes
File without changes