Class: XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/x_twitter_scraper/models/x/tweet_search_response.rb,
sig/x_twitter_scraper/models/x/tweet_search_response.rbs

Defined Under Namespace

Classes: Strategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(diagnostic:, has_next_page: nil, next_cursor: nil) ⇒ Object

No-mode search, user Tweet, user reply, and direct reply reads use automatic coverage. Shape, filters, aliases, and billing stay compatible. Unprefixed cursors remain legacy. Follow next_cursor while has_next_page is true. An empty filtered page can still have has_next_page true.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 53

class Diagnostic < XTwitterScraper::Internal::Type::BaseModel
  # @!attribute complete
  #   True when every strategy exhausted its source.
  #
  #   @return [Boolean]
  required :complete, XTwitterScraper::Internal::Type::Boolean

  # @!attribute cursor_failure_count
  #
  #   @return [Integer]
  required :cursor_failure_count, Integer, api_name: :cursorFailureCount

  # @!attribute deadline_reached
  #
  #   @return [Boolean]
  required :deadline_reached, XTwitterScraper::Internal::Type::Boolean, api_name: :deadlineReached

  # @!attribute duplicate_count
  #
  #   @return [Integer]
  required :duplicate_count, Integer, api_name: :duplicateCount

  # @!attribute failed_strategy_count
  #
  #   @return [Integer]
  required :failed_strategy_count, Integer, api_name: :failedStrategyCount

  # @!attribute malformed_count
  #
  #   @return [Integer]
  required :malformed_count, Integer, api_name: :malformedCount

  # @!attribute pages_fetched
  #
  #   @return [Integer]
  required :pages_fetched, Integer, api_name: :pagesFetched

  # @!attribute partitioned
  #   Whether bounded time windows ran in parallel.
  #
  #   @return [Boolean]
  required :partitioned, XTwitterScraper::Internal::Type::Boolean

  # @!attribute response_truncated
  #   Whether credits or the requested limit reduced output.
  #
  #   @return [Boolean]
  required :response_truncated,
           XTwitterScraper::Internal::Type::Boolean,
           api_name: :responseTruncated

  # @!attribute result_limit_reached
  #
  #   @return [Boolean]
  required :result_limit_reached,
           XTwitterScraper::Internal::Type::Boolean,
           api_name: :resultLimitReached

  # @!attribute returned_tweets
  #
  #   @return [Integer]
  required :returned_tweets, Integer, api_name: :returnedTweets

  # @!attribute stalled_strategy_count
  #
  #   @return [Integer]
  required :stalled_strategy_count, Integer, api_name: :stalledStrategyCount

  # @!attribute strategies
  #
  #   @return [Array<XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy>]
  required :strategies,
           -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy] }

  # @!attribute strategy_count
  #
  #   @return [Integer]
  required :strategy_count, Integer, api_name: :strategyCount

  # @!attribute unique_tweets
  #
  #   @return [Integer]
  required :unique_tweets, Integer, api_name: :uniqueTweets

  # @!method initialize(complete:, cursor_failure_count:, deadline_reached:, duplicate_count:, failed_strategy_count:, malformed_count:, pages_fetched:, partitioned:, response_truncated:, result_limit_reached:, returned_tweets:, stalled_strategy_count:, strategies:, strategy_count:, unique_tweets:)
  #   Coverage evidence across parallel search strategies.
  #
  #   @param complete [Boolean] True when every strategy exhausted its source.
  #
  #   @param cursor_failure_count [Integer]
  #
  #   @param deadline_reached [Boolean]
  #
  #   @param duplicate_count [Integer]
  #
  #   @param failed_strategy_count [Integer]
  #
  #   @param malformed_count [Integer]
  #
  #   @param pages_fetched [Integer]
  #
  #   @param partitioned [Boolean] Whether bounded time windows ran in parallel.
  #
  #   @param response_truncated [Boolean] Whether credits or the requested limit reduced output.
  #
  #   @param result_limit_reached [Boolean]
  #
  #   @param returned_tweets [Integer]
  #
  #   @param stalled_strategy_count [Integer]
  #
  #   @param strategies [Array<XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy>]
  #
  #   @param strategy_count [Integer]
  #
  #   @param unique_tweets [Integer]

  class Strategy < XTwitterScraper::Internal::Type::BaseModel
    # @!attribute duplicate_count
    #
    #   @return [Integer]
    required :duplicate_count, Integer, api_name: :duplicateCount

    # @!attribute pages_fetched
    #
    #   @return [Integer]
    required :pages_fetched, Integer, api_name: :pagesFetched

    # @!attribute query_type
    #
    #   @return [Symbol, XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::QueryType]
    required :query_type,
             enum: -> { XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::QueryType },
             api_name: :queryType

    # @!attribute stop_reason
    #
    #   @return [Symbol, XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::StopReason]
    required :stop_reason,
             enum: -> { XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::StopReason },
             api_name: :stopReason

    # @!attribute strategy
    #
    #   @return [Integer]
    required :strategy, Integer

    # @!attribute unique_added
    #
    #   @return [Integer]
    required :unique_added, Integer, api_name: :uniqueAdded

    # @!attribute window
    #   Non-overlapping time partition used by one strategy.
    #
    #   @return [XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::Window, nil]
    optional :window,
             -> { XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::Window }

    # @!method initialize(duplicate_count:, pages_fetched:, query_type:, stop_reason:, strategy:, unique_added:, window: nil)
    #   @param duplicate_count [Integer]
    #
    #   @param pages_fetched [Integer]
    #
    #   @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::QueryType]
    #
    #   @param stop_reason [Symbol, XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::StopReason]
    #
    #   @param strategy [Integer]
    #
    #   @param unique_added [Integer]
    #
    #   @param window [XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy::Window] Non-overlapping time partition used by one strategy.

    # @see XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy#query_type
    module QueryType
      extend XTwitterScraper::Internal::Type::Enum

      LATEST = :Latest
      TOP = :Top

      # @!method self.values
      #   @return [Array<Symbol>]
    end

    # @see XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy#stop_reason
    module StopReason
      extend XTwitterScraper::Internal::Type::Enum

      CURSOR_FAILURE = :cursor_failure
      DEADLINE = :deadline
      EXHAUSTED = :exhausted
      FAILED = :failed
      PAGE_LIMIT = :page_limit
      RESULT_LIMIT = :result_limit
      STALLED = :stalled

      # @!method self.values
      #   @return [Array<Symbol>]
    end

    # @see XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy#window
    class Window < XTwitterScraper::Internal::Type::BaseModel
      # @!attribute since_time
      #
      #   @return [Time]
      required :since_time, Time, api_name: :sinceTime

      # @!attribute until_time
      #
      #   @return [Time]
      required :until_time, Time, api_name: :untilTime

      # @!method initialize(since_time:, until_time:)
      #   Non-overlapping time partition used by one strategy.
      #
      #   @param since_time [Time]
      #   @param until_time [Time]
    end
  end
end

Instance Attribute Details

#completeBoolean

True when every strategy exhausted its source.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


58
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 58

required :complete, XTwitterScraper::Internal::Type::Boolean

#cursor_failure_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


63
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 63

required :cursor_failure_count, Integer, api_name: :cursorFailureCount

#deadline_reachedBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


68
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 68

required :deadline_reached, XTwitterScraper::Internal::Type::Boolean, api_name: :deadlineReached

#duplicate_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


73
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 73

required :duplicate_count, Integer, api_name: :duplicateCount

#failed_strategy_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


78
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 78

required :failed_strategy_count, Integer, api_name: :failedStrategyCount

#malformed_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


83
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 83

required :malformed_count, Integer, api_name: :malformedCount

#pages_fetchedInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


88
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 88

required :pages_fetched, Integer, api_name: :pagesFetched

#partitionedBoolean

Whether bounded time windows ran in parallel.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


94
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 94

required :partitioned, XTwitterScraper::Internal::Type::Boolean

#response_truncatedBoolean

Whether credits or the requested limit reduced output.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


100
101
102
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 100

required :response_truncated,
XTwitterScraper::Internal::Type::Boolean,
api_name: :responseTruncated

#result_limit_reachedBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


107
108
109
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 107

required :result_limit_reached,
XTwitterScraper::Internal::Type::Boolean,
api_name: :resultLimitReached

#returned_tweetsInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


114
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 114

required :returned_tweets, Integer, api_name: :returnedTweets

#stalled_strategy_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


119
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 119

required :stalled_strategy_count, Integer, api_name: :stalledStrategyCount

#strategiesArray<XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy>



124
125
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 124

required :strategies,
-> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetSearchResponse::TweetSearchCoverageResponse::Diagnostic::Strategy] }

#strategy_countInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


130
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 130

required :strategy_count, Integer, api_name: :strategyCount

#unique_tweetsInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


135
# File 'lib/x_twitter_scraper/models/x/tweet_search_response.rb', line 135

required :unique_tweets, Integer, api_name: :uniqueTweets

Instance Method Details

#to_hash{

Returns:

  • ({)


117
# File 'sig/x_twitter_scraper/models/x/tweet_search_response.rbs', line 117

def to_hash: -> {