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 Campaign Feature Support to Java SDK
Summary
This PR adds complete campaign feature support to the stream-chat-java SDK, matching the Python SDK implementation. All 7 backend campaign routes are now fully implemented and tested.
Backend Routes Implemented
POST /campaigns- Create campaignGET /campaigns/{id}- Get campaign by IDPUT /campaigns/{id}- Update campaignDELETE /campaigns/{id}- Delete campaignPOST /campaigns/{id}/start- Start campaign (with optional scheduling)POST /campaigns/{id}/stop- Stop campaignPOST /campaigns/query- Query campaigns with filters and sortingChanges
New Files
src/main/java/io/getstream/chat/java/services/CampaignService.java- Retrofit service interfacesrc/main/java/io/getstream/chat/java/models/Campaign.java- Campaign model classMessageTemplate,MemberTemplate,ChannelTemplate@Builderpattern for all operationsStreamRequest<T>for all operationsStreamResponseObjectfor all operationscreate(),get(),update(),delete(),start(),stop(),query()Test Files
src/test/java/io/getstream/chat/java/CampaignTest.java- Comprehensive JUnit 5 tests covering:Features
@NotNulland@NullableannotationsDatetype forscheduled_forandstop_atparametersFilterConditionandSortutilities@Data,@Builder,@Getter,@EqualsAndHashCodefor boilerplate reductionCode Quality
Testing
All campaign tests pass successfully:
Example Usage
// Create a campaign
// Get a campaign
// Update a campaign
// Start a campaign with scheduling
// Stop a campaign
// Query campaigns
// Delete a campaign
Campaign.delete(campaignId).request();CLA
Description of the pull request