x-twitter-scraper 0.6.0 → 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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -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/content_disclosure.rb +1 -9
  6. data/lib/x_twitter_scraper/models/embedded_tweet.rb +389 -1
  7. data/lib/x_twitter_scraper/models/paginated_tweets.rb +4 -5
  8. data/lib/x_twitter_scraper/models/search_tweet.rb +371 -1
  9. data/lib/x_twitter_scraper/models/support/ticket_list_response.rb +30 -17
  10. data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +49 -24
  11. data/lib/x_twitter_scraper/models/support/ticket_update_response.rb +18 -6
  12. data/lib/x_twitter_scraper/models/trend_list_response.rb +28 -1
  13. data/lib/x_twitter_scraper/models/tweet_media.rb +213 -1
  14. data/lib/x_twitter_scraper/models/user_profile.rb +211 -21
  15. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +60 -26
  16. data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
  17. data/lib/x_twitter_scraper/models/x/account_create_response.rb +149 -2
  18. data/lib/x_twitter_scraper/models/x/account_reauth_response.rb +4 -4
  19. data/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +3 -5
  20. data/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +3 -5
  21. data/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +1 -17
  22. data/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +3 -5
  23. data/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +3 -5
  24. data/lib/x_twitter_scraper/models/x/tweet_author.rb +14 -1
  25. data/lib/x_twitter_scraper/models/x/tweet_detail.rb +373 -1
  26. data/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +3 -5
  27. data/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +34 -6
  28. data/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +345 -0
  29. data/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +3 -5
  30. data/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +3 -5
  31. data/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +3 -5
  32. data/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +3 -5
  33. data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +3 -5
  34. data/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +3 -5
  35. data/lib/x_twitter_scraper/models/x_get_article_response.rb +1 -7
  36. data/lib/x_twitter_scraper/models/x_get_trends_response.rb +28 -1
  37. data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +1 -1
  38. data/lib/x_twitter_scraper/resources/x/accounts.rb +2 -2
  39. data/lib/x_twitter_scraper/resources/x/communities/tweets.rb +2 -2
  40. data/lib/x_twitter_scraper/resources/x/communities.rb +1 -1
  41. data/lib/x_twitter_scraper/resources/x/lists.rb +1 -1
  42. data/lib/x_twitter_scraper/resources/x/tweets.rb +14 -11
  43. data/lib/x_twitter_scraper/resources/x/users.rb +5 -5
  44. data/lib/x_twitter_scraper/version.rb +1 -1
  45. data/lib/x_twitter_scraper.rb +2 -1
  46. data/rbi/x_twitter_scraper/models/content_disclosure.rbi +1 -15
  47. data/rbi/x_twitter_scraper/models/embedded_tweet.rbi +708 -3
  48. data/rbi/x_twitter_scraper/models/paginated_tweets.rbi +4 -5
  49. data/rbi/x_twitter_scraper/models/search_tweet.rbi +674 -3
  50. data/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +75 -55
  51. data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +129 -87
  52. data/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +62 -13
  53. data/rbi/x_twitter_scraper/models/trend_list_response.rbi +40 -3
  54. data/rbi/x_twitter_scraper/models/tweet_media.rbi +313 -3
  55. data/rbi/x_twitter_scraper/models/user_profile.rbi +340 -29
  56. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +61 -83
  57. data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
  58. data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +264 -2
  59. data/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +6 -6
  60. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +4 -8
  61. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +4 -8
  62. data/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +0 -22
  63. data/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +4 -8
  64. data/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +4 -8
  65. data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +13 -3
  66. data/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +690 -3
  67. data/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +4 -8
  68. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +68 -8
  69. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +527 -0
  70. data/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +4 -8
  71. data/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +4 -8
  72. data/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +4 -8
  73. data/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +4 -8
  74. data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +4 -8
  75. data/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +4 -8
  76. data/rbi/x_twitter_scraper/models/x_get_article_response.rbi +0 -9
  77. data/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +40 -3
  78. data/rbi/x_twitter_scraper/resources/x/accounts.rbi +1 -1
  79. data/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +4 -8
  80. data/rbi/x_twitter_scraper/resources/x/communities.rbi +2 -4
  81. data/rbi/x_twitter_scraper/resources/x/lists.rbi +2 -4
  82. data/rbi/x_twitter_scraper/resources/x/tweets.rbi +20 -18
  83. data/rbi/x_twitter_scraper/resources/x/users.rbi +10 -20
  84. data/sig/x_twitter_scraper/models/content_disclosure.rbs +1 -11
  85. data/sig/x_twitter_scraper/models/embedded_tweet.rbs +343 -62
  86. data/sig/x_twitter_scraper/models/search_tweet.rbs +333 -70
  87. data/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +29 -32
  88. data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +49 -48
  89. data/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +25 -7
  90. data/sig/x_twitter_scraper/models/trend_list_response.rbs +16 -20
  91. data/sig/x_twitter_scraper/models/tweet_media.rbs +146 -15
  92. data/sig/x_twitter_scraper/models/user_profile.rbs +164 -86
  93. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +50 -33
  94. data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
  95. data/sig/x_twitter_scraper/models/x/account_create_response.rbs +147 -1
  96. data/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +5 -5
  97. data/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +0 -14
  98. data/sig/x_twitter_scraper/models/x/tweet_author.rbs +11 -3
  99. data/sig/x_twitter_scraper/models/x/tweet_detail.rbs +333 -70
  100. data/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +26 -0
  101. data/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +274 -0
  102. data/sig/x_twitter_scraper/models/x_get_article_response.rbs +0 -7
  103. data/sig/x_twitter_scraper/models/x_get_trends_response.rbs +25 -3
  104. data/sig/x_twitter_scraper/resources/x/accounts.rbs +1 -1
  105. data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
  106. metadata +4 -1
@@ -10,18 +10,18 @@ module XTwitterScraper
10
10
  Variants =
11
11
  T.type_alias do
12
12
  T.any(
13
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending,
14
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess,
15
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed,
16
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge
13
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending,
14
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success,
15
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed,
16
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode
17
17
  )
18
18
  end
19
19
 
20
- class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel
20
+ class Pending < XTwitterScraper::Internal::Type::BaseModel
21
21
  OrHash =
22
22
  T.type_alias do
23
23
  T.any(
24
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending,
24
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending,
25
25
  XTwitterScraper::Internal::AnyHash
26
26
  )
27
27
  end
@@ -67,13 +67,22 @@ module XTwitterScraper
67
67
  end
68
68
  def to_hash
69
69
  end
70
+
71
+ module Object
72
+ X_ACCOUNT_CONNECTION_ATTEMPT =
73
+ T.let(:x_account_connection_attempt, Symbol)
74
+ end
75
+
76
+ module Status
77
+ PENDING = T.let(:pending, Symbol)
78
+ end
70
79
  end
71
80
 
72
- class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel
81
+ class Success < XTwitterScraper::Internal::Type::BaseModel
73
82
  OrHash =
74
83
  T.type_alias do
75
84
  T.any(
76
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess,
85
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success,
77
86
  XTwitterScraper::Internal::AnyHash
78
87
  )
79
88
  end
@@ -105,13 +114,22 @@ module XTwitterScraper
105
114
  end
106
115
  def to_hash
107
116
  end
117
+
118
+ module Object
119
+ X_ACCOUNT_CONNECTION_ATTEMPT =
120
+ T.let(:x_account_connection_attempt, Symbol)
121
+ end
122
+
123
+ module Status
124
+ SUCCESS = T.let(:success, Symbol)
125
+ end
108
126
  end
109
127
 
110
- class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel
128
+ class Failed < XTwitterScraper::Internal::Type::BaseModel
111
129
  OrHash =
112
130
  T.type_alias do
113
131
  T.any(
114
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed,
132
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed,
115
133
  XTwitterScraper::Internal::AnyHash
116
134
  )
117
135
  end
@@ -172,13 +190,22 @@ module XTwitterScraper
172
190
  end
173
191
  def to_hash
174
192
  end
193
+
194
+ module Object
195
+ X_ACCOUNT_CONNECTION_ATTEMPT =
196
+ T.let(:x_account_connection_attempt, Symbol)
197
+ end
198
+
199
+ module Status
200
+ FAILED = T.let(:failed, Symbol)
201
+ end
175
202
  end
176
203
 
177
- class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel
204
+ class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel
178
205
  OrHash =
179
206
  T.type_alias do
180
207
  T.any(
181
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge,
208
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode,
182
209
  XTwitterScraper::Internal::AnyHash
183
210
  )
184
211
  end
@@ -192,18 +219,10 @@ module XTwitterScraper
192
219
  sig { returns(String) }
193
220
  attr_accessor :message
194
221
 
195
- sig do
196
- returns(
197
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
198
- )
199
- end
222
+ sig { returns(Symbol) }
200
223
  attr_accessor :object
201
224
 
202
- sig do
203
- returns(
204
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
205
- )
206
- end
225
+ sig { returns(Symbol) }
207
226
  attr_accessor :status
208
227
 
209
228
  sig { returns(String) }
@@ -216,14 +235,19 @@ module XTwitterScraper
216
235
  id: String,
217
236
  expires_at: Time,
218
237
  message: String,
219
- object:
220
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::OrSymbol,
221
- status:
222
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::OrSymbol,
223
- username: String
238
+ username: String,
239
+ object: Symbol,
240
+ status: Symbol
224
241
  ).returns(T.attached_class)
225
242
  end
226
- def self.new(id:, expires_at:, message:, object:, status:, username:)
243
+ def self.new(
244
+ id:,
245
+ expires_at:,
246
+ message:,
247
+ username:,
248
+ object: :x_account_connection_challenge,
249
+ status: :requires_email_code
250
+ )
227
251
  end
228
252
 
229
253
  sig do
@@ -232,10 +256,8 @@ module XTwitterScraper
232
256
  id: String,
233
257
  expires_at: Time,
234
258
  message: String,
235
- object:
236
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol,
237
- status:
238
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol,
259
+ object: Symbol,
260
+ status: Symbol,
239
261
  username: String
240
262
  }
241
263
  )
@@ -244,64 +266,20 @@ module XTwitterScraper
244
266
  end
245
267
 
246
268
  module Object
247
- extend XTwitterScraper::Internal::Type::Enum
248
-
249
- TaggedSymbol =
250
- T.type_alias do
251
- T.all(
252
- Symbol,
253
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object
254
- )
255
- end
256
- OrSymbol = T.type_alias { T.any(Symbol, String) }
257
-
258
269
  X_ACCOUNT_CONNECTION_CHALLENGE =
259
- T.let(
260
- :x_account_connection_challenge,
261
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
262
- )
263
-
264
- sig do
265
- override.returns(
266
- T::Array[
267
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
268
- ]
269
- )
270
- end
271
- def self.values
272
- end
270
+ T.let(:x_account_connection_challenge, Symbol)
273
271
  end
274
272
 
275
273
  module Status
276
- extend XTwitterScraper::Internal::Type::Enum
277
-
278
- TaggedSymbol =
279
- T.type_alias do
280
- T.all(
281
- Symbol,
282
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status
283
- )
284
- end
285
- OrSymbol = T.type_alias { T.any(Symbol, String) }
286
-
287
- REQUIRES_EMAIL_CODE =
288
- T.let(
289
- :requires_email_code,
290
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
291
- )
292
-
293
- sig do
294
- override.returns(
295
- T::Array[
296
- XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
297
- ]
298
- )
299
- end
300
- def self.values
301
- end
274
+ REQUIRES_EMAIL_CODE = T.let(:requires_email_code, Symbol)
302
275
  end
303
276
  end
304
277
 
278
+ XAccountConnectionAttemptPending = Pending
279
+ XAccountConnectionAttemptSuccess = Success
280
+ XAccountConnectionAttemptFailed = Failed
281
+ XAccountConnectionChallenge = RequiresEmailCode
282
+
305
283
  sig do
306
284
  override.returns(
307
285
  T::Array[
@@ -29,7 +29,7 @@ module XTwitterScraper
29
29
  end
30
30
  attr_accessor :health
31
31
 
32
- sig { returns(String) }
32
+ sig { returns(Symbol) }
33
33
  attr_accessor :status
34
34
 
35
35
  sig { returns(String) }
@@ -45,18 +45,18 @@ module XTwitterScraper
45
45
  created_at: Time,
46
46
  health:
47
47
  XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::OrSymbol,
48
- status: String,
49
48
  x_user_id: String,
50
- x_username: String
49
+ x_username: String,
50
+ status: Symbol
51
51
  ).returns(T.attached_class)
52
52
  end
53
53
  def self.new(
54
54
  id:,
55
55
  created_at:,
56
56
  health:,
57
- status:,
58
57
  x_user_id:,
59
- x_username:
58
+ x_username:,
59
+ status: :active
60
60
  )
61
61
  end
62
62
 
@@ -67,7 +67,7 @@ module XTwitterScraper
67
67
  created_at: Time,
68
68
  health:
69
69
  XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol,
70
- status: String,
70
+ status: Symbol,
71
71
  x_user_id: String,
72
72
  x_username: String
73
73
  }
@@ -7,8 +7,270 @@
7
7
  module XTwitterScraper
8
8
  module Models
9
9
  module X
10
- AccountCreateResponse =
11
- T.let(T.anything, XTwitterScraper::Internal::Type::Converter)
10
+ # Sanitized X account summary returned by connect and reauth.
11
+ module AccountCreateResponse
12
+ extend XTwitterScraper::Internal::Type::Union
13
+
14
+ Variants =
15
+ T.type_alias do
16
+ T.any(
17
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount,
18
+ XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending,
19
+ XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge
20
+ )
21
+ end
22
+
23
+ class SanitizedXAccount < XTwitterScraper::Internal::Type::BaseModel
24
+ OrHash =
25
+ T.type_alias do
26
+ T.any(
27
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount,
28
+ XTwitterScraper::Internal::AnyHash
29
+ )
30
+ end
31
+
32
+ sig { returns(String) }
33
+ attr_accessor :id
34
+
35
+ sig { returns(Time) }
36
+ attr_accessor :created_at
37
+
38
+ sig do
39
+ returns(
40
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
41
+ )
42
+ end
43
+ attr_accessor :health
44
+
45
+ sig { returns(Symbol) }
46
+ attr_accessor :status
47
+
48
+ sig { returns(String) }
49
+ attr_accessor :x_user_id
50
+
51
+ sig { returns(String) }
52
+ attr_accessor :x_username
53
+
54
+ # Sanitized X account summary returned by connect and reauth.
55
+ sig do
56
+ params(
57
+ id: String,
58
+ created_at: Time,
59
+ health:
60
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::OrSymbol,
61
+ x_user_id: String,
62
+ x_username: String,
63
+ status: Symbol
64
+ ).returns(T.attached_class)
65
+ end
66
+ def self.new(
67
+ id:,
68
+ created_at:,
69
+ health:,
70
+ x_user_id:,
71
+ x_username:,
72
+ status: :active
73
+ )
74
+ end
75
+
76
+ sig do
77
+ override.returns(
78
+ {
79
+ id: String,
80
+ created_at: Time,
81
+ health:
82
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol,
83
+ status: Symbol,
84
+ x_user_id: String,
85
+ x_username: String
86
+ }
87
+ )
88
+ end
89
+ def to_hash
90
+ end
91
+
92
+ module Health
93
+ extend XTwitterScraper::Internal::Type::Enum
94
+
95
+ TaggedSymbol =
96
+ T.type_alias do
97
+ T.all(
98
+ Symbol,
99
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health
100
+ )
101
+ end
102
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
103
+
104
+ HEALTHY =
105
+ T.let(
106
+ :healthy,
107
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
108
+ )
109
+ LOCKED =
110
+ T.let(
111
+ :locked,
112
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
113
+ )
114
+ NEEDS_REAUTH =
115
+ T.let(
116
+ :needsReauth,
117
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
118
+ )
119
+ RECOVERING =
120
+ T.let(
121
+ :recovering,
122
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
123
+ )
124
+ SUSPENDED =
125
+ T.let(
126
+ :suspended,
127
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
128
+ )
129
+ TEMPORARY_ISSUE =
130
+ T.let(
131
+ :temporaryIssue,
132
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
133
+ )
134
+
135
+ sig do
136
+ override.returns(
137
+ T::Array[
138
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol
139
+ ]
140
+ )
141
+ end
142
+ def self.values
143
+ end
144
+ end
145
+ end
146
+
147
+ class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel
148
+ OrHash =
149
+ T.type_alias do
150
+ T.any(
151
+ XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending,
152
+ XTwitterScraper::Internal::AnyHash
153
+ )
154
+ end
155
+
156
+ sig { returns(String) }
157
+ attr_accessor :id
158
+
159
+ sig { returns(Symbol) }
160
+ attr_accessor :object
161
+
162
+ sig { returns(Integer) }
163
+ attr_accessor :poll_after_ms
164
+
165
+ sig { returns(Symbol) }
166
+ attr_accessor :status
167
+
168
+ # The connection is still in progress.
169
+ sig do
170
+ params(
171
+ id: String,
172
+ poll_after_ms: Integer,
173
+ object: Symbol,
174
+ status: Symbol
175
+ ).returns(T.attached_class)
176
+ end
177
+ def self.new(
178
+ id:,
179
+ poll_after_ms:,
180
+ object: :x_account_connection_attempt,
181
+ status: :pending
182
+ )
183
+ end
184
+
185
+ sig do
186
+ override.returns(
187
+ {
188
+ id: String,
189
+ object: Symbol,
190
+ poll_after_ms: Integer,
191
+ status: Symbol
192
+ }
193
+ )
194
+ end
195
+ def to_hash
196
+ end
197
+ end
198
+
199
+ class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel
200
+ OrHash =
201
+ T.type_alias do
202
+ T.any(
203
+ XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge,
204
+ XTwitterScraper::Internal::AnyHash
205
+ )
206
+ end
207
+
208
+ sig { returns(String) }
209
+ attr_accessor :id
210
+
211
+ sig { returns(Time) }
212
+ attr_accessor :expires_at
213
+
214
+ sig { returns(String) }
215
+ attr_accessor :message
216
+
217
+ sig { returns(Symbol) }
218
+ attr_accessor :object
219
+
220
+ sig { returns(Symbol) }
221
+ attr_accessor :status
222
+
223
+ sig { returns(String) }
224
+ attr_accessor :username
225
+
226
+ # Resumable account connection challenge. Submit the email code to finish the same
227
+ # connection attempt.
228
+ sig do
229
+ params(
230
+ id: String,
231
+ expires_at: Time,
232
+ message: String,
233
+ username: String,
234
+ object: Symbol,
235
+ status: Symbol
236
+ ).returns(T.attached_class)
237
+ end
238
+ def self.new(
239
+ id:,
240
+ expires_at:,
241
+ message:,
242
+ username:,
243
+ object: :x_account_connection_challenge,
244
+ status: :requires_email_code
245
+ )
246
+ end
247
+
248
+ sig do
249
+ override.returns(
250
+ {
251
+ id: String,
252
+ expires_at: Time,
253
+ message: String,
254
+ object: Symbol,
255
+ status: Symbol,
256
+ username: String
257
+ }
258
+ )
259
+ end
260
+ def to_hash
261
+ end
262
+ end
263
+
264
+ sig do
265
+ override.returns(
266
+ T::Array[
267
+ XTwitterScraper::Models::X::AccountCreateResponse::Variants
268
+ ]
269
+ )
270
+ end
271
+ def self.variants
272
+ end
273
+ end
12
274
  end
13
275
  end
14
276
  end
@@ -29,7 +29,7 @@ module XTwitterScraper
29
29
  end
30
30
  attr_accessor :health
31
31
 
32
- sig { returns(String) }
32
+ sig { returns(Symbol) }
33
33
  attr_accessor :status
34
34
 
35
35
  sig { returns(String) }
@@ -45,18 +45,18 @@ module XTwitterScraper
45
45
  created_at: Time,
46
46
  health:
47
47
  XTwitterScraper::Models::X::AccountReauthResponse::Health::OrSymbol,
48
- status: String,
49
48
  x_user_id: String,
50
- x_username: String
49
+ x_username: String,
50
+ status: Symbol
51
51
  ).returns(T.attached_class)
52
52
  end
53
53
  def self.new(
54
54
  id:,
55
55
  created_at:,
56
56
  health:,
57
- status:,
58
57
  x_user_id:,
59
- x_username:
58
+ x_username:,
59
+ status: :active
60
60
  )
61
61
  end
62
62
 
@@ -67,7 +67,7 @@ module XTwitterScraper
67
67
  created_at: Time,
68
68
  health:
69
69
  XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol,
70
- status: String,
70
+ status: Symbol,
71
71
  x_user_id: String,
72
72
  x_username: String
73
73
  }
@@ -30,10 +30,8 @@ module XTwitterScraper
30
30
  sig { params(cursor: String).void }
31
31
  attr_writer :cursor
32
32
 
33
- # Maximum items requested from this page (1-100, default 20). The response can
34
- # contain fewer items because the source returned fewer, filters removed items, or
35
- # remaining credits cover fewer results. Keep requesting next_cursor while
36
- # has_next_page is true, even when a page is empty. The deprecated limit and count
33
+ # Maximum page items (1-100, default 20). Source, filters, or credits can reduce
34
+ # results. Continue while has_next_page is true. Deprecated limit and count
37
35
  # aliases remain accepted.
38
36
  sig { returns(T.nilable(Integer)) }
39
37
  attr_reader :page_size
@@ -53,10 +51,8 @@ module XTwitterScraper
53
51
  id:,
54
52
  # Pagination cursor for community tweets
55
53
  cursor: nil,
56
- # Maximum items requested from this page (1-100, default 20). The response can
57
- # contain fewer items because the source returned fewer, filters removed items, or
58
- # remaining credits cover fewer results. Keep requesting next_cursor while
59
- # has_next_page is true, even when a page is empty. The deprecated limit and count
54
+ # Maximum page items (1-100, default 20). Source, filters, or credits can reduce
55
+ # results. Continue while has_next_page is true. Deprecated limit and count
60
56
  # aliases remain accepted.
61
57
  page_size: nil,
62
58
  request_options: {}
@@ -35,10 +35,8 @@ module XTwitterScraper
35
35
  sig { params(cursor: String).void }
36
36
  attr_writer :cursor
37
37
 
38
- # Maximum items requested from this page (1-100, default 20). The response can
39
- # contain fewer items because the source returned fewer, filters removed items, or
40
- # remaining credits cover fewer results. Keep requesting next_cursor while
41
- # has_next_page is true, even when a page is empty. The deprecated limit and count
38
+ # Maximum page items (1-100, default 20). Source, filters, or credits can reduce
39
+ # results. Continue while has_next_page is true. Deprecated limit and count
42
40
  # aliases remain accepted.
43
41
  sig { returns(T.nilable(Integer)) }
44
42
  attr_reader :page_size
@@ -82,10 +80,8 @@ module XTwitterScraper
82
80
  q:,
83
81
  # Pagination cursor for community results
84
82
  cursor: nil,
85
- # Maximum items requested from this page (1-100, default 20). The response can
86
- # contain fewer items because the source returned fewer, filters removed items, or
87
- # remaining credits cover fewer results. Keep requesting next_cursor while
88
- # has_next_page is true, even when a page is empty. The deprecated limit and count
83
+ # Maximum page items (1-100, default 20). Source, filters, or credits can reduce
84
+ # results. Continue while has_next_page is true. Deprecated limit and count
89
85
  # aliases remain accepted.
90
86
  page_size: nil,
91
87
  # Sort order for community results (Latest or Top)