Skip to content

Commit

Permalink
Merge #507
Browse files Browse the repository at this point in the history
507: fix: removed deprecated methods r=myConsciousness a=myConsciousness

# 1. Description

<!-- Provide a description of what this PR is doing.
If you're modifying existing behavior, describe the existing behavior, how this PR is changing it,
and what motivated the change. If this is a breaking change, specify explicitly which APIs have been
changed. -->

## 1.1. Checklist

<!-- Before you create this PR confirm that it meets all requirements listed below by checking the
relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. -->

- [x] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc).
- [x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
- [x] I have updated/added tests for ALL new/updated/fixed functionality.
- [x] I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples`.

## 1.2. Breaking Change

<!-- Does your PR require users to manually update their apps to accommodate your change?

If the PR is a breaking change this should be indicated with suffix "!"  (for example, `feat!:`, `fix!:`). See [Conventional Commit] for details.
-->

- [x] Yes, this is a breaking change.
- [ ] No, this is _not_ a breaking change.

## 1.3. Related Issues

<!-- Provide a list of issues related to this PR from the [issue database].
Indicate which of these issues are resolved or fixed by this PR, i.e. Fixes #xxxx* !-->

<!-- Links -->

[issue database]: https://github.com/twitter-dart/twitter-api-v2/issues
[contributor guide]: https://github.com/twitter-dart/twitter-api-v2/blob/main/CONTRIBUTING.md
[style guide]: https://github.com/twitter-dart/twitter-api-v2/blob/main/STYLEGUIDE.md
[conventional commit]: https://conventionalcommits.org


Co-authored-by: myConsciousness <[email protected]>
Co-authored-by: KATO, Shinya / 加藤 真也 <[email protected]>
  • Loading branch information
bors[bot] and myConsciousness authored Oct 30, 2022
2 parents ccc106b + 2d14766 commit 06e9aa1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 143 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## v4.3.0

- Removed deprecated methods.
- Use `tweets.connectSampleStream` instead of `tweets.connectVolumeStream`.
- Use `tweets.createThreads` instead of `createThreadTweets`.
- Added `WithheldCountry` enum. This is an enumeration that supports country codes according to the ISO Alpha2 standard, an international standard, as well as `XX` (all countries) and `XY` (DMCA Request), which are supported by Twitter. With the addition of this enumeration, the following response object types have been modified to be safer. Also, refactored field names. ([#500](https://github.com/twitter-dart/twitter-api-v2/issues/500))
- From `TweetWithheld.countryCodes` to `TweetWithheld.countries`
- From `UserWithheld.countryCodes` to `UserWithheld.countries`
- Added an object that allows easy and safe generation of filtering rules for FilteredStream. You can generate filtering rules fluently and easily from the `FilteringRule` object. ([#248](https://github.com/twitter-dart/twitter-api-v2/issues/248))

## v4.2.4

Expand Down
138 changes: 1 addition & 137 deletions lib/src/service/tweets/tweets_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2476,121 +2476,6 @@ abstract class TweetsService {
/// ## Reference
///
/// - https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream
@Deprecated('Use "connectSampleStream" instead. Will be removed in v4.3.0')
Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
connectVolumeStream({
int? backfillMinutes,
List<TweetExpansion>? expansions,
List<TweetField>? tweetFields,
List<UserField>? userFields,
List<PlaceField>? placeFields,
List<PollField>? pollFields,
List<MediaField>? mediaFields,
});

/// Streams about 1% of all Tweets in real-time.
///
/// If you have [Academic Research access](https://developer.twitter.com/en/products/twitter-api/academic-research),
/// you can connect up to two [redundant connections](https://developer.twitter.com/en/docs/twitter-api/tweets/sampled-stream/integrate/recovery-and-redundancy-features)
/// to maximize your streaming up-time.
///
/// ## Parameters
///
/// - [backfillMinutes]: By passing this parameter, you can request up to five
/// (5) minutes worth of streaming data that you might
/// have missed during a disconnection to be delivered to
/// you upon reconnection. The backfilled Tweets will
/// automatically flow through the reconnected stream,
/// with older Tweets generally being delivered before
/// any newly matching Tweets. You must include a whole
/// number between 1 and 5 as the value to this
/// parameter.
///
/// This feature will deliver duplicate Tweets, meaning
/// that if you were disconnected for 90 seconds, and you
/// requested two minutes of backfill, you will receive
/// 30 seconds worth of duplicate Tweets. Due to this,
/// you should make sure your system is tolerant of
/// duplicate data.
///
/// This feature is currently only available to those
/// that have been approved for Academic Research access.
/// To learn more about this access level, please visit
/// our section on [Academic Research](https://developer.twitter.com/en/products/twitter-api/academic-research).
///
/// - [expansions]: Expansions enable you to request additional data objects
/// that relate to the originally returned Tweets. Submit a
/// list of desired expansions in a comma-separated list
/// without spaces. The ID that represents the expanded data
/// object will be included directly in the Tweet data object,
/// but the expanded object metadata will be returned within
/// the includes response object, and will also include the
/// ID so that you can match this data object to the original
/// Tweet object.
///
/// - [tweetFields]: This fields parameter enables you to select which
/// specific Tweet fields will deliver in each returned Tweet
/// object. You can also pass `expansions` to return the
/// specified fields for both the original Tweet and any
/// included referenced Tweets. The requested Tweet fields
/// will display in both the original Tweet data object, as
/// well as in the referenced Tweet expanded data object that
/// will be located in the `includes` data object.
///
/// - [userFields]: This fields parameter enables you to select which specific
/// user fields will deliver in each returned Tweet. While the
/// user ID will be located in the original Tweet object, you
/// will find this ID and all additional user fields in the
/// `includes` data object.
///
/// - [placeFields]: This fields parameter enables you to select which
/// specific place fields will deliver in each returned
/// Tweet. Specify the desired fields in a comma-separated
/// list without spaces between commas and fields. The Tweet
/// will only return place fields if the Tweet contains a
/// place and if you’ve also included the
/// `expansions=geo.place_id` query parameter in your
/// request. While the place ID will be located in the Tweet
/// object, you will find this ID and all additional place
/// fields in the `includes` data object.
///
/// - [pollFields]: This fields parameter enables you to select which specific
/// poll fields will deliver in each returned Tweet. Specify
/// the desired fields in a comma-separated list without
/// spaces between commas and fields. The Tweet will only
/// return poll fields if the Tweet contains a poll and if
/// you've also included the `expansions=attachments.poll_ids`
/// query parameter in your request. While the poll ID will be
/// located in the Tweet object, you will find this ID and all
/// additional poll fields in the `includes` data object.
///
/// - [mediaFields]: This fields parameter enables you to select which
/// specific media fields will deliver in each returned
/// Tweet. Specify the desired fields in a comma-separated
/// list without spaces between commas and fields. The Tweet
/// will only return media fields if the Tweet contains media
/// and if you've also included the
/// `expansions=attachments.media_keys` query parameter in
/// your request. While the media ID will be located in the
/// Tweet object, you will find this ID and all additional
/// media fields in the `includes` data object.
///
/// ## Endpoint Url
///
/// - https://api.twitter.com/2/tweets/sample/stream
///
/// ## Authentication Methods
///
/// - OAuth 2.0 App-only
///
/// ## Rate Limits
///
/// - **App rate limit (OAuth 2.0 App Access Token)**:
/// 50 requests per 15-minute window shared among all users of your app
///
/// ## Reference
///
/// - https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream
Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
connectSampleStream({
int? backfillMinutes,
Expand Down Expand Up @@ -3564,7 +3449,7 @@ class _TweetsService extends BaseService implements TweetsService {

@override
Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
connectVolumeStream({
connectSampleStream({
int? backfillMinutes,
List<TweetExpansion>? expansions,
List<TweetField>? tweetFields,
Expand Down Expand Up @@ -3603,27 +3488,6 @@ class _TweetsService extends BaseService implements TweetsService {
);
}

@override
Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
connectSampleStream({
int? backfillMinutes,
List<TweetExpansion>? expansions,
List<TweetField>? tweetFields,
List<UserField>? userFields,
List<PlaceField>? placeFields,
List<PollField>? pollFields,
List<MediaField>? mediaFields,
}) async =>
await connectVolumeStream(
backfillMinutes: backfillMinutes,
expansions: expansions,
tweetFields: tweetFields,
userFields: userFields,
placeFields: placeFields,
pollFields: pollFields,
mediaFields: mediaFields,
);

@override
Future<TwitterStreamResponse<TwitterResponse<TweetData, void>>>
connectSample10Stream({
Expand Down
6 changes: 0 additions & 6 deletions lib/src/service/tweets/tweets_service_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ import 'tweet_reply_param.dart';
import 'tweets_service.dart';

extension TweetServiceExtension on TweetsService {
@Deprecated('Use ".createThreads" instead. Will be removed in v4.3.0')
Future<List<TwitterResponse<TweetData, void>>> createThreadTweets({
required List<TweetParam> tweets,
}) async =>
await createThreads(tweets: tweets);

/// This is a convenience method for creating a reply.
///
/// [tweetId] should be the ID of the tweet for which you want to
Expand Down

0 comments on commit 06e9aa1

Please sign in to comment.