From 5ff0987ef080a52ed45887176924c19517072291 Mon Sep 17 00:00:00 2001 From: "Frey, Kerry" Date: Mon, 16 Sep 2024 17:00:06 -0400 Subject: [PATCH] More Twitter json changes. --- .../io/github/redouane59/twitter/dto/tweet/Tweet.java | 5 +++++ .../github/redouane59/twitter/dto/tweet/TweetV1.java | 6 ++++++ .../github/redouane59/twitter/dto/tweet/TweetV2.java | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/main/java/io/github/redouane59/twitter/dto/tweet/Tweet.java b/src/main/java/io/github/redouane59/twitter/dto/tweet/Tweet.java index 4c622824..c56fc617 100644 --- a/src/main/java/io/github/redouane59/twitter/dto/tweet/Tweet.java +++ b/src/main/java/io/github/redouane59/twitter/dto/tweet/Tweet.java @@ -173,4 +173,9 @@ public interface Tweet { * Get the reposts of the tweet */ Reposts getReposts(); + + /** + * Get the edit history of the tweet + */ + List getEditHistoryTweetIds(); } diff --git a/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV1.java b/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV1.java index 8f143aa1..eda062a5 100644 --- a/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV1.java +++ b/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV1.java @@ -127,6 +127,12 @@ public String getSource() { return null; } + @Override + public List getEditHistoryTweetIds() { + LOGGER.error(NOT_IMPLEMENTED_EXCEPTION); + return Collections.emptyList(); + } + @Override public List getMedia() { if (entities != null) { diff --git a/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV2.java b/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV2.java index b1d800bc..b8f7300e 100644 --- a/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV2.java +++ b/src/main/java/io/github/redouane59/twitter/dto/tweet/TweetV2.java @@ -150,6 +150,14 @@ public String getSource() { return data.getSource(); } + @Override + public List getEditHistoryTweetIds() { + if (data == null) { + return null; + } + return data.getEditHistoryTweetIds(); + } + @Override public Entities getEntities() { if (data == null) { @@ -299,6 +307,8 @@ public static class TweetData implements Tweet { private Geo geo; private String source; private AdditionalProperties additionalProperties; + @JsonProperty("edit_history_tweet_ids") + private List editHistoryTweetIds;