Migrate the queryMembers and push preference request bodies to generated models - #6655
Draft
gpunto wants to merge 1 commit into
Draft
Migrate the queryMembers and push preference request bodies to generated models#6655gpunto wants to merge 1 commit into
gpunto wants to merge 1 commit into
Conversation
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
Contributor
SDK Size Comparison 📏
|
gpunto
force-pushed
the
migrate/request-bodies-3
branch
from
August 21, 2026 07:17
6523c62 to
74278e3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Goal
Migrate the
queryMembersand push-preference request bodies to their generated models.Part of AND-1291
Implementation
QueryMembersRequestwith the generatedQueryMembersPayload, andUpsertPushPreferencesRequestplus itsUpstreamPushPreferenceInputDtoandUpstreamChatPreferencesDtowith the generated request,
PushPreferenceInputandChatPreferencesInput. The push-preferenceresponse was migrated earlier, so this finishes that endpoint.
Member.toChannelMemberRequest()and replaceChatPreferences.toDto()withChatPreferences.toChatPreferencesInput(), converting each toggle to its generated sealed type.every declared property type when it builds the enclosing adapter, so a missing one fails at runtime
rather than at compile time, even for properties that are always null.
DownstreamPushPreferenceDtoandDownstreamChatPreferencesDtostay: they are still used by theuser DTOs.
Notes
membersnarrows from the fullUpstreamMemberDtotoChannelMemberRequest, which drops nothing theendpoint reads: the handler only calls
Members.HashUserIDs()to resolve a distinct channel. The roleand custom data are still carried, since the domain member has them.
PushPreferenceInputalso declarescall_level,feeds_level,feeds_preferencesanduser_id. Thedomain input types have no counterpart for any of them, so they are absent rather than defaulted.
queryBannedUserswas in scope and is deferred: the generatedQueryBannedUsersPayloadhas nocounterpart for the four
created_at_*filters the SDK sends. Go's payload embeds*types.BansPagerwhich declares them, but the payload's
OpenAPIInfo()hand-lists its properties and includes onlylimitandoffsetfrom that pager, so the spec under-declares fields the endpoint accepts. Adoptingit would silently return unfiltered bans. Tracked in
AND-1406.
Testing
RequestBodiesAdapterTestpins the serialized body for the members query and for the three distinctpush-preference shapes (
chat_level,disabled_until,chat_preferences). The sort is aSortParamRequestliteral rather than the output of the same conversion the payload uses.MoshiChatApiTestcases for the six push-preference entry points now assert the generated request.would not cover the others. All six round-tripped: the levels and snooze timestamps came back as set,
and the chat toggles came back populated, which is the field a previous slice silently dropped. Absent
values are omitted from the body rather than sent as
null.queryMemberswent out as a URL querypayload and returned the member with its role.