Skip to content

Align API names with Twitch reference, fix pagination deserialization#58

Merged
Its-donkey merged 2 commits intotestfrom
fix/api-name-alignment-and-pagination
Feb 10, 2026
Merged

Align API names with Twitch reference, fix pagination deserialization#58
Its-donkey merged 2 commits intotestfrom
fix/api-name-alignment-and-pagination

Conversation

@Its-donkey
Copy link
Copy Markdown
Owner

Summary

  • Rename 5 public functions to match official Twitch API endpoint names: GetCustomReward, GetCustomRewardRedemption, GetCharityCampaignDonations, AddSuspiciousStatusToChatUser, RemoveSuspiciousStatusFromChatUser
  • Update GetCharityCampaign to accept *GetCharityCampaignParams (with pagination) and return *Response[CharityCampaign] for consistency
  • Fix pagination deserialization for endpoints where Twitch returns "pagination": "" instead of {"cursor": "..."} (e.g. Get Extension Live Channels)

Breaking Changes

All renames include corresponding params types. See CHANGELOG for full details.

Testing

  • All existing tests updated and passing
  • New tests: TestClient_GetCharityCampaign_Pagination, TestClient_GetExtensionLiveChannels_StringPagination
  • staticcheck clean

Rename functions to match official Twitch API endpoint names:
- GetCustomRewards → GetCustomReward
- GetCustomRewardRedemptions → GetCustomRewardRedemption
- GetCharityDonations → GetCharityCampaignDonations
- AddSuspiciousUserStatus → AddSuspiciousStatusToChatUser
- RemoveSuspiciousUserStatus → RemoveSuspiciousStatusFromChatUser

Update GetCharityCampaign to accept GetCharityCampaignParams with
pagination support and return *Response[CharityCampaign] for
consistency with other endpoints.

Add custom Pagination.UnmarshalJSON to handle Twitch endpoints that
return pagination as an empty string instead of an object.
@Its-donkey Its-donkey merged commit 99b752d into test Feb 10, 2026
6 checks passed
@Its-donkey Its-donkey deleted the fix/api-name-alignment-and-pagination branch February 10, 2026 14:07
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