Skip to content

Commit bd569c4

Browse files
authored
Merge pull request #296 from cryptodeal/matching_rules_stream
add `MatchingRules` to `SearchStreamOutput` & `EditHistoryTweet_IDs` to `Tweet`
2 parents 2bcc996 + 6045228 commit bd569c4

2 files changed

Lines changed: 28 additions & 21 deletions

File tree

resources/tweet.go

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ package resources
33
import "time"
44

55
type Tweet struct {
6-
ID *string `json:"id"`
7-
Text *string `json:"text"`
8-
Attachments *TweetAttachments `json:"attachments,omitempty"`
9-
AuthorID *string `json:"author_id,omitempty"`
10-
ContextAnnotations []ContextAnnotation `json:"context_annotations,omitempty"`
11-
ConversationId *string `json:"conversation_id,omitempty"`
12-
CreatedAt *time.Time `json:"created_at,omitempty"`
13-
Entities *TweetEntities `json:"entities,omitempty"`
14-
Geo *Geo `json:"geo,omitempty"`
15-
InReplyToUserID *string `json:"in_reply_to_user_id,omitempty"`
16-
Lang *string `json:"lang,omitempty"`
17-
NonPublicMetrics *NonPublicMetrics `json:"non_public_metrics,omitempty"`
18-
OrganicMetrics *OrganicMetrics `json:"organic_metrics,omitempty"`
19-
PossiblySensitive *bool `json:"possibly_sensitive,omitempty"`
20-
PromotedMetrics *PromotedMetrics `json:"promoted_metrics,omitempty"`
21-
PublicMetrics *TweetPublicMetrics `json:"public_metrics,omitempty"`
22-
ReferencedTweets []ReferencedTweet `json:"referenced_tweets,omitempty"`
23-
ReplySettings *string `json:"reply_settings,omitempty"`
24-
Source *string `json:"source,omitempty"`
25-
Withheld *TweetWithheld `json:"withheld,omitempty"`
6+
ID *string `json:"id"`
7+
Text *string `json:"text"`
8+
EditHistoryTweetIDs []*string `json:"edit_history_tweet_ids"`
9+
Attachments *TweetAttachments `json:"attachments,omitempty"`
10+
AuthorID *string `json:"author_id,omitempty"`
11+
ContextAnnotations []ContextAnnotation `json:"context_annotations,omitempty"`
12+
ConversationId *string `json:"conversation_id,omitempty"`
13+
CreatedAt *time.Time `json:"created_at,omitempty"`
14+
Entities *TweetEntities `json:"entities,omitempty"`
15+
Geo *Geo `json:"geo,omitempty"`
16+
InReplyToUserID *string `json:"in_reply_to_user_id,omitempty"`
17+
Lang *string `json:"lang,omitempty"`
18+
NonPublicMetrics *NonPublicMetrics `json:"non_public_metrics,omitempty"`
19+
OrganicMetrics *OrganicMetrics `json:"organic_metrics,omitempty"`
20+
PossiblySensitive *bool `json:"possibly_sensitive,omitempty"`
21+
PromotedMetrics *PromotedMetrics `json:"promoted_metrics,omitempty"`
22+
PublicMetrics *TweetPublicMetrics `json:"public_metrics,omitempty"`
23+
ReferencedTweets []ReferencedTweet `json:"referenced_tweets,omitempty"`
24+
ReplySettings *string `json:"reply_settings,omitempty"`
25+
Source *string `json:"source,omitempty"`
26+
Withheld *TweetWithheld `json:"withheld,omitempty"`
2627
}
2728

2829
type TweetAttachments struct {

tweet/filteredstream/types/response.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ func (r *DeleteRulesOutput) HasPartialError() bool {
3232
return !(r.Errors == nil || len(r.Errors) == 0)
3333
}
3434

35+
type SearchStreamMatchedRule struct {
36+
Tag *string `json:"tag"`
37+
ID *string `json:"id"`
38+
}
39+
3540
type SearchStreamOutput struct {
3641
Data resources.Tweet `json:"data"`
3742
Includes struct {
@@ -41,7 +46,8 @@ type SearchStreamOutput struct {
4146
Media []resources.Media `json:"media,omitempty"`
4247
Polls []resources.Poll `json:"polls,omitempty"`
4348
} `json:"includes,omitempty"`
44-
Errors []resources.PartialError `json:"errors,omitempty"`
49+
MatchingRules []SearchStreamMatchedRule `json:"matching_rules,omitempty"`
50+
Errors []resources.PartialError `json:"errors,omitempty"`
4551
}
4652

4753
func (r *SearchStreamOutput) HasPartialError() bool {

0 commit comments

Comments
 (0)