|
36 | 36 | import com.google.gson.reflect.TypeToken; |
37 | 37 |
|
38 | 38 | import java.io.IOException; |
| 39 | +import java.util.HashSet; |
39 | 40 |
|
40 | 41 |
|
41 | 42 | import com.twitter.clientlib.model.BookmarkAddRequest; |
@@ -167,6 +168,19 @@ public class APIgetUsersIdBookmarksRequest { |
167 | 168 | private Set<String> pollFields; |
168 | 169 | private Set<String> userFields; |
169 | 170 | private Set<String> placeFields; |
| 171 | + private final Set<String> tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); |
| 172 | + private final Set<String> expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); |
| 173 | + private final Set<String> mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); |
| 174 | + private final Set<String> pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); |
| 175 | + private final Set<String> userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); |
| 176 | + private final Set<String> placeFieldsAll = new HashSet<>(Arrays.asList("contained_within", "country", "country_code", "full_name", "geo", "id", "name", "place_type")); |
| 177 | + |
| 178 | + private boolean isExclude = false; |
| 179 | + |
| 180 | + public APIgetUsersIdBookmarksRequest excludeInputFields() { |
| 181 | + isExclude = true; |
| 182 | + return this; |
| 183 | + } |
170 | 184 |
|
171 | 185 | private APIgetUsersIdBookmarksRequest(String id) { |
172 | 186 | this.id = id; |
@@ -280,6 +294,13 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { |
280 | 294 | </table> |
281 | 295 | */ |
282 | 296 | public Get2UsersIdBookmarksResponse execute() throws ApiException { |
| 297 | + tweetFields = getFields("tweetFields", isExclude, tweetFields, tweetFieldsAll); |
| 298 | + expansions = getFields("expansions", isExclude, expansions, expansionsAll); |
| 299 | + mediaFields = getFields("mediaFields", isExclude, mediaFields, mediaFieldsAll); |
| 300 | + pollFields = getFields("pollFields", isExclude, pollFields, pollFieldsAll); |
| 301 | + userFields = getFields("userFields", isExclude, userFields, userFieldsAll); |
| 302 | + placeFields = getFields("placeFields", isExclude, placeFields, placeFieldsAll); |
| 303 | + |
283 | 304 | ApiResponse<Get2UsersIdBookmarksResponse> localVarResp = getUsersIdBookmarksWithHttpInfo(id, maxResults, paginationToken, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); |
284 | 305 | return localVarResp.getData(); |
285 | 306 | } |
@@ -422,6 +443,8 @@ private okhttp3.Call postUsersIdBookmarksAsync(BookmarkAddRequest bookmarkAddReq |
422 | 443 | public class APIpostUsersIdBookmarksRequest { |
423 | 444 | private final BookmarkAddRequest bookmarkAddRequest; |
424 | 445 | private final String id; |
| 446 | + |
| 447 | + |
425 | 448 |
|
426 | 449 | private APIpostUsersIdBookmarksRequest(BookmarkAddRequest bookmarkAddRequest, String id) { |
427 | 450 | this.bookmarkAddRequest = bookmarkAddRequest; |
@@ -456,6 +479,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { |
456 | 479 | </table> |
457 | 480 | */ |
458 | 481 | public BookmarkMutationResponse execute() throws ApiException { |
| 482 | + |
459 | 483 | ApiResponse<BookmarkMutationResponse> localVarResp = postUsersIdBookmarksWithHttpInfo(bookmarkAddRequest, id); |
460 | 484 | return localVarResp.getData(); |
461 | 485 | } |
@@ -600,6 +624,8 @@ private okhttp3.Call usersIdBookmarksDeleteAsync(String id, String tweetId, fina |
600 | 624 | public class APIusersIdBookmarksDeleteRequest { |
601 | 625 | private final String id; |
602 | 626 | private final String tweetId; |
| 627 | + |
| 628 | + |
603 | 629 |
|
604 | 630 | private APIusersIdBookmarksDeleteRequest(String id, String tweetId) { |
605 | 631 | this.id = id; |
@@ -634,6 +660,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { |
634 | 660 | </table> |
635 | 661 | */ |
636 | 662 | public BookmarkMutationResponse execute() throws ApiException { |
| 663 | + |
637 | 664 | ApiResponse<BookmarkMutationResponse> localVarResp = usersIdBookmarksDeleteWithHttpInfo(id, tweetId); |
638 | 665 | return localVarResp.getData(); |
639 | 666 | } |
|
0 commit comments