Skip to content
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

feat(parser): Add IoTCRUDEvent model #5892

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import enum
from typing import Any, Dict, Optional

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

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.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_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

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

Added line #L4 was not covered by tests


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

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

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L7 - L10 were not covered by tests


class IoTCRUDEvent(BaseModel):

Check warning on line 13 in aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L13

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

eventType: str
eventId: str
timestamp: int

Check warning on line 18 in aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L16-L18

Added lines #L16 - L18 were not covered by tests

operation: IoTCRUDEventOperation

Check warning on line 20 in aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L20

Added line #L20 was not covered by tests

thingId: str

Check warning on line 22 in aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L22

Added line #L22 was not covered by tests

thingName: str
versionNumber: int
thingTypeName: Optional[str]
billinGroupName: Optional[str]

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

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L24-L27

Added lines #L24 - L27 were not covered by tests

attributes: Dict[str, Any]

Check warning on line 29 in aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/utilities/parser/models/iot_core_crud_event.py#L29

Added line #L29 was not covered by tests
Loading