Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream wrapper functionality #27

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can find examples of using the SDK under the [examples/](examples/) director

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

- API version: 2.45
- API version: 2.46

Twitter API v2 available endpoints

Expand Down Expand Up @@ -228,8 +228,8 @@ In order to use the retry mechanism call the APIs with an additional parameter `

```java
int retries = 4;
streamResult = apiInstance.tweets()apiInstance.tweets().sampleStream()
.tweetFields(tweetFields)
streamResult = apiInstance.tweets().sampleStream()
.parameters(new StreamQueryParameters.Builder.withTweetFields(tweetFields).build())
.execute(retries);

```
Expand Down Expand Up @@ -530,6 +530,13 @@ Class | Method | HTTP request | Description
- [VideoAllOfPromotedMetrics](docs/VideoAllOfPromotedMetrics.md)
- [VideoAllOfPublicMetrics](docs/VideoAllOfPublicMetrics.md)

## Documentation for Stream Functionality


Class | Method | HTTP request | Description
------------ |--------------------------------------------------------| ------------- | -------------
*TwitterStream* | [**sampleStream**](docs/TwitterStream.md#sampleStream) | **GET** /2/tweets/sample/stream | Processing stream with multiple threads accepts listeners with the produced tweets




Expand Down
114 changes: 114 additions & 0 deletions docs/StreamQueryParameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@


# StreamQueryParameters


## Properties


| Name | Type | Description | Notes |
|------------- |----------------------------------------------| ------------- | -------------|
| **backfillMinutes** | **Integer** | The number of minutes of backfill requested. | [optional] |
| **tweetFields** | [**Collection<TweetField>**](#TweetField) | A comma separated list of Tweet fields to display. | [optional] [enum: 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] |
| **expansions** | [**Collection<Expansion>**](#Expansion) | A comma separated list of fields to expand. | [optional] [enum: 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] |
| **mediaFields** | [**Collection<MediaField>**](#MediaField) | A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] |
| **pollFields** | [**Collection<PollField>**](#PollField) | A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] |
| **userFields** | [**Collection<UserField>**](#UserField) | A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] |
| **placeFields** | [**Collection<PlaceField>**](#PlaceField) | A comma separated list of Place fields to display. | [optional] [enum: contained_within, country, country_code, full_name, geo, id, name, place_type] |




## Enum: TweetField

| Name | Value |
|---- | -----|
|ATTACHMENTS|"attachments"|
|AUTHOR_ID|"author_id"|
|CONTEXT_ANNOTATIONS|"context_annotations"|
|CONVERSATION_ID|"conversation_id"|
|CREATED_AT|"created_at"|
|ENTITIES|"entities"|
|GEO|"geo"|
|ID|"id"|
|IN_REPLY_TO_USER_ID|"in_reply_to_user_id"|
|LANG|"lang"|
|POSSIBLE_SENSITIVE|"possibly_sensitive"|
|PUBLIC_METRICS|"public_metrics"|
|REFERENCED_TWEETS|"referenced_tweets"|
|REPLY_SETTINGS|"reply_settings"|
|SOURCE|"source"|
|TEXT|"text"|
|WITHHELD|"withheld"|


## Enum: Expansion

| Name | Value |
|---- | -----|
|ATTACHMENTS_MEDIA_KEYS|"attachments.media_keys"|
|ATTACHMENTS_POLL_IDS|"attachments.poll_ids"|
|AUTHOR_ID|"author_id"|
|ENTITIES_MENTIONS_USERNAME|"entities.mentions.username"|
|GEO_PLACE_ID|"geo.place_id"|
|IN_REPLY_TO_USER_ID|"in_reply_to_user_id"|
|REFERENCED_TWEETS_ID|"referenced_tweets.id"|
|REFERENCED_TWEETS_ID_AUTHOR_ID|"referenced_tweets.id.author_id"|

## Enum: MediaField

| Name | Value |
|---- | -----|
|ALT_TEXT|"alt_text"|
|DURATION_MS|"duration_ms"|
|HEIGHT|"height"|
|MEDIA_KEY|"media_key"|
|PREVIEW_IMAGE_URL|"preview_image_url"|
|PUBLIC_METRICS|"public_metrics"|
|TYPE|"type"|
|URL|"url"|
|VARIANTS|"variants"|
|WIDTH|"width"|


## Enum: PollField

| Name | Value |
|---- | -----|
|DURATION_MINUTES|"duration_minutes"|
|END_DATETIME|"end_datetime"|
|ID|"id"|
|OPTIONS|"options"|
|VOTING_STATUS|"voting_status"|

## Enum: UserField

| Name | Value |
|---- | -----|
|CREATED_AT|"created_at"|
|DESCRIPTION|"description"|
|ENTITIES|"entities"|
|ID|"id"|
|LOCATION|"location"|
|NAME|"name"|
|PINNED_TWEET_ID|"pinned_tweet_id"|
|PROFILE_IMAGE_URL|"profile_image_url"|
|PROTECTED|"protected"|
|PUBLIC_METRICS|"public_metrics"|
|URL|"url"|
|USERNAME|"username"|
|VERIFIED|"verified"|
|WITHHELD|"withheld"|

## Enum: PlaceField

| Name | Value |
|---- | -----|
|CONTAINED_WITHIN|"contained_within"|
|COUNTRY|"country"|
|COUNTRY_CODE|"country_code"|
|FULL_NAME|"full_name"|
|GEO|"geo"|
|ID|"id"|
|NAME|"name"|
|PLACE_TYPE|"place_type"|
Loading