workos/workos-python

Events API request on v5 throwing Pydantic errors

Closed this issue · 0 comments

Implementing Events API in the following format

events = workos_client.events.list_events(
events=[
"organization_membership.created"
],
limit=30,
)
And ends up with a lengthy error output (dozens of lines like so):

data.4.UserDeletedEvent.event
Input should be 'user.deleted' [type=literal_error, input_value='organization_membership.created', input_type=str]
For further information visit https://errors.pydantic.dev/2.8/v/literal_error
data.4.UserUpdatedEvent.data.object
Input should be 'user' [type=literal_error, input_value='organization_membership', input_type=str]
For further information visit https://errors.pydantic.dev/2.8/v/literal_error
data.4.UserUpdatedEvent.data.email
Field required [type=missing, input_value={'id': 'om_01J8809NK2RK7H...7ZZSNV8HA1ZJ3CCM845Y55'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.8/v/missing
data.4.UserUpdatedEvent.data.email_verified
Field required [type=missing, input_value={'id': 'om_01J8809NK2RK7H...7ZZSNV8HA1ZJ3CCM845Y55'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.8/v/missing
data.4.UserUpdatedEvent.event
Input should be 'user.updated' [type=literal_error, input_value='organization_membership.created', input_type=str]
For further information visit https://errors.pydantic.dev/2.8/v/literal_error