Skip to content

Commit 98d9589

Browse files
tmoskovitchzacmos
authored andcommitted
2.43 added usersIdTimeline endpoint
1 parent 599573b commit 98d9589

File tree

5 files changed

+414
-17
lines changed

5 files changed

+414
-17
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ You can find examples of using the SDK under the [examples/](examples/) director
66

77
**Note: Only Twitter API V2 is supported**
88

9-
- API version: 2.42
9+
- API version: 2.43
1010

1111
Twitter API v2 available endpoints
1212

1313
For more information, please visit [https://developer.twitter.com/](https://developer.twitter.com/)
1414

15-
1615
## Table of contents
1716

1817
- [Requirements](#requirements)
@@ -31,8 +30,6 @@ Twitter API v2 available endpoints
3130
- [Documentation for Models](#documentation-for-models)
3231

3332

34-
35-
3633
## Requirements
3734

3835
Building the API client library requires:
@@ -294,6 +291,7 @@ Class | Method | HTTP request | Description
294291
*TweetsApi* | [**usersIdLikedTweets**](docs/TweetsApi.md#usersIdLikedTweets) | **GET** /2/users/{id}/liked_tweets | Returns Tweet objects liked by the provided User ID
295292
*TweetsApi* | [**usersIdMentions**](docs/TweetsApi.md#usersIdMentions) | **GET** /2/users/{id}/mentions | User mention timeline by User ID
296293
*TweetsApi* | [**usersIdRetweets**](docs/TweetsApi.md#usersIdRetweets) | **POST** /2/users/{id}/retweets | Causes the user (in the path) to retweet the specified tweet
294+
*TweetsApi* | [**usersIdTimeline**](docs/TweetsApi.md#usersIdTimeline) | **GET** /2/users/{id}/timelines/reverse_chronological | User home timeline by User ID
297295
*TweetsApi* | [**usersIdTweets**](docs/TweetsApi.md#usersIdTweets) | **GET** /2/users/{id}/tweets | User Tweets timeline by User ID
298296
*TweetsApi* | [**usersIdUnlike**](docs/TweetsApi.md#usersIdUnlike) | **DELETE** /2/users/{id}/likes/{tweet_id} | Causes the user (in the path) to unlike the specified tweet
299297
*TweetsApi* | [**usersIdUnretweets**](docs/TweetsApi.md#usersIdUnretweets) | **DELETE** /2/users/{id}/retweets/{source_tweet_id} | Causes the user (in the path) to unretweet the specified tweet

docs/TweetsApi.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ All URIs are relative to *https://api.twitter.com*
2525
| [**usersIdLikedTweets**](TweetsApi.md#usersIdLikedTweets) | **GET** /2/users/{id}/liked_tweets | Returns Tweet objects liked by the provided User ID |
2626
| [**usersIdMentions**](TweetsApi.md#usersIdMentions) | **GET** /2/users/{id}/mentions | User mention timeline by User ID |
2727
| [**usersIdRetweets**](TweetsApi.md#usersIdRetweets) | **POST** /2/users/{id}/retweets | Causes the user (in the path) to retweet the specified tweet |
28+
| [**usersIdTimeline**](TweetsApi.md#usersIdTimeline) | **GET** /2/users/{id}/timelines/reverse_chronological | User home timeline by User ID |
2829
| [**usersIdTweets**](TweetsApi.md#usersIdTweets) | **GET** /2/users/{id}/tweets | User Tweets timeline by User ID |
2930
| [**usersIdUnlike**](TweetsApi.md#usersIdUnlike) | **DELETE** /2/users/{id}/likes/{tweet_id} | Causes the user (in the path) to unlike the specified tweet |
3031
| [**usersIdUnretweets**](TweetsApi.md#usersIdUnretweets) | **DELETE** /2/users/{id}/retweets/{source_tweet_id} | Causes the user (in the path) to unretweet the specified tweet |
@@ -2090,6 +2091,117 @@ public class Example {
20902091
| **200** | The request was successful | - |
20912092
| **0** | The request has failed. | - |
20922093

2094+
<a name="usersIdTimeline"></a>
2095+
# **usersIdTimeline**
2096+
> GenericTweetsTimelineResponse usersIdTimeline(id, sinceId, untilId, maxResults, exclude, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields)
2097+
2098+
User home timeline by User ID
2099+
2100+
Returns Tweet objects that appears in the provided User ID&#39;s home timeline
2101+
2102+
### Example
2103+
```java
2104+
// Import classes:
2105+
import com.twitter.clientlib.ApiClient;
2106+
import com.twitter.clientlib.ApiException;
2107+
import com.twitter.clientlib.Configuration;
2108+
import com.twitter.clientlib.auth.*;
2109+
import com.twitter.clientlib.model.*;
2110+
import com.twitter.clientlib.TwitterCredentialsOAuth2;
2111+
import com.twitter.clientlib.TwitterCredentialsBearer;
2112+
import com.twitter.clientlib.api.TwitterApi;
2113+
2114+
import com.twitter.clientlib.api.TweetsApi;
2115+
import java.util.List;
2116+
import java.util.Set;
2117+
import java.util.Arrays;
2118+
import java.util.HashSet;
2119+
import java.time.OffsetDateTime;
2120+
2121+
public class Example {
2122+
public static void main(String[] args) {
2123+
TwitterApi apiInstance = new TwitterApi();
2124+
// Set the credentials based on the API's "security" tag values.
2125+
// Check the API definition in https://api.twitter.com/2/openapi.json
2126+
// When multiple options exist, the SDK supports only "OAuth2UserToken" or "BearerToken"
2127+
2128+
// Uncomment and set the credentials configuration
2129+
2130+
// Configure OAuth2 access token for authorization:
2131+
// TwitterCredentialsOAuth2 credentials = new TwitterCredentialsOAuth2(System.getenv("TWITTER_OAUTH2_CLIENT_ID"),
2132+
// System.getenv("TWITTER_OAUTH2_CLIENT_SECRET"),
2133+
// System.getenv("TWITTER_OAUTH2_ACCESS_TOKEN"),
2134+
// System.getenv("TWITTER_OAUTH2_REFRESH_TOKEN"));
2135+
// apiInstance.setTwitterCredentials(credentials);
2136+
2137+
2138+
// Set the params values
2139+
String id = "id_example"; // String | The ID of the User to list Reverse Chronological Timeline Tweets of
2140+
String sinceId = "791775337160081409"; // String | The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.
2141+
String untilId = "1346889436626259968"; // String | The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.
2142+
Integer maxResults = 56; // Integer | The maximum number of results
2143+
Set<String> exclude = new HashSet<>(Arrays.asList()); // Set<String> | The set of entities to exclude (e.g. 'replies' or 'retweets')
2144+
String paginationToken = "paginationToken_example"; // String | This parameter is used to get the next 'page' of results.
2145+
OffsetDateTime startTime = OffsetDateTime.parse("2021-02-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.
2146+
OffsetDateTime endTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.
2147+
Set<String> expansions = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of fields to expand.
2148+
Set<String> tweetFields = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of Tweet fields to display.
2149+
Set<String> userFields = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of User fields to display.
2150+
Set<String> mediaFields = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of Media fields to display.
2151+
Set<String> placeFields = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of Place fields to display.
2152+
Set<String> pollFields = new HashSet<>(Arrays.asList()); // Set<String> | A comma separated list of Poll fields to display.
2153+
try {
2154+
GenericTweetsTimelineResponse result = apiInstance.tweets().usersIdTimeline(id, sinceId, untilId, maxResults, exclude, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields);
2155+
System.out.println(result);
2156+
} catch (ApiException e) {
2157+
System.err.println("Exception when calling TweetsApi#usersIdTimeline");
2158+
System.err.println("Status code: " + e.getCode());
2159+
System.err.println("Reason: " + e.getResponseBody());
2160+
System.err.println("Response headers: " + e.getResponseHeaders());
2161+
e.printStackTrace();
2162+
}
2163+
}
2164+
}
2165+
```
2166+
2167+
### Parameters
2168+
2169+
| Name | Type | Description | Notes |
2170+
|------------- | ------------- | ------------- | -------------|
2171+
| **id** | **String**| The ID of the User to list Reverse Chronological Timeline Tweets of | |
2172+
| **sinceId** | **String**| The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. | [optional] |
2173+
| **untilId** | **String**| The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. | [optional] |
2174+
| **maxResults** | **Integer**| The maximum number of results | [optional] |
2175+
| **exclude** | [**Set&lt;String&gt;**](String.md)| The set of entities to exclude (e.g. &#39;replies&#39; or &#39;retweets&#39;) | [optional] [enum: replies, retweets] |
2176+
| **paginationToken** | **String**| This parameter is used to get the next &#39;page&#39; of results. | [optional] |
2177+
| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. | [optional] |
2178+
| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. | [optional] |
2179+
| **expansions** | [**Set&lt;String&gt;**](String.md)| A comma separated list of fields to expand. | [optional] [enum: author_id, referenced_tweets.id, in_reply_to_user_id, geo.place_id, attachments.media_keys, attachments.poll_ids, entities.mentions.username, referenced_tweets.id.author_id] |
2180+
| **tweetFields** | [**Set&lt;String&gt;**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: id, created_at, text, author_id, in_reply_to_user_id, referenced_tweets, attachments, withheld, geo, entities, public_metrics, possibly_sensitive, source, lang, context_annotations, non_public_metrics, promoted_metrics, organic_metrics, conversation_id, reply_settings] |
2181+
| **userFields** | [**Set&lt;String&gt;**](String.md)| A comma separated list of User fields to display. | [optional] [enum: id, created_at, name, username, protected, verified, withheld, profile_image_url, location, url, description, entities, pinned_tweet_id, public_metrics] |
2182+
| **mediaFields** | [**Set&lt;String&gt;**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: media_key, duration_ms, height, preview_image_url, type, url, width, public_metrics, non_public_metrics, organic_metrics, promoted_metrics, alt_text, variants] |
2183+
| **placeFields** | [**Set&lt;String&gt;**](String.md)| A comma separated list of Place fields to display. | [optional] [enum: id, name, country_code, place_type, full_name, country, contained_within, geo] |
2184+
| **pollFields** | [**Set&lt;String&gt;**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: id, options, voting_status, end_datetime, duration_minutes] |
2185+
2186+
### Return type
2187+
2188+
[**GenericTweetsTimelineResponse**](GenericTweetsTimelineResponse.md)
2189+
2190+
### Authorization
2191+
2192+
[OAuth2UserToken](../README.md#OAuth2UserToken), [UserToken](../README.md#UserToken)
2193+
2194+
### HTTP request headers
2195+
2196+
- **Content-Type**: Not defined
2197+
- **Accept**: application/json, application/problem+json
2198+
2199+
### HTTP response details
2200+
| Status code | Description | Response headers |
2201+
|-------------|-------------|------------------|
2202+
| **200** | The request was successful | - |
2203+
| **0** | The request has failed. | - |
2204+
20932205
<a name="usersIdTweets"></a>
20942206
# **usersIdTweets**
20952207
> GenericTweetsTimelineResponse usersIdTweets(id, sinceId, untilId, maxResults, exclude, paginationToken, startTime, endTime, expansions, tweetFields, userFields, mediaFields, placeFields, pollFields)

pom.xml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@
3939
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
4040
</repository>
4141
</distributionManagement>
42-
<repositories>
43-
<repository>
44-
<id>sonatype-nexus-snapshots</id>
45-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
46-
<releases>
47-
<enabled>false</enabled>
48-
</releases>
49-
<snapshots>
50-
<enabled>true</enabled>
51-
</snapshots>
52-
</repository>
53-
</repositories>
5442
<build>
5543
<plugins>
5644
<plugin>
@@ -246,9 +234,20 @@
246234

247235
<profiles>
248236
<profile>
249-
<id>sign-artifacts</id>
237+
<id>release</id>
250238
<build>
251239
<plugins>
240+
<plugin>
241+
<groupId>org.sonatype.plugins</groupId>
242+
<artifactId>nexus-staging-maven-plugin</artifactId>
243+
<version>1.6.7</version>
244+
<extensions>true</extensions>
245+
<configuration>
246+
<serverId>ossrh</serverId>
247+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
248+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
249+
</configuration>
250+
</plugin>
252251
<plugin>
253252
<groupId>org.apache.maven.plugins</groupId>
254253
<artifactId>maven-gpg-plugin</artifactId>
@@ -260,6 +259,10 @@
260259
<goals>
261260
<goal>sign</goal>
262261
</goals>
262+
<configuration>
263+
<keyname>${gpg.keyname}</keyname>
264+
<passphraseServerId>${gpg.passphrase}</passphraseServerId>
265+
</configuration>
263266
</execution>
264267
</executions>
265268
</plugin>

0 commit comments

Comments
 (0)