Skip to content

Commit 9e8aae2

Browse files
committed
wokr
1 parent bfd8d93 commit 9e8aae2

File tree

1 file changed

+42
-53
lines changed

1 file changed

+42
-53
lines changed
Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Dict, List, Literal, Optional
22

3-
from pydantic import BaseModel
3+
from pydantic import BaseModel, Field
44

55

66
class IoTCoreRegistryEventsBase(BaseModel):
@@ -14,88 +14,77 @@ class IoTCoreRegistryEventsBase(BaseModel):
1414

1515

1616
class IoTCoreThingEvent(IoTCoreRegistryEventsBase):
17-
"""The "Thing: created, updated, deleted" event"""
17+
"""The 'Thing: created, updated, deleted' event"""
1818

1919
operation: EVENT_CRUD_OPERATION
20-
21-
thingId: str
22-
accountId: str
23-
thingName: str
24-
versionNumber: int
25-
thingTypeName: Optional[str]
20+
thing_id: str = Field(..., alias="thingId")
21+
account_id: str = Field(..., alias="accountId")
22+
thing_name: str = Field(..., alias="thingName")
23+
version_number: int = Field(..., alias="versionNumber")
24+
thing_type_name: Optional[str] = Field(None, alias="thingTypeName")
2625
attributes: Dict[str, Any]
2726

2827

2928
class IoTCoreThingTypeEvent(IoTCoreRegistryEventsBase):
3029
operation: EVENT_CRUD_OPERATION
31-
accountId: str
32-
thingTypeId: str
33-
thingTypeName: str
34-
isDeprecated: bool
35-
deprecationDate: Optional[str]
36-
searchableAttributes: List[str]
37-
propagatingAttributes: List[Dict[str, str]]
30+
account_id: str = Field(..., alias="accountId")
31+
thing_type_id: str = Field(..., alias="thingTypeId")
32+
thing_type_name: str = Field(..., alias="thingTypeName")
33+
is_deprecated: bool = Field(..., alias="isDeprecated")
34+
deprecation_date: Optional[str] = Field(None, alias="deprecationDate")
35+
searchable_attributes: List[str] = Field(..., alias="searchableAttributes")
36+
propagating_attributes: List[Dict[str, str]] = Field(..., alias="propagatingAttributes")
3837
description: str
3938

4039

4140
class IoTCoreThingTypeAssociationEvent(IoTCoreRegistryEventsBase):
42-
"""
43-
Thing Type Associated or Disassociated with a Thing
44-
"""
41+
"""Thing Type Associated or Disassociated with a Thing"""
4542

4643
operation: EVENT_ADD_REMOVE_OPERATION
47-
thingId: str
48-
thingName: str
49-
thingTypeName: str
44+
thing_id: str = Field(..., alias="thingId")
45+
thing_name: str = Field(..., alias="thingName")
46+
thing_type_name: str = Field(..., alias="thingTypeName")
5047

5148

5249
class RootToParentThingGroup(BaseModel):
53-
groupArn: str
54-
groupId: str
50+
group_arn: str = Field(..., alias="groupArn")
51+
group_id: str = Field(..., alias="groupId")
5552

5653

5754
class IoTCoreThingGroupEvent(IoTCoreRegistryEventsBase):
58-
"""
59-
Thing Group Created/Updated/Deleted
60-
"""
55+
"""Thing Group Created/Updated/Deleted"""
6156

6257
operation: EVENT_CRUD_OPERATION
63-
accountId: str
64-
thingGroupId: str
65-
thingGroupName: str
66-
versionNumber: int
67-
parentGroupName: Optional[str]
68-
parentGroupId: Optional[str]
58+
account_id: str = Field(..., alias="accountId")
59+
thing_group_id: str = Field(..., alias="thingGroupId")
60+
thing_group_name: str = Field(..., alias="thingGroupName")
61+
version_number: int = Field(..., alias="versionNumber")
62+
parent_group_name: Optional[str] = Field(None, alias="parentGroupName")
63+
parent_group_id: Optional[str] = Field(None, alias="parentGroupId")
6964
description: str
70-
rootToParentThingGroups: List[RootToParentThingGroup]
71-
65+
root_to_parent_thing_groups: List[RootToParentThingGroup] = Field(..., alias="rootToParentThingGroups")
7266
attributes: Dict[str, Any]
73-
74-
dynamicGroupMappingId: Optional[str]
67+
dynamic_group_mapping_id: Optional[str] = Field(None, alias="dynamicGroupMappingId")
7568

7669

7770
class IoTCoreAddOrRemoveFromThingGroupEvent(IoTCoreRegistryEventsBase):
78-
"""
79-
Thing Added to or Removed from a Thing Group
80-
"""
71+
"""Thing Added to or Removed from a Thing Group"""
8172

8273
operation: EVENT_ADD_REMOVE_OPERATION
83-
accountId: str
84-
groupArn: str
85-
groupId: str
86-
thingArn: str
87-
thingId: str
88-
membershipId: str
74+
account_id: str = Field(..., alias="accountId")
75+
group_arn: str = Field(..., alias="groupArn")
76+
group_id: str = Field(..., alias="groupId")
77+
thing_arn: str = Field(..., alias="thingArn")
78+
thing_id: str = Field(..., alias="thingId")
79+
membership_id: str = Field(..., alias="membershipId")
8980

9081

9182
class IoTCoreAddOrDeleteFromThingGroupEvent(IoTCoreRegistryEventsBase):
92-
"""
93-
Thing Group Added to or Deleted from a Thing Group
94-
"""
83+
"""Thing Group Added to or Deleted from a Thing Group"""
9584

9685
operation: EVENT_ADD_REMOVE_OPERATION
97-
accountId: str
98-
thingGroupId: str
99-
thingGroupName: str
100-
childGroupId: str
101-
childGroupName: str
86+
account_id: str = Field(..., alias="accountId")
87+
thing_group_id: str = Field(..., alias="thingGroupId")
88+
thing_group_name: str = Field(..., alias="thingGroupName")
89+
child_group_id: str = Field(..., alias="childGroupId")
90+
child_group_name: str = Field(..., alias="childGroupName")

0 commit comments

Comments
 (0)