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.
Add Poll Support to Java SDK
Overview
This PR adds comprehensive support for the Polls feature in the Stream Chat Java SDK, allowing users to create, manage, and interact with polls in their chat applications.
Features Added
Poll Management
Poll Options Management
Poll Voting
Channel Type Support
pollsfield toChannelTypemodel to enable polls at the channel type levelAPI Endpoints Covered
Poll CRUD
POST /polls- Create pollGET /polls/{poll_id}- Get pollPUT /polls- Update pollPATCH /polls/{poll_id}- Partial update pollDELETE /polls/{poll_id}- Delete pollPOST /polls/query- Query pollsPoll Options
POST /polls/{poll_id}/options- Create optionGET /polls/{poll_id}/options/{option_id}- Get optionPUT /polls/{poll_id}/options- Update optionDELETE /polls/{poll_id}/options/{option_id}- Delete optionPoll Votes
POST /polls/{poll_id}/votes- Query votesPOST /messages/{message_id}/polls/{poll_id}/vote- Cast voteDELETE /messages/{message_id}/polls/{poll_id}/vote/{vote_id}- Delete voteImplementation Details
New Files
src/main/java/io/getstream/chat/java/models/Poll.java- Complete poll model with all request/response typessrc/main/java/io/getstream/chat/java/services/PollService.java- Retrofit service interface for poll operationssrc/test/java/io/getstream/chat/java/PollTest.java- Comprehensive unit testsModified Files
src/main/java/io/getstream/chat/java/models/ChannelType.java- Addedpollsfield support for channel type configurationKey Features
Poll Configuration
Type Safety
@NotNulland@NullableannotationsAuthentication
user_idparameter for server-side authenticationuserobject anduser_idstring in requestsTesting
Comprehensive test coverage including:
All tests follow existing patterns and use JUnit 5.
Usage Example
CLA
Description of the pull request