-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement post DM V2 endpoints (#420)
* feat_impl_post_dm_endpoints * adding constructor * improving signatures
- Loading branch information
1 parent
703e6c9
commit b8bf00f
Showing
7 changed files
with
248 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
26 changes: 26 additions & 0 deletions
26
src/main/java/io/github/redouane59/twitter/dto/dm/DmParameters.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.github.redouane59.twitter.dto.dm; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.List; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
public class DmParameters { | ||
|
||
@JsonProperty("conversation_type") | ||
@Builder.Default | ||
private String conversationType = "Group"; | ||
@JsonProperty("message") | ||
private DmMessage message; | ||
@JsonProperty("participant_ids") | ||
private List<String> participantIds; | ||
|
||
@Builder | ||
@Getter | ||
public static class DmMessage { | ||
|
||
private String text; | ||
private String attachments; // @to be improved | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/io/github/redouane59/twitter/dto/dm/PostDmResponse.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.github.redouane59.twitter.dto.dm; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class PostDmResponse { | ||
|
||
private PostDmEvent data; | ||
|
||
@Getter | ||
public static class PostDmEvent { | ||
|
||
@JsonProperty("dm_conversation_id") | ||
private String dmConversationId; | ||
@JsonProperty("dm_event_id") | ||
private String dmEventId; | ||
|
||
} | ||
} |
Oops, something went wrong.