-
Notifications
You must be signed in to change notification settings - Fork 434
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
leandrodamascena
merged 39 commits into
aws-powertools:develop
from
basvandriel:feature/iot-core-crud-event-types
Feb 17, 2025
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 48d6da8
Fix typo
basvandriel 8ecda5d
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel dce4fa7
work
basvandriel 39223c7
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel 5418544
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel 10415a8
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel bddff92
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel fffd8f4
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena 984aef5
Added all registry events
basvandriel 798272e
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel d528624
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 5ab83ff
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 28a0d83
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 49536f9
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel a252254
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 06456eb
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 9753bbf
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel c5a2e6f
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 86f1d91
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 8788bff
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 74d9dbf
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel f03655d
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel b66e5d8
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 074d64f
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel 9b323c9
Update aws_lambda_powertools/utilities/parser/models/iot_registry_eve…
basvandriel a42daaa
Merge branch 'develop' into feature/iot-core-crud-event-types
basvandriel c7602ef
work
basvandriel 674f973
add tests
basvandriel bf5f3df
rename tests
basvandriel bfd8d93
rename test
basvandriel 9e8aae2
wokr
basvandriel 501ce1c
Add documentation
basvandriel 0fd6f6e
Remove stars
basvandriel 30a73d5
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena 9268902
Moving JSON events to events folder
leandrodamascena 7068d1a
Moving JSON events to events folder
leandrodamascena 5719499
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena 778cac6
Merge branch 'develop' into feature/iot-core-crud-event-types
leandrodamascena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
aws_lambda_powertools/utilities/parser/models/iot_registry_events.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import enum | ||
from typing import Any, Dict, List, Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class IOTCoreRegistryEventBase(BaseModel): | ||
eventType: str | ||
eventId: str | ||
timestamp: int | ||
|
||
|
||
class IoTCRUDEventOperation(str, enum.Enum): | ||
CREATED = "CREATED" | ||
UPDATED = "UPDATED" | ||
DELETED = "DELETED" | ||
|
||
|
||
class AddRemoveOperation(str, enum.Enum): | ||
ADDED = "ADDED" | ||
REMOVED = "REMOVED" | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class IoTCRUDEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""The "Thing: created, updated, deleted" event""" | ||
|
||
operation: IoTCRUDEventOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
thingId: str | ||
thingName: str | ||
versionNumber: int | ||
thingTypeName: Optional[str] | ||
billingGroupName: Optional[str] | ||
|
||
attributes: Dict[str, Any] | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class IoTThingTypeCRUDEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
operation: IoTCRUDEventOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
accountId: str | ||
thingTypeId: str | ||
thingTypeName: str | ||
isDeprecated: bool | ||
deprecationDate: Optional[str] | ||
searchableAttributes: List[str] | ||
propagatingAttributes: Dict[str, str] | ||
description: str | ||
|
||
|
||
class IoTThingTypeAssociationEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Thing Type Associated or Disassociated with a Thing | ||
""" | ||
|
||
operation: AddRemoveOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
thingId: str | ||
thingName: str | ||
thingTypeName: str | ||
|
||
|
||
class RootToParentThingGroup(BaseModel): | ||
groupArn: str | ||
groupId: str | ||
|
||
|
||
class IoTThingGroupCRUDEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Thing Group Created/Updated/Deleted | ||
""" | ||
|
||
operation: IoTCRUDEventOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
accountId: str | ||
thingGroupId: str | ||
thingGroupName: str | ||
versionNumber: int | ||
parentGroupName: Optional[str] | ||
parentGroupId: Optional[str] | ||
description: str | ||
rootToParentThingGroups: List[RootToParentThingGroup] | ||
|
||
attributes: Dict[str, Any] | ||
|
||
dynamicGroupMappingId: Optional[str] | ||
|
||
|
||
class IoTThingAddedToOrRemoveFromThingGroupEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Thing Added to or Removed from a Thing Group | ||
""" | ||
|
||
operation: AddRemoveOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
accountId: str | ||
groupArn: str | ||
groupId: str | ||
thingArn: str | ||
thingId: str | ||
membershipId: str | ||
|
||
|
||
class IoTThingGroupAddedToOrDeletedFromThingGroupEvent(IOTCoreRegistryEventBase): | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Thing Group Added to or Deleted from a Thing Group | ||
""" | ||
|
||
operation: AddRemoveOperation | ||
basvandriel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
accountId: str | ||
thingGroupId: str | ||
thingGroupName: str | ||
childGroupId: str | ||
childGroupName: str | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.