x-twitter-scraper 0.5.5 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/x_twitter_scraper/internal/type/union.rb +25 -9
  5. data/lib/x_twitter_scraper/models/compose_create_response.rb +62 -1
  6. data/lib/x_twitter_scraper/models/content_disclosure.rb +1 -9
  7. data/lib/x_twitter_scraper/models/embedded_tweet.rb +389 -1
  8. data/lib/x_twitter_scraper/models/paginated_tweets.rb +4 -5
  9. data/lib/x_twitter_scraper/models/radar_item.rb +144 -7
  10. data/lib/x_twitter_scraper/models/search_tweet.rb +371 -1
  11. data/lib/x_twitter_scraper/models/support/ticket_list_response.rb +30 -17
  12. data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +49 -24
  13. data/lib/x_twitter_scraper/models/support/ticket_update_response.rb +18 -6
  14. data/lib/x_twitter_scraper/models/trend_list_response.rb +28 -1
  15. data/lib/x_twitter_scraper/models/tweet_media.rb +213 -1
  16. data/lib/x_twitter_scraper/models/user_profile.rb +211 -21
  17. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rb +22 -0
  18. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +224 -0
  19. data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
  20. data/lib/x_twitter_scraper/models/x/account_create_params.rb +9 -9
  21. data/lib/x_twitter_scraper/models/x/account_create_response.rb +146 -54
  22. data/lib/x_twitter_scraper/models/x/account_reauth_params.rb +2 -2
  23. data/lib/x_twitter_scraper/models/x/account_reauth_response.rb +4 -4
  24. data/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +3 -5
  25. data/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +3 -5
  26. data/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +1 -17
  27. data/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +3 -5
  28. data/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +3 -5
  29. data/lib/x_twitter_scraper/models/x/tweet_author.rb +14 -1
  30. data/lib/x_twitter_scraper/models/x/tweet_detail.rb +373 -1
  31. data/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +3 -5
  32. data/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +34 -6
  33. data/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +345 -0
  34. data/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +3 -5
  35. data/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +3 -5
  36. data/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +3 -5
  37. data/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +3 -5
  38. data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +3 -5
  39. data/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +3 -5
  40. data/lib/x_twitter_scraper/models/x/x_account.rb +9 -9
  41. data/lib/x_twitter_scraper/models/x_get_article_response.rb +1 -7
  42. data/lib/x_twitter_scraper/models/x_get_trends_response.rb +28 -1
  43. data/lib/x_twitter_scraper/resources/compose.rb +4 -4
  44. data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +37 -0
  45. data/lib/x_twitter_scraper/resources/x/accounts.rb +5 -5
  46. data/lib/x_twitter_scraper/resources/x/communities/tweets.rb +2 -2
  47. data/lib/x_twitter_scraper/resources/x/communities.rb +1 -1
  48. data/lib/x_twitter_scraper/resources/x/lists.rb +1 -1
  49. data/lib/x_twitter_scraper/resources/x/tweets.rb +14 -11
  50. data/lib/x_twitter_scraper/resources/x/users.rb +5 -5
  51. data/lib/x_twitter_scraper/resources/x.rb +6 -0
  52. data/lib/x_twitter_scraper/version.rb +1 -1
  53. data/lib/x_twitter_scraper.rb +5 -1
  54. data/rbi/x_twitter_scraper/models/compose_create_response.rbi +142 -0
  55. data/rbi/x_twitter_scraper/models/content_disclosure.rbi +1 -15
  56. data/rbi/x_twitter_scraper/models/embedded_tweet.rbi +708 -3
  57. data/rbi/x_twitter_scraper/models/paginated_tweets.rbi +4 -5
  58. data/rbi/x_twitter_scraper/models/radar_item.rbi +245 -8
  59. data/rbi/x_twitter_scraper/models/search_tweet.rbi +674 -3
  60. data/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +75 -55
  61. data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +129 -87
  62. data/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +62 -13
  63. data/rbi/x_twitter_scraper/models/trend_list_response.rbi +40 -3
  64. data/rbi/x_twitter_scraper/models/tweet_media.rbi +313 -3
  65. data/rbi/x_twitter_scraper/models/user_profile.rbi +340 -29
  66. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbi +40 -0
  67. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +295 -0
  68. data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
  69. data/rbi/x_twitter_scraper/models/x/account_create_params.rbi +8 -11
  70. data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +232 -91
  71. data/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +2 -2
  72. data/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +6 -6
  73. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +4 -8
  74. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +4 -8
  75. data/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +0 -22
  76. data/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +4 -8
  77. data/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +4 -8
  78. data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +13 -3
  79. data/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +690 -3
  80. data/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +4 -8
  81. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +68 -8
  82. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +527 -0
  83. data/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +4 -8
  84. data/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +4 -8
  85. data/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +4 -8
  86. data/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +4 -8
  87. data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +4 -8
  88. data/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +4 -8
  89. data/rbi/x_twitter_scraper/models/x/x_account.rbi +12 -12
  90. data/rbi/x_twitter_scraper/models/x_get_article_response.rbi +0 -9
  91. data/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +40 -3
  92. data/rbi/x_twitter_scraper/resources/compose.rbi +4 -4
  93. data/rbi/x_twitter_scraper/resources/x/account_connection_attempts.rbi +33 -0
  94. data/rbi/x_twitter_scraper/resources/x/accounts.rbi +5 -5
  95. data/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +4 -8
  96. data/rbi/x_twitter_scraper/resources/x/communities.rbi +2 -4
  97. data/rbi/x_twitter_scraper/resources/x/lists.rbi +2 -4
  98. data/rbi/x_twitter_scraper/resources/x/tweets.rbi +20 -18
  99. data/rbi/x_twitter_scraper/resources/x/users.rbi +10 -20
  100. data/rbi/x_twitter_scraper/resources/x.rbi +4 -0
  101. data/sig/x_twitter_scraper/models/compose_create_response.rbs +60 -0
  102. data/sig/x_twitter_scraper/models/content_disclosure.rbs +1 -11
  103. data/sig/x_twitter_scraper/models/embedded_tweet.rbs +343 -62
  104. data/sig/x_twitter_scraper/models/radar_item.rbs +100 -4
  105. data/sig/x_twitter_scraper/models/search_tweet.rbs +333 -70
  106. data/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +29 -32
  107. data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +49 -48
  108. data/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +25 -7
  109. data/sig/x_twitter_scraper/models/trend_list_response.rbs +16 -20
  110. data/sig/x_twitter_scraper/models/tweet_media.rbs +146 -15
  111. data/sig/x_twitter_scraper/models/user_profile.rbs +164 -86
  112. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbs +25 -0
  113. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +199 -0
  114. data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
  115. data/sig/x_twitter_scraper/models/x/account_create_params.rbs +6 -8
  116. data/sig/x_twitter_scraper/models/x/account_create_response.rbs +144 -59
  117. data/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +5 -5
  118. data/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +0 -14
  119. data/sig/x_twitter_scraper/models/x/tweet_author.rbs +11 -3
  120. data/sig/x_twitter_scraper/models/x/tweet_detail.rbs +333 -70
  121. data/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +26 -0
  122. data/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +274 -0
  123. data/sig/x_twitter_scraper/models/x_get_article_response.rbs +0 -7
  124. data/sig/x_twitter_scraper/models/x_get_trends_response.rbs +25 -3
  125. data/sig/x_twitter_scraper/resources/x/account_connection_attempts.rbs +14 -0
  126. data/sig/x_twitter_scraper/resources/x/accounts.rbs +2 -2
  127. data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
  128. data/sig/x_twitter_scraper/resources/x.rbs +2 -0
  129. metadata +14 -2
@@ -22,15 +22,23 @@ module XTwitterScraper
22
22
  # @return [String]
23
23
  required :username, String
24
24
 
25
+ # @!attribute affiliates_highlighted_label
26
+ # Organization affiliation label shown on an X profile.
27
+ #
28
+ # @return [XTwitterScraper::Models::UserProfile::AffiliatesHighlightedLabel, nil]
29
+ optional :affiliates_highlighted_label,
30
+ -> { XTwitterScraper::UserProfile::AffiliatesHighlightedLabel },
31
+ api_name: :affiliatesHighlightedLabel
32
+
25
33
  # @!attribute automated_by
26
34
  #
27
35
  # @return [String, nil]
28
36
  optional :automated_by, String, api_name: :automatedBy
29
37
 
30
- # @!attribute can_dm
38
+ # @!attribute business_account_affiliates_count
31
39
  #
32
- # @return [Boolean, nil]
33
- optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm
40
+ # @return [Integer, nil]
41
+ optional :business_account_affiliates_count, Integer, api_name: :businessAccountAffiliatesCount
34
42
 
35
43
  # @!attribute community_role
36
44
  # Community role when returned by community member reads
@@ -48,6 +56,11 @@ module XTwitterScraper
48
56
  # @return [String, nil]
49
57
  optional :created_at, String, api_name: :createdAt
50
58
 
59
+ # @!attribute creator_subscriptions_count
60
+ #
61
+ # @return [Integer, nil]
62
+ optional :creator_subscriptions_count, Integer, api_name: :creatorSubscriptionsCount
63
+
51
64
  # @!attribute description
52
65
  #
53
66
  # @return [String, nil]
@@ -73,6 +86,36 @@ module XTwitterScraper
73
86
  # @return [Boolean, nil]
74
87
  optional :has_custom_timelines, XTwitterScraper::Internal::Type::Boolean, api_name: :hasCustomTimelines
75
88
 
89
+ # @!attribute has_graduated_access
90
+ #
91
+ # @return [Boolean, nil]
92
+ optional :has_graduated_access, XTwitterScraper::Internal::Type::Boolean, api_name: :hasGraduatedAccess
93
+
94
+ # @!attribute has_hidden_subscriptions_on_profile
95
+ #
96
+ # @return [Boolean, nil]
97
+ optional :has_hidden_subscriptions_on_profile,
98
+ XTwitterScraper::Internal::Type::Boolean,
99
+ api_name: :hasHiddenSubscriptionsOnProfile
100
+
101
+ # @!attribute highlights_info
102
+ # Profile highlight availability and count metadata.
103
+ #
104
+ # @return [XTwitterScraper::Models::UserProfile::HighlightsInfo, nil]
105
+ optional :highlights_info,
106
+ -> {
107
+ XTwitterScraper::UserProfile::HighlightsInfo
108
+ },
109
+ api_name: :highlightsInfo
110
+
111
+ # @!attribute identity_verification
112
+ # Identity verification metadata displayed by X.
113
+ #
114
+ # @return [XTwitterScraper::Models::UserProfile::IdentityVerification, nil]
115
+ optional :identity_verification,
116
+ -> { XTwitterScraper::UserProfile::IdentityVerification },
117
+ api_name: :identityVerification
118
+
76
119
  # @!attribute is_automated
77
120
  #
78
121
  # @return [Boolean, nil]
@@ -84,6 +127,13 @@ module XTwitterScraper
84
127
  # @return [Boolean, nil]
85
128
  optional :is_blue_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isBlueVerified
86
129
 
130
+ # @!attribute is_profile_translatable
131
+ #
132
+ # @return [Boolean, nil]
133
+ optional :is_profile_translatable,
134
+ XTwitterScraper::Internal::Type::Boolean,
135
+ api_name: :isProfileTranslatable
136
+
87
137
  # @!attribute is_translator
88
138
  #
89
139
  # @return [Boolean, nil]
@@ -105,6 +155,11 @@ module XTwitterScraper
105
155
  # @return [Integer, nil]
106
156
  optional :media_count, Integer, api_name: :mediaCount
107
157
 
158
+ # @!attribute parody_commentary_fan_label
159
+ #
160
+ # @return [String, nil]
161
+ optional :parody_commentary_fan_label, String, api_name: :parodyCommentaryFanLabel
162
+
108
163
  # @!attribute pinned_tweet_ids
109
164
  #
110
165
  # @return [Array<String>, nil]
@@ -127,11 +182,36 @@ module XTwitterScraper
127
182
  # @return [String, nil]
128
183
  optional :profile_banner_url, String, api_name: :profileBannerUrl
129
184
 
185
+ # @!attribute profile_description_language
186
+ #
187
+ # @return [String, nil]
188
+ optional :profile_description_language, String, api_name: :profileDescriptionLanguage
189
+
190
+ # @!attribute profile_image_shape
191
+ #
192
+ # @return [String, nil]
193
+ optional :profile_image_shape, String, api_name: :profileImageShape
194
+
195
+ # @!attribute profile_interstitial_type
196
+ #
197
+ # @return [String, nil]
198
+ optional :profile_interstitial_type, String, api_name: :profileInterstitialType
199
+
130
200
  # @!attribute profile_picture
131
201
  #
132
202
  # @return [String, nil]
133
203
  optional :profile_picture, String, api_name: :profilePicture
134
204
 
205
+ # @!attribute profile_sort_enabled
206
+ #
207
+ # @return [Boolean, nil]
208
+ optional :profile_sort_enabled, XTwitterScraper::Internal::Type::Boolean, api_name: :profileSortEnabled
209
+
210
+ # @!attribute profile_translator_type
211
+ #
212
+ # @return [String, nil]
213
+ optional :profile_translator_type, String, api_name: :profileTranslatorType
214
+
135
215
  # @!attribute protected
136
216
  # Whether the profile protects its posts
137
217
  #
@@ -143,6 +223,13 @@ module XTwitterScraper
143
223
  # @return [Integer, nil]
144
224
  optional :statuses_count, Integer, api_name: :statusesCount
145
225
 
226
+ # @!attribute super_follow_eligible
227
+ #
228
+ # @return [Boolean, nil]
229
+ optional :super_follow_eligible,
230
+ XTwitterScraper::Internal::Type::Boolean,
231
+ api_name: :superFollowEligible
232
+
146
233
  # @!attribute unavailable
147
234
  #
148
235
  # @return [Boolean, nil]
@@ -168,18 +255,6 @@ module XTwitterScraper
168
255
  # @return [String, nil]
169
256
  optional :verified_type, String, api_name: :verifiedType
170
257
 
171
- # @!attribute viewer_followed_by
172
- # Whether this profile follows the authenticated viewer
173
- #
174
- # @return [Boolean, nil]
175
- optional :viewer_followed_by, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowedBy
176
-
177
- # @!attribute viewer_following
178
- # Whether the authenticated viewer follows this profile
179
- #
180
- # @return [Boolean, nil]
181
- optional :viewer_following, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowing
182
-
183
258
  # @!attribute withheld_in_countries
184
259
  #
185
260
  # @return [Array<String>, nil]
@@ -187,7 +262,7 @@ module XTwitterScraper
187
262
  XTwitterScraper::Internal::Type::ArrayOf[String],
188
263
  api_name: :withheldInCountries
189
264
 
190
- # @!method initialize(id:, name:, username:, automated_by: nil, can_dm: nil, community_role: nil, cover_picture: nil, created_at: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, is_automated: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, viewer_followed_by: nil, viewer_following: nil, withheld_in_countries: nil)
265
+ # @!method initialize(id:, name:, username:, affiliates_highlighted_label: nil, automated_by: nil, business_account_affiliates_count: nil, community_role: nil, cover_picture: nil, created_at: nil, creator_subscriptions_count: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, has_graduated_access: nil, has_hidden_subscriptions_on_profile: nil, highlights_info: nil, identity_verification: nil, is_automated: nil, is_blue_verified: nil, is_profile_translatable: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, parody_commentary_fan_label: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_description_language: nil, profile_image_shape: nil, profile_interstitial_type: nil, profile_picture: nil, profile_sort_enabled: nil, profile_translator_type: nil, protected: nil, statuses_count: nil, super_follow_eligible: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, withheld_in_countries: nil)
191
266
  # X user profile with bio, follower counts, and verification status.
192
267
  #
193
268
  # @param id [String]
@@ -196,9 +271,11 @@ module XTwitterScraper
196
271
  #
197
272
  # @param username [String]
198
273
  #
274
+ # @param affiliates_highlighted_label [XTwitterScraper::Models::UserProfile::AffiliatesHighlightedLabel] Organization affiliation label shown on an X profile.
275
+ #
199
276
  # @param automated_by [String]
200
277
  #
201
- # @param can_dm [Boolean]
278
+ # @param business_account_affiliates_count [Integer]
202
279
  #
203
280
  # @param community_role [String] Community role when returned by community member reads
204
281
  #
@@ -206,6 +283,8 @@ module XTwitterScraper
206
283
  #
207
284
  # @param created_at [String]
208
285
  #
286
+ # @param creator_subscriptions_count [Integer]
287
+ #
209
288
  # @param description [String]
210
289
  #
211
290
  # @param favourites_count [Integer]
@@ -216,10 +295,20 @@ module XTwitterScraper
216
295
  #
217
296
  # @param has_custom_timelines [Boolean]
218
297
  #
298
+ # @param has_graduated_access [Boolean]
299
+ #
300
+ # @param has_hidden_subscriptions_on_profile [Boolean]
301
+ #
302
+ # @param highlights_info [XTwitterScraper::Models::UserProfile::HighlightsInfo] Profile highlight availability and count metadata.
303
+ #
304
+ # @param identity_verification [XTwitterScraper::Models::UserProfile::IdentityVerification] Identity verification metadata displayed by X.
305
+ #
219
306
  # @param is_automated [Boolean]
220
307
  #
221
308
  # @param is_blue_verified [Boolean] Whether X shows a blue verification badge
222
309
  #
310
+ # @param is_profile_translatable [Boolean]
311
+ #
223
312
  # @param is_translator [Boolean]
224
313
  #
225
314
  # @param is_verified [Boolean] Whether X marks the profile as verified
@@ -228,6 +317,8 @@ module XTwitterScraper
228
317
  #
229
318
  # @param media_count [Integer]
230
319
  #
320
+ # @param parody_commentary_fan_label [String]
321
+ #
231
322
  # @param pinned_tweet_ids [Array<String>]
232
323
  #
233
324
  # @param possibly_sensitive [Boolean]
@@ -236,12 +327,24 @@ module XTwitterScraper
236
327
  #
237
328
  # @param profile_banner_url [String] Original X profile banner field when available
238
329
  #
330
+ # @param profile_description_language [String]
331
+ #
332
+ # @param profile_image_shape [String]
333
+ #
334
+ # @param profile_interstitial_type [String]
335
+ #
239
336
  # @param profile_picture [String]
240
337
  #
338
+ # @param profile_sort_enabled [Boolean]
339
+ #
340
+ # @param profile_translator_type [String]
341
+ #
241
342
  # @param protected [Boolean] Whether the profile protects its posts
242
343
  #
243
344
  # @param statuses_count [Integer]
244
345
  #
346
+ # @param super_follow_eligible [Boolean]
347
+ #
245
348
  # @param unavailable [Boolean]
246
349
  #
247
350
  # @param unavailable_reason [String]
@@ -252,11 +355,98 @@ module XTwitterScraper
252
355
  #
253
356
  # @param verified_type [String]
254
357
  #
255
- # @param viewer_followed_by [Boolean] Whether this profile follows the authenticated viewer
256
- #
257
- # @param viewer_following [Boolean] Whether the authenticated viewer follows this profile
258
- #
259
358
  # @param withheld_in_countries [Array<String>]
359
+
360
+ # @see XTwitterScraper::Models::UserProfile#affiliates_highlighted_label
361
+ class AffiliatesHighlightedLabel < XTwitterScraper::Internal::Type::BaseModel
362
+ # @!attribute badge_url
363
+ #
364
+ # @return [String, nil]
365
+ optional :badge_url, String, api_name: :badgeUrl
366
+
367
+ # @!attribute description
368
+ #
369
+ # @return [String, nil]
370
+ optional :description, String
371
+
372
+ # @!attribute url
373
+ #
374
+ # @return [String, nil]
375
+ optional :url, String
376
+
377
+ # @!attribute url_type
378
+ #
379
+ # @return [String, nil]
380
+ optional :url_type, String, api_name: :urlType
381
+
382
+ # @!attribute user_label_display_type
383
+ #
384
+ # @return [String, nil]
385
+ optional :user_label_display_type, String, api_name: :userLabelDisplayType
386
+
387
+ # @!attribute user_label_type
388
+ #
389
+ # @return [String, nil]
390
+ optional :user_label_type, String, api_name: :userLabelType
391
+
392
+ # @!method initialize(badge_url: nil, description: nil, url: nil, url_type: nil, user_label_display_type: nil, user_label_type: nil)
393
+ # Organization affiliation label shown on an X profile.
394
+ #
395
+ # @param badge_url [String]
396
+ # @param description [String]
397
+ # @param url [String]
398
+ # @param url_type [String]
399
+ # @param user_label_display_type [String]
400
+ # @param user_label_type [String]
401
+ end
402
+
403
+ # @see XTwitterScraper::Models::UserProfile#highlights_info
404
+ class HighlightsInfo < XTwitterScraper::Internal::Type::BaseModel
405
+ # @!attribute can_highlight_tweets
406
+ #
407
+ # @return [Boolean, nil]
408
+ optional :can_highlight_tweets,
409
+ XTwitterScraper::Internal::Type::Boolean,
410
+ api_name: :canHighlightTweets
411
+
412
+ # @!attribute highlighted_tweets
413
+ #
414
+ # @return [String, nil]
415
+ optional :highlighted_tweets, String, api_name: :highlightedTweets
416
+
417
+ # @!method initialize(can_highlight_tweets: nil, highlighted_tweets: nil)
418
+ # Profile highlight availability and count metadata.
419
+ #
420
+ # @param can_highlight_tweets [Boolean]
421
+ # @param highlighted_tweets [String]
422
+ end
423
+
424
+ # @see XTwitterScraper::Models::UserProfile#identity_verification
425
+ class IdentityVerification < XTwitterScraper::Internal::Type::BaseModel
426
+ # @!attribute description
427
+ #
428
+ # @return [String, nil]
429
+ optional :description, String
430
+
431
+ # @!attribute is_identity_verified
432
+ #
433
+ # @return [Boolean, nil]
434
+ optional :is_identity_verified,
435
+ XTwitterScraper::Internal::Type::Boolean,
436
+ api_name: :isIdentityVerified
437
+
438
+ # @!attribute verified_since_msec
439
+ #
440
+ # @return [String, nil]
441
+ optional :verified_since_msec, String, api_name: :verifiedSinceMsec
442
+
443
+ # @!method initialize(description: nil, is_identity_verified: nil, verified_since_msec: nil)
444
+ # Identity verification metadata displayed by X.
445
+ #
446
+ # @param description [String]
447
+ # @param is_identity_verified [Boolean]
448
+ # @param verified_since_msec [String]
449
+ end
260
450
  end
261
451
  end
262
452
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ # @see XTwitterScraper::Resources::X::AccountConnectionAttempts#retrieve
7
+ class AccountConnectionAttemptRetrieveParams < XTwitterScraper::Internal::Type::BaseModel
8
+ extend XTwitterScraper::Internal::Type::RequestParameters::Converter
9
+ include XTwitterScraper::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String]
18
+ # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: true
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ # The connection is still in progress.
7
+ #
8
+ # @see XTwitterScraper::Resources::X::AccountConnectionAttempts#retrieve
9
+ module AccountConnectionAttemptRetrieveResponse
10
+ extend XTwitterScraper::Internal::Type::Union
11
+
12
+ discriminator :status
13
+
14
+ # The connection is still in progress.
15
+ variant :pending, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending }
16
+
17
+ # The account connected successfully.
18
+ variant :success, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success }
19
+
20
+ # The connection reached a final failure.
21
+ variant :failed, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed }
22
+
23
+ # Resumable account connection challenge. Submit the email code to finish the same connection attempt.
24
+ variant :requires_email_code,
25
+ -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode }
26
+
27
+ class Pending < XTwitterScraper::Internal::Type::BaseModel
28
+ # @!attribute id
29
+ #
30
+ # @return [String]
31
+ required :id, String
32
+
33
+ # @!attribute object
34
+ #
35
+ # @return [Symbol, :x_account_connection_attempt]
36
+ required :object, const: :x_account_connection_attempt
37
+
38
+ # @!attribute poll_after_ms
39
+ #
40
+ # @return [Integer]
41
+ required :poll_after_ms, Integer, api_name: :pollAfterMs
42
+
43
+ # @!attribute status
44
+ #
45
+ # @return [Symbol, :pending]
46
+ required :status, const: :pending
47
+
48
+ # @!method initialize(id:, poll_after_ms:, object: :x_account_connection_attempt, status: :pending)
49
+ # The connection is still in progress.
50
+ #
51
+ # @param id [String]
52
+ # @param poll_after_ms [Integer]
53
+ # @param object [Symbol, :x_account_connection_attempt]
54
+ # @param status [Symbol, :pending]
55
+
56
+ module Object
57
+ extend XTwitterScraper::Internal::Type::Enum
58
+
59
+ X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt
60
+ end
61
+
62
+ module Status
63
+ extend XTwitterScraper::Internal::Type::Enum
64
+
65
+ PENDING = :pending
66
+ end
67
+ end
68
+
69
+ class Success < XTwitterScraper::Internal::Type::BaseModel
70
+ # @!attribute id
71
+ #
72
+ # @return [String]
73
+ required :id, String
74
+
75
+ # @!attribute object
76
+ #
77
+ # @return [Symbol, :x_account_connection_attempt]
78
+ required :object, const: :x_account_connection_attempt
79
+
80
+ # @!attribute status
81
+ #
82
+ # @return [Symbol, :success]
83
+ required :status, const: :success
84
+
85
+ # @!method initialize(id:, object: :x_account_connection_attempt, status: :success)
86
+ # The account connected successfully.
87
+ #
88
+ # @param id [String]
89
+ # @param object [Symbol, :x_account_connection_attempt]
90
+ # @param status [Symbol, :success]
91
+
92
+ module Object
93
+ extend XTwitterScraper::Internal::Type::Enum
94
+
95
+ X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt
96
+ end
97
+
98
+ module Status
99
+ extend XTwitterScraper::Internal::Type::Enum
100
+
101
+ SUCCESS = :success
102
+ end
103
+ end
104
+
105
+ class Failed < XTwitterScraper::Internal::Type::BaseModel
106
+ # @!attribute id
107
+ #
108
+ # @return [String]
109
+ required :id, String
110
+
111
+ # @!attribute error
112
+ #
113
+ # @return [String]
114
+ required :error, String
115
+
116
+ # @!attribute object
117
+ #
118
+ # @return [Symbol, :x_account_connection_attempt]
119
+ required :object, const: :x_account_connection_attempt
120
+
121
+ # @!attribute retryable
122
+ #
123
+ # @return [Boolean]
124
+ required :retryable, XTwitterScraper::Internal::Type::Boolean
125
+
126
+ # @!attribute status
127
+ #
128
+ # @return [Symbol, :failed]
129
+ required :status, const: :failed
130
+
131
+ # @!attribute reason
132
+ #
133
+ # @return [String, nil]
134
+ optional :reason, String
135
+
136
+ # @!method initialize(id:, error:, retryable:, reason: nil, object: :x_account_connection_attempt, status: :failed)
137
+ # The connection reached a final failure.
138
+ #
139
+ # @param id [String]
140
+ # @param error [String]
141
+ # @param retryable [Boolean]
142
+ # @param reason [String]
143
+ # @param object [Symbol, :x_account_connection_attempt]
144
+ # @param status [Symbol, :failed]
145
+
146
+ module Object
147
+ extend XTwitterScraper::Internal::Type::Enum
148
+
149
+ X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt
150
+ end
151
+
152
+ module Status
153
+ extend XTwitterScraper::Internal::Type::Enum
154
+
155
+ FAILED = :failed
156
+ end
157
+ end
158
+
159
+ class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel
160
+ # @!attribute id
161
+ #
162
+ # @return [String]
163
+ required :id, String
164
+
165
+ # @!attribute expires_at
166
+ #
167
+ # @return [Time]
168
+ required :expires_at, Time, api_name: :expiresAt
169
+
170
+ # @!attribute message
171
+ #
172
+ # @return [String]
173
+ required :message, String
174
+
175
+ # @!attribute object
176
+ #
177
+ # @return [Symbol, :x_account_connection_challenge]
178
+ required :object, const: :x_account_connection_challenge
179
+
180
+ # @!attribute status
181
+ #
182
+ # @return [Symbol, :requires_email_code]
183
+ required :status, const: :requires_email_code
184
+
185
+ # @!attribute username
186
+ #
187
+ # @return [String]
188
+ required :username, String
189
+
190
+ # @!method initialize(id:, expires_at:, message:, username:, object: :x_account_connection_challenge, status: :requires_email_code)
191
+ # Resumable account connection challenge. Submit the email code to finish the same
192
+ # connection attempt.
193
+ #
194
+ # @param id [String]
195
+ # @param expires_at [Time]
196
+ # @param message [String]
197
+ # @param username [String]
198
+ # @param object [Symbol, :x_account_connection_challenge]
199
+ # @param status [Symbol, :requires_email_code]
200
+
201
+ module Object
202
+ extend XTwitterScraper::Internal::Type::Enum
203
+
204
+ X_ACCOUNT_CONNECTION_CHALLENGE = :x_account_connection_challenge
205
+ end
206
+
207
+ module Status
208
+ extend XTwitterScraper::Internal::Type::Enum
209
+
210
+ REQUIRES_EMAIL_CODE = :requires_email_code
211
+ end
212
+ end
213
+
214
+ XAccountConnectionAttemptPending = Pending
215
+ XAccountConnectionAttemptSuccess = Success
216
+ XAccountConnectionAttemptFailed = Failed
217
+ XAccountConnectionChallenge = RequiresEmailCode
218
+
219
+ # @!method self.variants
220
+ # @return [Array(XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode)]
221
+ end
222
+ end
223
+ end
224
+ end
@@ -27,8 +27,8 @@ module XTwitterScraper
27
27
 
28
28
  # @!attribute status
29
29
  #
30
- # @return [String]
31
- required :status, String
30
+ # @return [Symbol, :active]
31
+ required :status, const: :active
32
32
 
33
33
  # @!attribute x_user_id
34
34
  #
@@ -40,15 +40,15 @@ module XTwitterScraper
40
40
  # @return [String]
41
41
  required :x_username, String, api_name: :xUsername
42
42
 
43
- # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:)
43
+ # @!method initialize(id:, created_at:, health:, x_user_id:, x_username:, status: :active)
44
44
  # Sanitized X account summary returned by connect and reauth.
45
45
  #
46
46
  # @param id [String]
47
47
  # @param created_at [Time]
48
48
  # @param health [Symbol, XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health]
49
- # @param status [String]
50
49
  # @param x_user_id [String]
51
50
  # @param x_username [String]
51
+ # @param status [Symbol, :active]
52
52
 
53
53
  # @see XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse#health
54
54
  module Health
@@ -24,26 +24,26 @@ module XTwitterScraper
24
24
  # @return [String]
25
25
  required :password, String
26
26
 
27
+ # @!attribute totp_secret
28
+ # Authenticator App TOTP secret required for durable login
29
+ #
30
+ # @return [String]
31
+ required :totp_secret, String
32
+
27
33
  # @!attribute username
28
34
  # X username
29
35
  #
30
36
  # @return [String]
31
37
  required :username, String
32
38
 
33
- # @!attribute totp_secret
34
- # TOTP secret for 2FA
35
- #
36
- # @return [String, nil]
37
- optional :totp_secret, String
38
-
39
- # @!method initialize(email:, password:, username:, totp_secret: nil, request_options: {})
39
+ # @!method initialize(email:, password:, totp_secret:, username:, request_options: {})
40
40
  # @param email [String] Account email
41
41
  #
42
42
  # @param password [String] Account password
43
43
  #
44
- # @param username [String] X username
44
+ # @param totp_secret [String] Authenticator App TOTP secret required for durable login
45
45
  #
46
- # @param totp_secret [String] TOTP secret for 2FA
46
+ # @param username [String] X username
47
47
  #
48
48
  # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}]
49
49
  end