Skip to content

Add Tier 2 Pydantic models for all Phase 2 resources - #26

Closed
mehmetkr wants to merge 1 commit into
mainfrom
tier2-pydantic-models
Closed

mehmetkr wants to merge 1 commit into
mainfrom
tier2-pydantic-models

Conversation

@mehmetkr

@mehmetkr mehmetkr commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds 6 new type modules for Tier 2 resources: sessions.py (8 models), batches.py (5 models + 1 Literal), waitpoints.py (7 models + 1 Literal), webhooks.py (16 models + 8 Literals), bulk_actions.py (11 models + 3 Literals), errors.py (6 models + 1 Literal)
  • Adds QueueType Literal and QueueTypeName model to shared.py
  • Updates types/__init__.py with 72 new re-exports (120 total)
  • All models generated from OpenAPI spec and hand-tuned, following Tier 1 patterns (_ApiModel base, camelCase aliases, Field constraints matching spec)
  • allOf inheritance: CreatedSessionResponseBody extends SessionObject, WebhookEndpointDetailObject extends WebhookEndpointObject, WebhookDeliveryObject extends WebhookDeliveryListItem
  • Discriminated unions: CreateBulkActionRequestBody via TypeAdapter with 4 variants

Test plan

  • 70 new tests in test_tier2_types.py (318 total passing)
  • Required field validation (missing required fields raise ValidationError)
  • Optional field defaults
  • Alias roundtripping (construct from camelCase JSON, serialize back with by_alias=True)
  • Enum/Literal validation
  • allOf inheritance chains
  • Discriminated union dispatch
  • ruff, pyright strict, mypy strict all clean

@mehmetkr mehmetkr closed this Dec 1, 2026
@mehmetkr
mehmetkr deleted the tier2-pydantic-models branch December 1, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant