aboutsummaryrefslogtreecommitdiff
path: root/jb/models/event.py
diff options
context:
space:
mode:
authorMax Nanis2026-02-24 17:26:15 -0500
committerMax Nanis2026-02-24 17:26:15 -0500
commit8c1940445503fd6678d0961600f2be81622793a2 (patch)
treeb9173562b8824b5eaa805e446d9d780e1f23fb2a /jb/models/event.py
parent25d8c3c214baf10f6520cc1351f78473150e5d7a (diff)
downloadamt-jb-8c1940445503fd6678d0961600f2be81622793a2.tar.gz
amt-jb-8c1940445503fd6678d0961600f2be81622793a2.zip
Extensive use of type checking. Movement of pytest conf towards handling managers (for db agnostic unittest). Starting to organize pytests.
Diffstat (limited to 'jb/models/event.py')
-rw-r--r--jb/models/event.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/jb/models/event.py b/jb/models/event.py
index c357772..c167420 100644
--- a/jb/models/event.py
+++ b/jb/models/event.py
@@ -11,13 +11,22 @@ class MTurkEvent(BaseModel):
What AWS SNS will POST to our mturk_notifications endpoint (inside the request body)
"""
- event_type: EventTypeType = Field(example="AssignmentSubmitted")
- event_timestamp: AwareDatetimeISO = Field(example="2025-10-16T18:45:51Z")
- amt_hit_id: AMTBoto3ID = Field(example="12345678901234567890")
+ event_type: EventTypeType = Field(
+ json_schema_extra={"example": "AssignmentSubmitted"}
+ )
+ event_timestamp: AwareDatetimeISO = Field(
+ json_schema_extra={"example": "2025-10-16T18:45:51Z"}
+ )
+ amt_hit_id: AMTBoto3ID = Field(
+ json_schema_extra={"example": "12345678901234567890"}
+ )
amt_assignment_id: str = Field(
- max_length=64, example="1234567890123456789012345678901234567890"
+ max_length=64,
+ json_schema_extra={"example": "1234567890123456789012345678901234567890"},
+ )
+ amt_hit_type_id: AMTBoto3ID = Field(
+ json_schema_extra={"example": "09876543210987654321"}
)
- amt_hit_type_id: AMTBoto3ID = Field(example="09876543210987654321")
@classmethod
def from_sns(cls, data: Dict):