feat(generated): Add new event types, fields, and membership with user support#247
Conversation
Greptile SummaryThis auto-generated PR adds two new directory token lifecycle events (
Confidence Score: 3/5Safe to merge with low risk if the API guarantees A P1 finding exists around the non-nullable
Important Files Changed
|
| { | ||
|
|
||
| /// <summary>The event payload.</summary> | ||
| public new DsyncTokenCreatedData Data { get; set; } = default!; |
There was a problem hiding this comment.
DsyncTokenDeleted.Data typed as DsyncTokenCreatedData
DsyncTokenDeleted reuses DsyncTokenCreatedData for its Data property. While both events share the same directory-token payload shape today, naming the delete event's data type after the create event is misleading — callers inspecting event.Data.GetType() or reading the property signature will see DsyncTokenCreatedData, which could cause confusion or misdirection when the schemas diverge in the future.
A dedicated DsyncTokenDeletedData class (or at minimum a shared DirectoryTokenData base) would make the intent clearer, consistent with how the rest of the SDK models paired event types (e.g., separate Data types per event class).
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| /// <summary>The user that belongs to the organization through this membership.</summary> | ||
| public User User { get; set; } = default!; |
There was a problem hiding this comment.
Non-nullable
User may silently be null
User User { get; set; } = default! uses the null-forgiving operator to suppress compiler warnings, but if any existing endpoint that returns OrganizationMembership doesn't embed the user object (e.g., older API responses, or endpoints that don't expand user data), accessing .User will throw a NullReferenceException at runtime with no compile-time warning.
If the API only conditionally includes user, the property should be declared nullable (User? User). If it is always present, this is fine — but even then, the _nulls test fixture (organization_membership_nulls.json) now also always includes a fully populated user object, meaning the null case for this field isn't covered by any test.
Summary
DsyncTokenCreated,DsyncTokenCreatedData,DsyncTokenDeletedevent classes for directory token lifecycle eventsUserOrganizationMembershipBaseWithUserto return organization memberships with embedded user dataNameproperty toDirectoryUser,DirectoryUserWithGroups,DsyncUserUpdatedData,Profile, andOrganizationMembershipclassesAdminPortaltoEventContextActorSourceenumListMembershipsForResourceAsyncandListMembershipsForResourceByExternalIdAsyncmethods to returnUserOrganizationMembershipBaseWithUserinstead ofUserOrganizationMembershipBaseListDataDirectoryUserWithGroups.Groupsfield with migration guidanceTriggered by workos/openapi-spec@91fc76a