Skip to content

feat(parser): Add IoT registry events models #5892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 11 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
44f0855
Add IoT crud event
basvandriel Jan 21, 2025
48d6da8
Fix typo
basvandriel Jan 21, 2025
8ecda5d
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Jan 22, 2025
dce4fa7
work
basvandriel Jan 22, 2025
39223c7
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Jan 22, 2025
5418544
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Jan 23, 2025
10415a8
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Jan 30, 2025
bddff92
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Jan 31, 2025
fffd8f4
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena Feb 8, 2025
984aef5
Added all registry events
basvandriel Feb 13, 2025
798272e
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Feb 13, 2025
d528624
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
5ab83ff
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
28a0d83
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
49536f9
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
a252254
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
06456eb
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
9753bbf
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
c5a2e6f
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
86f1d91
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
8788bff
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
74d9dbf
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
f03655d
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
b66e5d8
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
074d64f
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
9b323c9
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel Feb 13, 2025
a42daaa
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel Feb 13, 2025
c7602ef
work
basvandriel Feb 13, 2025
674f973
add tests
basvandriel Feb 13, 2025
bf5f3df
rename tests
basvandriel Feb 13, 2025
bfd8d93
rename test
basvandriel Feb 13, 2025
9e8aae2
wokr
basvandriel Feb 14, 2025
501ce1c
Add documentation
basvandriel Feb 14, 2025
0fd6f6e
Remove stars
basvandriel Feb 14, 2025
30a73d5
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena Feb 14, 2025
9268902
Moving JSON events to events folder
leandrodamascena Feb 14, 2025
7068d1a
Moving JSON events to events folder
leandrodamascena Feb 14, 2025
5719499
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena Feb 14, 2025
778cac6
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions aws_lambda_powertools/utilities/parser/models/iot_registry_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import enum
from typing import Any, Dict, List, Optional

Check warning on line 2 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L1-L2

Added lines #L1 - L2 were not covered by tests

from pydantic import BaseModel

Check warning on line 4 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L4

Added line #L4 was not covered by tests


class IOTCoreRegistryEventBase(BaseModel):
eventType: str
eventId: str
timestamp: int

Check warning on line 10 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L7-L10

Added lines #L7 - L10 were not covered by tests


class IoTCRUDEventOperation(str, enum.Enum):
CREATED = "CREATED"
UPDATED = "UPDATED"
DELETED = "DELETED"

Check warning on line 16 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L13-L16

Added lines #L13 - L16 were not covered by tests


class AddRemoveOperation(str, enum.Enum):
ADDED = "ADDED"
REMOVED = "REMOVED"

Check warning on line 21 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L19-L21

Added lines #L19 - L21 were not covered by tests


class IoTCRUDEvent(IOTCoreRegistryEventBase):

Check warning on line 24 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L24

Added line #L24 was not covered by tests
"""The "Thing: created, updated, deleted" event"""

operation: IoTCRUDEventOperation

Check warning on line 27 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L27

Added line #L27 was not covered by tests

thingId: str
thingName: str
versionNumber: int
thingTypeName: Optional[str]
billingGroupName: Optional[str]

Check warning on line 33 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L29-L33

Added lines #L29 - L33 were not covered by tests

attributes: Dict[str, Any]

Check warning on line 35 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L35

Added line #L35 was not covered by tests


class IoTThingTypeCRUDEvent(IOTCoreRegistryEventBase):
operation: IoTCRUDEventOperation
accountId: str
thingTypeId: str
thingTypeName: str
isDeprecated: bool
deprecationDate: Optional[str]
searchableAttributes: List[str]
propagatingAttributes: Dict[str, str]
description: str

Check warning on line 47 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L38-L47

Added lines #L38 - L47 were not covered by tests


class IoTThingTypeAssociationEvent(IOTCoreRegistryEventBase):

Check warning on line 50 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L50

Added line #L50 was not covered by tests
"""
Thing Type Associated or Disassociated with a Thing
"""

operation: AddRemoveOperation
thingId: str
thingName: str
thingTypeName: str

Check warning on line 58 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L55-L58

Added lines #L55 - L58 were not covered by tests


class RootToParentThingGroup(BaseModel):
groupArn: str
groupId: str

Check warning on line 63 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L61-L63

Added lines #L61 - L63 were not covered by tests


class IoTThingGroupCRUDEvent(IOTCoreRegistryEventBase):

Check warning on line 66 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L66

Added line #L66 was not covered by tests
"""
Thing Group Created/Updated/Deleted
"""

operation: IoTCRUDEventOperation
accountId: str
thingGroupId: str
thingGroupName: str
versionNumber: int
parentGroupName: Optional[str]
parentGroupId: Optional[str]
description: str
rootToParentThingGroups: List[RootToParentThingGroup]

Check warning on line 79 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L71-L79

Added lines #L71 - L79 were not covered by tests

attributes: Dict[str, Any]

Check warning on line 81 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L81

Added line #L81 was not covered by tests

dynamicGroupMappingId: Optional[str]

Check warning on line 83 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L83

Added line #L83 was not covered by tests


class IoTThingAddedToOrRemoveFromThingGroupEvent(IOTCoreRegistryEventBase):

Check warning on line 86 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L86

Added line #L86 was not covered by tests
"""
Thing Added to or Removed from a Thing Group
"""

operation: AddRemoveOperation
accountId: str
groupArn: str
groupId: str
thingArn: str
thingId: str
membershipId: str

Check warning on line 97 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L91-L97

Added lines #L91 - L97 were not covered by tests


class IoTThingGroupAddedToOrDeletedFromThingGroupEvent(IOTCoreRegistryEventBase):

Check warning on line 100 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L100

Added line #L100 was not covered by tests
"""
Thing Group Added to or Deleted from a Thing Group
"""

operation: AddRemoveOperation
accountId: str
thingGroupId: str
thingGroupName: str
childGroupId: str
childGroupName: str

Check warning on line 110 in aws_lambda_powertools/utilities/parser/models/iot_registry_events.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_registry_events.py#L105-L110

Added lines #L105 - L110 were not covered by tests
Loading