diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 94e9edb..3e40ec2 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -12,10 +12,6 @@ jobs: publish: name: publish runs-on: ubuntu-latest - environment: rubygems - permissions: - contents: read - id-token: write steps: - uses: actions/checkout@v6 @@ -26,9 +22,10 @@ jobs: - run: |- bundle install - - name: Configure trusted publishing credentials - uses: rubygems/configure-rubygems-credentials@v1.0.0 - - name: Publish to RubyGems.org run: | bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.X_TWITTER_SCRAPER_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.X_TWITTER_SCRAPER_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c..da59f99 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 68ba24f..d8c6752 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 115 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-93bb7d4f1475c8043af464ec88244a034456c549136c8477f284f0a33192e1c9.yml -openapi_spec_hash: 74dca63c872249274ad99b111dea0833 -config_hash: 8894c96caeb6df84c9394518810221bd +configured_endpoints: 117 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-d40c57a05527faf060d21c0e013729f371d88017b10680cea7c8fd6780ffaef5.yml +openapi_spec_hash: 597ebc460cf86740b9f6f7c95478dece +config_hash: e48b11ffdd2d30680081d5436848066d diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ab913..d3dc45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## 0.4.0 (2026-04-22) + +Full Changelog: [v0.3.0...v0.4.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.3.0...v0.4.0) + +### Features + +* **api:** api update ([57ca5de](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/57ca5deef4ab9b670bc0e143c00639a8c3da1258)) +* **api:** api update ([21e1e0f](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/21e1e0f3791b791ab09f8982edaae123ba8d45a1)) +* **api:** api update ([c053ff2](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/c053ff2fdc9a671ff1a6d6596a97d1ebb8a33eb2)) +* **api:** api update ([f9c02a4](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/f9c02a49240130a307fcbd1cfbcfaf999966fb06)) +* **api:** api update ([89e3ff5](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/89e3ff5905185e6223233618819d6dc87a2e87d7)) +* **api:** api update ([dbe6467](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/dbe6467a33987dcd3a65b78bfefca13b5123ae63)) +* **api:** api update ([279a416](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/279a416215ad266661cac5edd02e821e2f701d60)) + + +### Bug Fixes + +* **ci:** pin rubygems/configure-rubygems-credentials to v1.0.0 ([7d2cde5](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/7d2cde520114bba9680b2c98fbe699f75f9b5c04)) +* set homepage to docs.xquik.com, add documentation_uri to gemdocs ([0f8e806](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/0f8e806ff20df4700054a7df0e17aa89e2da4859)) + + +### Chores + +* update SDK settings ([301d2a6](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/301d2a616dfaf7c4ac15798a7463ecd3ef2770eb)) + ## 0.3.0 (2026-04-01) Full Changelog: [v0.2.0...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.2.0...v0.3.0) diff --git a/Gemfile.lock b/Gemfile.lock index 88fc74f..1540b47 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - x-twitter-scraper (0.3.0) + x-twitter-scraper (0.4.0) cgi connection_pool diff --git a/README.md b/README.md index ae2dd85..a3783e6 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "x-twitter-scraper", "~> 0.3.0" +gem "x-twitter-scraper", "~> 0.4.0" ``` @@ -32,9 +32,9 @@ x_twitter_scraper = XTwitterScraper::Client.new( api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] # This is the default and can be omitted ) -response = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10) +paginated_tweets = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10) -puts(response.has_next_page) +puts(paginated_tweets.has_next_page) ``` ### File uploads @@ -153,7 +153,7 @@ You can send undocumented parameters to any endpoint, and read undocumented resp Note: the `extra_` parameters of the same name overrides the documented parameters. ```ruby -response = +paginated_tweets = x_twitter_scraper.x.tweets.search( q: "from:elonmusk", limit: 10, @@ -164,7 +164,7 @@ response = } ) -puts(response[:my_undocumented_property]) +puts(paginated_tweets[:my_undocumented_property]) ``` #### Undocumented request params diff --git a/lib/x_twitter_scraper.rb b/lib/x_twitter_scraper.rb index 93f077c..3c185bf 100644 --- a/lib/x_twitter_scraper.rb +++ b/lib/x_twitter_scraper.rb @@ -74,13 +74,11 @@ require_relative "x_twitter_scraper/models/delivery" require_relative "x_twitter_scraper/models/draft" require_relative "x_twitter_scraper/models/draft_create_params" -require_relative "x_twitter_scraper/models/draft_create_response" require_relative "x_twitter_scraper/models/draft_delete_params" require_relative "x_twitter_scraper/models/draft_detail" require_relative "x_twitter_scraper/models/draft_list_params" require_relative "x_twitter_scraper/models/draft_list_response" require_relative "x_twitter_scraper/models/draft_retrieve_params" -require_relative "x_twitter_scraper/models/draft_retrieve_response" require_relative "x_twitter_scraper/models/draw_detail" require_relative "x_twitter_scraper/models/draw_export_params" require_relative "x_twitter_scraper/models/draw_list_item" @@ -96,7 +94,6 @@ require_relative "x_twitter_scraper/models/event_list_params" require_relative "x_twitter_scraper/models/event_list_response" require_relative "x_twitter_scraper/models/event_retrieve_params" -require_relative "x_twitter_scraper/models/event_retrieve_response" require_relative "x_twitter_scraper/models/event_type" require_relative "x_twitter_scraper/models/extraction_estimate_cost_params" require_relative "x_twitter_scraper/models/extraction_estimate_cost_response" @@ -110,7 +107,6 @@ require_relative "x_twitter_scraper/models/extraction_run_response" require_relative "x_twitter_scraper/models/integration" require_relative "x_twitter_scraper/models/integration_create_params" -require_relative "x_twitter_scraper/models/integration_create_response" require_relative "x_twitter_scraper/models/integration_delete_params" require_relative "x_twitter_scraper/models/integration_delete_response" require_relative "x_twitter_scraper/models/integration_delivery" @@ -119,11 +115,9 @@ require_relative "x_twitter_scraper/models/integration_list_params" require_relative "x_twitter_scraper/models/integration_list_response" require_relative "x_twitter_scraper/models/integration_retrieve_params" -require_relative "x_twitter_scraper/models/integration_retrieve_response" require_relative "x_twitter_scraper/models/integration_send_test_params" require_relative "x_twitter_scraper/models/integration_send_test_response" require_relative "x_twitter_scraper/models/integration_update_params" -require_relative "x_twitter_scraper/models/integration_update_response" require_relative "x_twitter_scraper/models/monitor" require_relative "x_twitter_scraper/models/monitor_create_params" require_relative "x_twitter_scraper/models/monitor_create_response" @@ -132,16 +126,13 @@ require_relative "x_twitter_scraper/models/monitor_list_params" require_relative "x_twitter_scraper/models/monitor_list_response" require_relative "x_twitter_scraper/models/monitor_retrieve_params" -require_relative "x_twitter_scraper/models/monitor_retrieve_response" require_relative "x_twitter_scraper/models/monitor_update_params" -require_relative "x_twitter_scraper/models/monitor_update_response" require_relative "x_twitter_scraper/models/paginated_tweets" require_relative "x_twitter_scraper/models/paginated_users" require_relative "x_twitter_scraper/models/radar_item" require_relative "x_twitter_scraper/models/radar_retrieve_trending_topics_params" require_relative "x_twitter_scraper/models/radar_retrieve_trending_topics_response" require_relative "x_twitter_scraper/models/style_analyze_params" -require_relative "x_twitter_scraper/models/style_analyze_response" require_relative "x_twitter_scraper/models/style_compare_params" require_relative "x_twitter_scraper/models/style_compare_response" require_relative "x_twitter_scraper/models/style_delete_params" @@ -152,9 +143,7 @@ require_relative "x_twitter_scraper/models/style_profile" require_relative "x_twitter_scraper/models/style_profile_summary" require_relative "x_twitter_scraper/models/style_retrieve_params" -require_relative "x_twitter_scraper/models/style_retrieve_response" require_relative "x_twitter_scraper/models/style_update_params" -require_relative "x_twitter_scraper/models/style_update_response" require_relative "x_twitter_scraper/models/subscribe_create_params" require_relative "x_twitter_scraper/models/subscribe_create_response" require_relative "x_twitter_scraper/models/support/ticket_create_params" @@ -181,8 +170,9 @@ require_relative "x_twitter_scraper/models/webhook_test_params" require_relative "x_twitter_scraper/models/webhook_test_response" require_relative "x_twitter_scraper/models/webhook_update_params" -require_relative "x_twitter_scraper/models/webhook_update_response" require_relative "x_twitter_scraper/models/winner" +require_relative "x_twitter_scraper/models/x/account_bulk_retry_params" +require_relative "x_twitter_scraper/models/x/account_bulk_retry_response" require_relative "x_twitter_scraper/models/x/account_create_params" require_relative "x_twitter_scraper/models/x/account_create_response" require_relative "x_twitter_scraper/models/x/account_delete_params" @@ -192,15 +182,12 @@ require_relative "x_twitter_scraper/models/x/account_reauth_params" require_relative "x_twitter_scraper/models/x/account_reauth_response" require_relative "x_twitter_scraper/models/x/account_retrieve_params" -require_relative "x_twitter_scraper/models/x/account_retrieve_response" require_relative "x_twitter_scraper/models/x/bookmark_list_params" -require_relative "x_twitter_scraper/models/x/bookmark_list_response" require_relative "x_twitter_scraper/models/x/bookmark_retrieve_folders_params" require_relative "x_twitter_scraper/models/x/bookmark_retrieve_folders_response" require_relative "x_twitter_scraper/models/x/communities/join_create_params" -require_relative "x_twitter_scraper/models/x/communities/join_create_response" require_relative "x_twitter_scraper/models/x/communities/join_delete_all_params" -require_relative "x_twitter_scraper/models/x/communities/join_delete_all_response" +require_relative "x_twitter_scraper/models/x/communities/tweet_list_by_community_params" require_relative "x_twitter_scraper/models/x/communities/tweet_list_params" require_relative "x_twitter_scraper/models/x/community_action_result" require_relative "x_twitter_scraper/models/x/community_create_params" @@ -239,15 +226,10 @@ require_relative "x_twitter_scraper/models/x/tweet_delete_response" require_relative "x_twitter_scraper/models/x/tweet_detail" require_relative "x_twitter_scraper/models/x/tweet_get_favoriters_params" -require_relative "x_twitter_scraper/models/x/tweet_get_favoriters_response" require_relative "x_twitter_scraper/models/x/tweet_get_quotes_params" -require_relative "x_twitter_scraper/models/x/tweet_get_quotes_response" require_relative "x_twitter_scraper/models/x/tweet_get_replies_params" -require_relative "x_twitter_scraper/models/x/tweet_get_replies_response" require_relative "x_twitter_scraper/models/x/tweet_get_retweeters_params" -require_relative "x_twitter_scraper/models/x/tweet_get_retweeters_response" require_relative "x_twitter_scraper/models/x/tweet_get_thread_params" -require_relative "x_twitter_scraper/models/x/tweet_get_thread_response" require_relative "x_twitter_scraper/models/x/tweet_list_params" require_relative "x_twitter_scraper/models/x/tweet_retrieve_params" require_relative "x_twitter_scraper/models/x/tweet_retrieve_response" @@ -260,23 +242,17 @@ require_relative "x_twitter_scraper/models/x/tweets/retweet_delete_params" require_relative "x_twitter_scraper/models/x/tweets/retweet_delete_response" require_relative "x_twitter_scraper/models/x/tweet_search_params" -require_relative "x_twitter_scraper/models/x/tweet_search_response" require_relative "x_twitter_scraper/models/x/user_profile" require_relative "x_twitter_scraper/models/x/user_retrieve_batch_params" require_relative "x_twitter_scraper/models/x/user_retrieve_followers_params" require_relative "x_twitter_scraper/models/x/user_retrieve_followers_you_know_params" -require_relative "x_twitter_scraper/models/x/user_retrieve_followers_you_know_response" require_relative "x_twitter_scraper/models/x/user_retrieve_following_params" require_relative "x_twitter_scraper/models/x/user_retrieve_likes_params" -require_relative "x_twitter_scraper/models/x/user_retrieve_likes_response" require_relative "x_twitter_scraper/models/x/user_retrieve_media_params" -require_relative "x_twitter_scraper/models/x/user_retrieve_media_response" require_relative "x_twitter_scraper/models/x/user_retrieve_mentions_params" require_relative "x_twitter_scraper/models/x/user_retrieve_params" -require_relative "x_twitter_scraper/models/x/user_retrieve_response" require_relative "x_twitter_scraper/models/x/user_retrieve_search_params" require_relative "x_twitter_scraper/models/x/user_retrieve_tweets_params" -require_relative "x_twitter_scraper/models/x/user_retrieve_tweets_response" require_relative "x_twitter_scraper/models/x/user_retrieve_verified_followers_params" require_relative "x_twitter_scraper/models/x/users/follow_create_params" require_relative "x_twitter_scraper/models/x/users/follow_create_response" @@ -287,10 +263,10 @@ require_relative "x_twitter_scraper/models/x_get_article_params" require_relative "x_twitter_scraper/models/x_get_article_response" require_relative "x_twitter_scraper/models/x_get_home_timeline_params" -require_relative "x_twitter_scraper/models/x_get_home_timeline_response" require_relative "x_twitter_scraper/models/x_get_notifications_params" require_relative "x_twitter_scraper/models/x_get_notifications_response" require_relative "x_twitter_scraper/models/x_get_trends_params" +require_relative "x_twitter_scraper/models/x_get_trends_response" require_relative "x_twitter_scraper/models" require_relative "x_twitter_scraper/resources/account" require_relative "x_twitter_scraper/resources/api_keys" diff --git a/lib/x_twitter_scraper/models/api_key.rb b/lib/x_twitter_scraper/models/api_key.rb index 4de62af..6334482 100644 --- a/lib/x_twitter_scraper/models/api_key.rb +++ b/lib/x_twitter_scraper/models/api_key.rb @@ -34,6 +34,8 @@ class APIKey < XTwitterScraper::Internal::Type::BaseModel optional :last_used_at, Time, api_name: :lastUsedAt # @!method initialize(id:, created_at:, is_active:, name:, prefix:, last_used_at: nil) + # API key metadata returned when listing keys. + # # @param id [String] # @param created_at [Time] # @param is_active [Boolean] diff --git a/lib/x_twitter_scraper/models/api_key_list_response.rb b/lib/x_twitter_scraper/models/api_key_list_response.rb index b06bc6d..9c3a710 100644 --- a/lib/x_twitter_scraper/models/api_key_list_response.rb +++ b/lib/x_twitter_scraper/models/api_key_list_response.rb @@ -6,52 +6,11 @@ module Models class APIKeyListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute keys # - # @return [Array] - required :keys, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::APIKeyListResponse::Key] } + # @return [Array] + required :keys, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::APIKey] } # @!method initialize(keys:) - # @param keys [Array] - - class Key < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute prefix - # - # @return [String] - required :prefix, String - - # @!attribute last_used_at - # - # @return [Time, nil] - optional :last_used_at, Time, api_name: :lastUsedAt - - # @!method initialize(id:, created_at:, is_active:, name:, prefix:, last_used_at: nil) - # @param id [String] - # @param created_at [Time] - # @param is_active [Boolean] - # @param name [String] - # @param prefix [String] - # @param last_used_at [Time] - end + # @param keys [Array] end end end diff --git a/lib/x_twitter_scraper/models/delivery.rb b/lib/x_twitter_scraper/models/delivery.rb index 02e3e99..5e125f0 100644 --- a/lib/x_twitter_scraper/models/delivery.rb +++ b/lib/x_twitter_scraper/models/delivery.rb @@ -44,6 +44,8 @@ class Delivery < XTwitterScraper::Internal::Type::BaseModel optional :last_status_code, Integer, api_name: :lastStatusCode # @!method initialize(id:, attempts:, created_at:, status:, stream_event_id:, delivered_at: nil, last_error: nil, last_status_code: nil) + # Webhook delivery attempt record with status and retry count. + # # @param id [String] # @param attempts [Integer] # @param created_at [Time] diff --git a/lib/x_twitter_scraper/models/draft.rb b/lib/x_twitter_scraper/models/draft.rb index 6d56b32..a0636f2 100644 --- a/lib/x_twitter_scraper/models/draft.rb +++ b/lib/x_twitter_scraper/models/draft.rb @@ -29,6 +29,8 @@ class Draft < XTwitterScraper::Internal::Type::BaseModel optional :topic, String # @!method initialize(id:, created_at:, text:, goal: nil, topic: nil) + # Saved tweet draft with optional topic and goal. + # # @param id [String] # @param created_at [Time] # @param text [String] diff --git a/lib/x_twitter_scraper/models/draft_create_response.rb b/lib/x_twitter_scraper/models/draft_create_response.rb deleted file mode 100644 index 4e07ae0..0000000 --- a/lib/x_twitter_scraper/models/draft_create_response.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Drafts#create - class DraftCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute updated_at - # - # @return [Time] - required :updated_at, Time, api_name: :updatedAt - - # @!attribute goal - # - # @return [String, nil] - optional :goal, String - - # @!attribute topic - # - # @return [String, nil] - optional :topic, String - - # @!method initialize(id:, created_at:, text:, updated_at:, goal: nil, topic: nil) - # @param id [String] - # @param created_at [Time] - # @param text [String] - # @param updated_at [Time] - # @param goal [String] - # @param topic [String] - end - end -end diff --git a/lib/x_twitter_scraper/models/draft_detail.rb b/lib/x_twitter_scraper/models/draft_detail.rb index 7bdb74c..2d3edc1 100644 --- a/lib/x_twitter_scraper/models/draft_detail.rb +++ b/lib/x_twitter_scraper/models/draft_detail.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Drafts#create class DraftDetail < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -34,6 +35,8 @@ class DraftDetail < XTwitterScraper::Internal::Type::BaseModel optional :topic, String # @!method initialize(id:, created_at:, text:, updated_at:, goal: nil, topic: nil) + # Full tweet draft including update timestamp. + # # @param id [String] # @param created_at [Time] # @param text [String] diff --git a/lib/x_twitter_scraper/models/draft_list_params.rb b/lib/x_twitter_scraper/models/draft_list_params.rb index 6bbfbba..2dfbeb3 100644 --- a/lib/x_twitter_scraper/models/draft_list_params.rb +++ b/lib/x_twitter_scraper/models/draft_list_params.rb @@ -14,6 +14,7 @@ class DraftListParams < XTwitterScraper::Internal::Type::BaseModel optional :after_cursor, String # @!attribute limit + # Maximum number of items to return (1-100, default 50) # # @return [Integer, nil] optional :limit, Integer @@ -21,7 +22,7 @@ class DraftListParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(after_cursor: nil, limit: nil, request_options: {}) # @param after_cursor [String] Cursor for pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/draft_list_response.rb b/lib/x_twitter_scraper/models/draft_list_response.rb index f1df738..c3f7bc1 100644 --- a/lib/x_twitter_scraper/models/draft_list_response.rb +++ b/lib/x_twitter_scraper/models/draft_list_response.rb @@ -6,9 +6,8 @@ module Models class DraftListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute drafts # - # @return [Array] - required :drafts, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DraftListResponse::Draft] } + # @return [Array] + required :drafts, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Draft] } # @!attribute has_more # @@ -21,43 +20,9 @@ class DraftListResponse < XTwitterScraper::Internal::Type::BaseModel optional :next_cursor, String, api_name: :nextCursor # @!method initialize(drafts:, has_more:, next_cursor: nil) - # @param drafts [Array] + # @param drafts [Array] # @param has_more [Boolean] # @param next_cursor [String] - - class Draft < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute goal - # - # @return [String, nil] - optional :goal, String - - # @!attribute topic - # - # @return [String, nil] - optional :topic, String - - # @!method initialize(id:, created_at:, text:, goal: nil, topic: nil) - # @param id [String] - # @param created_at [Time] - # @param text [String] - # @param goal [String] - # @param topic [String] - end end end end diff --git a/lib/x_twitter_scraper/models/draft_retrieve_response.rb b/lib/x_twitter_scraper/models/draft_retrieve_response.rb deleted file mode 100644 index c6a7eb4..0000000 --- a/lib/x_twitter_scraper/models/draft_retrieve_response.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Drafts#retrieve - class DraftRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute updated_at - # - # @return [Time] - required :updated_at, Time, api_name: :updatedAt - - # @!attribute goal - # - # @return [String, nil] - optional :goal, String - - # @!attribute topic - # - # @return [String, nil] - optional :topic, String - - # @!method initialize(id:, created_at:, text:, updated_at:, goal: nil, topic: nil) - # @param id [String] - # @param created_at [Time] - # @param text [String] - # @param updated_at [Time] - # @param goal [String] - # @param topic [String] - end - end -end diff --git a/lib/x_twitter_scraper/models/draw_detail.rb b/lib/x_twitter_scraper/models/draw_detail.rb index ae206b2..bbadc13 100644 --- a/lib/x_twitter_scraper/models/draw_detail.rb +++ b/lib/x_twitter_scraper/models/draw_detail.rb @@ -74,6 +74,8 @@ class DrawDetail < XTwitterScraper::Internal::Type::BaseModel optional :drawn_at, Time, api_name: :drawnAt # @!method initialize(id:, created_at:, status:, total_entries:, tweet_author_username:, tweet_id:, tweet_like_count:, tweet_quote_count:, tweet_reply_count:, tweet_retweet_count:, tweet_text:, tweet_url:, valid_entries:, drawn_at: nil) + # Full giveaway draw with tweet metrics, entries, and timing. + # # @param id [String] # @param created_at [Time] # @param status [String] diff --git a/lib/x_twitter_scraper/models/draw_export_params.rb b/lib/x_twitter_scraper/models/draw_export_params.rb index dc28898..b5e8200 100644 --- a/lib/x_twitter_scraper/models/draw_export_params.rb +++ b/lib/x_twitter_scraper/models/draw_export_params.rb @@ -13,6 +13,7 @@ class DrawExportParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute format_ + # Export output format # # @return [Symbol, XTwitterScraper::Models::DrawExportParams::Format, nil] optional :format_, enum: -> { XTwitterScraper::DrawExportParams::Format } @@ -26,12 +27,13 @@ class DrawExportParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, format_: nil, type: nil, request_options: {}) # @param id [String] # - # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] + # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] Export output format # # @param type [Symbol, XTwitterScraper::Models::DrawExportParams::Type] Export winners or all entries # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Export output format module Format extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/draw_list_item.rb b/lib/x_twitter_scraper/models/draw_list_item.rb index efa2f03..a33f06d 100644 --- a/lib/x_twitter_scraper/models/draw_list_item.rb +++ b/lib/x_twitter_scraper/models/draw_list_item.rb @@ -39,6 +39,8 @@ class DrawListItem < XTwitterScraper::Internal::Type::BaseModel optional :drawn_at, Time, api_name: :drawnAt # @!method initialize(id:, created_at:, status:, total_entries:, tweet_url:, valid_entries:, drawn_at: nil) + # Giveaway draw summary with entry counts and status. + # # @param id [String] # @param created_at [Time] # @param status [String] diff --git a/lib/x_twitter_scraper/models/draw_list_params.rb b/lib/x_twitter_scraper/models/draw_list_params.rb index 0400420..41cf8af 100644 --- a/lib/x_twitter_scraper/models/draw_list_params.rb +++ b/lib/x_twitter_scraper/models/draw_list_params.rb @@ -8,20 +8,21 @@ class DrawListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute after - # Cursor for pagination + # Cursor for keyset pagination # # @return [String, nil] optional :after, String # @!attribute limit + # Maximum number of items to return (1-100, default 50) # # @return [Integer, nil] optional :limit, Integer # @!method initialize(after: nil, limit: nil, request_options: {}) - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/draw_list_response.rb b/lib/x_twitter_scraper/models/draw_list_response.rb index 038b4ad..bf801a4 100644 --- a/lib/x_twitter_scraper/models/draw_list_response.rb +++ b/lib/x_twitter_scraper/models/draw_list_response.rb @@ -6,9 +6,8 @@ module Models class DrawListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute draws # - # @return [Array] - required :draws, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawListResponse::Draw] } + # @return [Array] + required :draws, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::DrawListItem] } # @!attribute has_more # @@ -21,55 +20,9 @@ class DrawListResponse < XTwitterScraper::Internal::Type::BaseModel optional :next_cursor, String, api_name: :nextCursor # @!method initialize(draws:, has_more:, next_cursor: nil) - # @param draws [Array] + # @param draws [Array] # @param has_more [Boolean] # @param next_cursor [String] - - class Draw < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute total_entries - # - # @return [Integer] - required :total_entries, Integer, api_name: :totalEntries - - # @!attribute tweet_url - # - # @return [String] - required :tweet_url, String, api_name: :tweetUrl - - # @!attribute valid_entries - # - # @return [Integer] - required :valid_entries, Integer, api_name: :validEntries - - # @!attribute drawn_at - # - # @return [Time, nil] - optional :drawn_at, Time, api_name: :drawnAt - - # @!method initialize(id:, created_at:, status:, total_entries:, tweet_url:, valid_entries:, drawn_at: nil) - # @param id [String] - # @param created_at [Time] - # @param status [String] - # @param total_entries [Integer] - # @param tweet_url [String] - # @param valid_entries [Integer] - # @param drawn_at [Time] - end end end end diff --git a/lib/x_twitter_scraper/models/draw_retrieve_response.rb b/lib/x_twitter_scraper/models/draw_retrieve_response.rb index ca76c5e..4059e2a 100644 --- a/lib/x_twitter_scraper/models/draw_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/draw_retrieve_response.rb @@ -5,136 +5,20 @@ module Models # @see XTwitterScraper::Resources::Draws#retrieve class DrawRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute draw + # Full giveaway draw with tweet metrics, entries, and timing. # - # @return [XTwitterScraper::Models::DrawRetrieveResponse::Draw] - required :draw, -> { XTwitterScraper::Models::DrawRetrieveResponse::Draw } + # @return [XTwitterScraper::Models::DrawDetail] + required :draw, -> { XTwitterScraper::DrawDetail } # @!attribute winners # - # @return [Array] - required :winners, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawRetrieveResponse::Winner] } + # @return [Array] + required :winners, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Winner] } # @!method initialize(draw:, winners:) - # @param draw [XTwitterScraper::Models::DrawRetrieveResponse::Draw] - # @param winners [Array] - - # @see XTwitterScraper::Models::DrawRetrieveResponse#draw - class Draw < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute total_entries - # - # @return [Integer] - required :total_entries, Integer, api_name: :totalEntries - - # @!attribute tweet_author_username - # - # @return [String] - required :tweet_author_username, String, api_name: :tweetAuthorUsername - - # @!attribute tweet_id - # - # @return [String] - required :tweet_id, String, api_name: :tweetId - - # @!attribute tweet_like_count - # - # @return [Integer] - required :tweet_like_count, Integer, api_name: :tweetLikeCount - - # @!attribute tweet_quote_count - # - # @return [Integer] - required :tweet_quote_count, Integer, api_name: :tweetQuoteCount - - # @!attribute tweet_reply_count - # - # @return [Integer] - required :tweet_reply_count, Integer, api_name: :tweetReplyCount - - # @!attribute tweet_retweet_count - # - # @return [Integer] - required :tweet_retweet_count, Integer, api_name: :tweetRetweetCount - - # @!attribute tweet_text - # - # @return [String] - required :tweet_text, String, api_name: :tweetText - - # @!attribute tweet_url - # - # @return [String] - required :tweet_url, String, api_name: :tweetUrl - - # @!attribute valid_entries - # - # @return [Integer] - required :valid_entries, Integer, api_name: :validEntries - - # @!attribute drawn_at - # - # @return [Time, nil] - optional :drawn_at, Time, api_name: :drawnAt - - # @!method initialize(id:, created_at:, status:, total_entries:, tweet_author_username:, tweet_id:, tweet_like_count:, tweet_quote_count:, tweet_reply_count:, tweet_retweet_count:, tweet_text:, tweet_url:, valid_entries:, drawn_at: nil) - # @param id [String] - # @param created_at [Time] - # @param status [String] - # @param total_entries [Integer] - # @param tweet_author_username [String] - # @param tweet_id [String] - # @param tweet_like_count [Integer] - # @param tweet_quote_count [Integer] - # @param tweet_reply_count [Integer] - # @param tweet_retweet_count [Integer] - # @param tweet_text [String] - # @param tweet_url [String] - # @param valid_entries [Integer] - # @param drawn_at [Time] - end - - class Winner < XTwitterScraper::Internal::Type::BaseModel - # @!attribute author_username - # - # @return [String] - required :author_username, String, api_name: :authorUsername - - # @!attribute is_backup - # - # @return [Boolean] - required :is_backup, XTwitterScraper::Internal::Type::Boolean, api_name: :isBackup - - # @!attribute position - # - # @return [Integer] - required :position, Integer - - # @!attribute tweet_id - # - # @return [String] - required :tweet_id, String, api_name: :tweetId - - # @!method initialize(author_username:, is_backup:, position:, tweet_id:) - # @param author_username [String] - # @param is_backup [Boolean] - # @param position [Integer] - # @param tweet_id [String] - end + # @param draw [XTwitterScraper::Models::DrawDetail] Full giveaway draw with tweet metrics, entries, and timing. + # + # @param winners [Array] end end end diff --git a/lib/x_twitter_scraper/models/draw_run_response.rb b/lib/x_twitter_scraper/models/draw_run_response.rb index 6e7eaa3..5935b2e 100644 --- a/lib/x_twitter_scraper/models/draw_run_response.rb +++ b/lib/x_twitter_scraper/models/draw_run_response.rb @@ -26,44 +26,15 @@ class DrawRunResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute winners # - # @return [Array] - required :winners, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawRunResponse::Winner] } + # @return [Array] + required :winners, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Winner] } # @!method initialize(id:, total_entries:, tweet_id:, valid_entries:, winners:) # @param id [String] # @param total_entries [Integer] # @param tweet_id [String] # @param valid_entries [Integer] - # @param winners [Array] - - class Winner < XTwitterScraper::Internal::Type::BaseModel - # @!attribute author_username - # - # @return [String] - required :author_username, String, api_name: :authorUsername - - # @!attribute is_backup - # - # @return [Boolean] - required :is_backup, XTwitterScraper::Internal::Type::Boolean, api_name: :isBackup - - # @!attribute position - # - # @return [Integer] - required :position, Integer - - # @!attribute tweet_id - # - # @return [String] - required :tweet_id, String, api_name: :tweetId - - # @!method initialize(author_username:, is_backup:, position:, tweet_id:) - # @param author_username [String] - # @param is_backup [Boolean] - # @param position [Integer] - # @param tweet_id [String] - end + # @param winners [Array] end end end diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index ae5bc7f..d8d81c8 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -9,6 +9,8 @@ class Error < XTwitterScraper::Internal::Type::BaseModel required :error, enum: -> { XTwitterScraper::Error::Error } # @!method initialize(error:) + # Error response containing a machine-readable error code. + # # @param error [Symbol, XTwitterScraper::Models::Error::Error] # @see XTwitterScraper::Models::Error#error diff --git a/lib/x_twitter_scraper/models/event.rb b/lib/x_twitter_scraper/models/event.rb index a35358b..99818db 100644 --- a/lib/x_twitter_scraper/models/event.rb +++ b/lib/x_twitter_scraper/models/event.rb @@ -24,9 +24,10 @@ class Event < XTwitterScraper::Internal::Type::BaseModel required :occurred_at, Time, api_name: :occurredAt # @!attribute type + # Type of monitor event fired when account activity occurs. # - # @return [Symbol, XTwitterScraper::Models::Event::Type] - required :type, enum: -> { XTwitterScraper::Event::Type } + # @return [Symbol, XTwitterScraper::Models::EventType] + required :type, enum: -> { XTwitterScraper::EventType } # @!attribute username # @@ -34,27 +35,19 @@ class Event < XTwitterScraper::Internal::Type::BaseModel required :username, String # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:) + # Monitor event summary with type, username, and occurrence time. + # # @param id [String] + # # @param data [Hash{Symbol=>Object}] + # # @param monitor_id [String] + # # @param occurred_at [Time] - # @param type [Symbol, XTwitterScraper::Models::Event::Type] + # + # @param type [Symbol, XTwitterScraper::Models::EventType] Type of monitor event fired when account activity occurs. + # # @param username [String] - - # @see XTwitterScraper::Models::Event#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/event_detail.rb b/lib/x_twitter_scraper/models/event_detail.rb index 299db4c..3e87746 100644 --- a/lib/x_twitter_scraper/models/event_detail.rb +++ b/lib/x_twitter_scraper/models/event_detail.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Events#retrieve class EventDetail < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -25,9 +26,10 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel required :occurred_at, Time, api_name: :occurredAt # @!attribute type + # Type of monitor event fired when account activity occurs. # - # @return [Symbol, XTwitterScraper::Models::EventDetail::Type] - required :type, enum: -> { XTwitterScraper::EventDetail::Type } + # @return [Symbol, XTwitterScraper::Models::EventType] + required :type, enum: -> { XTwitterScraper::EventType } # @!attribute username # @@ -40,6 +42,8 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel optional :x_event_id, String, api_name: :xEventId # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:, x_event_id: nil) + # Full monitor event including payload data and optional X event ID. + # # @param id [String] # # @param data [Hash{Symbol=>Object}] Event payload — shape varies by event type (JSON) @@ -48,26 +52,11 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel # # @param occurred_at [Time] # - # @param type [Symbol, XTwitterScraper::Models::EventDetail::Type] + # @param type [Symbol, XTwitterScraper::Models::EventType] Type of monitor event fired when account activity occurs. # # @param username [String] # # @param x_event_id [String] - - # @see XTwitterScraper::Models::EventDetail#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/event_list_params.rb b/lib/x_twitter_scraper/models/event_list_params.rb index 13db128..13d18f0 100644 --- a/lib/x_twitter_scraper/models/event_list_params.rb +++ b/lib/x_twitter_scraper/models/event_list_params.rb @@ -8,50 +8,39 @@ class EventListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute after - # Cursor for pagination + # Cursor for keyset pagination # # @return [String, nil] optional :after, String # @!attribute event_type + # Filter events by type # - # @return [Symbol, XTwitterScraper::Models::EventListParams::EventType, nil] - optional :event_type, enum: -> { XTwitterScraper::EventListParams::EventType } + # @return [Symbol, XTwitterScraper::Models::EventType, nil] + optional :event_type, enum: -> { XTwitterScraper::EventType } # @!attribute limit + # Maximum number of items to return (1-100, default 50) # # @return [Integer, nil] optional :limit, Integer # @!attribute monitor_id + # Filter events by monitor ID # # @return [String, nil] optional :monitor_id, String # @!method initialize(after: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param event_type [Symbol, XTwitterScraper::Models::EventListParams::EventType] + # @param event_type [Symbol, XTwitterScraper::Models::EventType] Filter events by type # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # - # @param monitor_id [String] + # @param monitor_id [String] Filter events by monitor ID # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/event_list_response.rb b/lib/x_twitter_scraper/models/event_list_response.rb index f9755db..9f970c9 100644 --- a/lib/x_twitter_scraper/models/event_list_response.rb +++ b/lib/x_twitter_scraper/models/event_list_response.rb @@ -6,9 +6,8 @@ module Models class EventListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute events # - # @return [Array] - required :events, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::EventListResponse::Event] } + # @return [Array] + required :events, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Event] } # @!attribute has_more # @@ -21,64 +20,9 @@ class EventListResponse < XTwitterScraper::Internal::Type::BaseModel optional :next_cursor, String, api_name: :nextCursor # @!method initialize(events:, has_more:, next_cursor: nil) - # @param events [Array] + # @param events [Array] # @param has_more [Boolean] # @param next_cursor [String] - - class Event < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute data - # - # @return [Hash{Symbol=>Object}] - required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute monitor_id - # - # @return [String] - required :monitor_id, String, api_name: :monitorId - - # @!attribute occurred_at - # - # @return [Time] - required :occurred_at, Time, api_name: :occurredAt - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::EventListResponse::Event::Type] - required :type, enum: -> { XTwitterScraper::Models::EventListResponse::Event::Type } - - # @!attribute username - # - # @return [String] - required :username, String - - # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:) - # @param id [String] - # @param data [Hash{Symbol=>Object}] - # @param monitor_id [String] - # @param occurred_at [Time] - # @param type [Symbol, XTwitterScraper::Models::EventListResponse::Event::Type] - # @param username [String] - - # @see XTwitterScraper::Models::EventListResponse::Event#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/x_twitter_scraper/models/event_retrieve_response.rb b/lib/x_twitter_scraper/models/event_retrieve_response.rb deleted file mode 100644 index 09193e0..0000000 --- a/lib/x_twitter_scraper/models/event_retrieve_response.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Events#retrieve - class EventRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute data - # Event payload — shape varies by event type (JSON) - # - # @return [Hash{Symbol=>Object}] - required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute monitor_id - # - # @return [String] - required :monitor_id, String, api_name: :monitorId - - # @!attribute occurred_at - # - # @return [Time] - required :occurred_at, Time, api_name: :occurredAt - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::EventRetrieveResponse::Type] - required :type, enum: -> { XTwitterScraper::Models::EventRetrieveResponse::Type } - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute x_event_id - # - # @return [String, nil] - optional :x_event_id, String, api_name: :xEventId - - # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:, x_event_id: nil) - # @param id [String] - # - # @param data [Hash{Symbol=>Object}] Event payload — shape varies by event type (JSON) - # - # @param monitor_id [String] - # - # @param occurred_at [Time] - # - # @param type [Symbol, XTwitterScraper::Models::EventRetrieveResponse::Type] - # - # @param username [String] - # - # @param x_event_id [String] - - # @see XTwitterScraper::Models::EventRetrieveResponse#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/event_type.rb b/lib/x_twitter_scraper/models/event_type.rb index 7ca187b..05de66d 100644 --- a/lib/x_twitter_scraper/models/event_type.rb +++ b/lib/x_twitter_scraper/models/event_type.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # Type of monitor event fired when account activity occurs. module EventType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb b/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb index fceb8ca..9e89691 100644 --- a/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +++ b/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb @@ -8,6 +8,7 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute tool_type + # Identifier for the extraction tool used to run a job. # # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] required :tool_type, @@ -15,19 +16,19 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel api_name: :toolType # @!attribute advanced_query - # Raw advanced search query appended as-is (tweet_search_extractor) + # Raw advanced query string appended to the estimate (tweet_search_extractor) # # @return [String, nil] optional :advanced_query, String, api_name: :advancedQuery # @!attribute exact_phrase - # Exact phrase to match (tweet_search_extractor) + # Exact phrase filter for search estimation # # @return [String, nil] optional :exact_phrase, String, api_name: :exactPhrase # @!attribute exclude_words - # Words to exclude from results (tweet_search_extractor) + # Words excluded from estimated search results # # @return [String, nil] optional :exclude_words, String, api_name: :excludeWords @@ -63,13 +64,13 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel optional :target_username, String, api_name: :targetUsername # @!method initialize(tool_type:, advanced_query: nil, exact_phrase: nil, exclude_words: nil, search_query: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, request_options: {}) - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] Identifier for the extraction tool used to run a job. # - # @param advanced_query [String] Raw advanced search query appended as-is (tweet_search_extractor) + # @param advanced_query [String] Raw advanced query string appended to the estimate (tweet_search_extractor) # - # @param exact_phrase [String] Exact phrase to match (tweet_search_extractor) + # @param exact_phrase [String] Exact phrase filter for search estimation # - # @param exclude_words [String] Words to exclude from results (tweet_search_extractor) + # @param exclude_words [String] Words excluded from estimated search results # # @param search_query [String] # @@ -85,6 +86,7 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_export_results_params.rb b/lib/x_twitter_scraper/models/extraction_export_results_params.rb index f7b8b44..4b0ac77 100644 --- a/lib/x_twitter_scraper/models/extraction_export_results_params.rb +++ b/lib/x_twitter_scraper/models/extraction_export_results_params.rb @@ -13,15 +13,19 @@ class ExtractionExportResultsParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute format_ + # Export file format # # @return [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format, nil] optional :format_, enum: -> { XTwitterScraper::ExtractionExportResultsParams::Format } # @!method initialize(id:, format_: nil, request_options: {}) # @param id [String] - # @param format_ [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] + # + # @param format_ [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] Export file format + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Export file format module Format extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_job.rb b/lib/x_twitter_scraper/models/extraction_job.rb index 7015b46..f899fe0 100644 --- a/lib/x_twitter_scraper/models/extraction_job.rb +++ b/lib/x_twitter_scraper/models/extraction_job.rb @@ -19,6 +19,7 @@ class ExtractionJob < XTwitterScraper::Internal::Type::BaseModel required :status, enum: -> { XTwitterScraper::ExtractionJob::Status } # @!attribute tool_type + # Identifier for the extraction tool used to run a job. # # @return [Symbol, XTwitterScraper::Models::ExtractionJob::ToolType] required :tool_type, enum: -> { XTwitterScraper::ExtractionJob::ToolType }, api_name: :toolType @@ -34,11 +35,18 @@ class ExtractionJob < XTwitterScraper::Internal::Type::BaseModel optional :completed_at, Time, api_name: :completedAt # @!method initialize(id:, created_at:, status:, tool_type:, total_results:, completed_at: nil) + # Extraction job tracking status, tool type, and result count. + # # @param id [String] + # # @param created_at [Time] + # # @param status [Symbol, XTwitterScraper::Models::ExtractionJob::Status] - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionJob::ToolType] + # + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionJob::ToolType] Identifier for the extraction tool used to run a job. + # # @param total_results [Integer] + # # @param completed_at [Time] # @see XTwitterScraper::Models::ExtractionJob#status @@ -53,6 +61,8 @@ module Status # @return [Array] end + # Identifier for the extraction tool used to run a job. + # # @see XTwitterScraper::Models::ExtractionJob#tool_type module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_list_params.rb b/lib/x_twitter_scraper/models/extraction_list_params.rb index d81be77..940f521 100644 --- a/lib/x_twitter_scraper/models/extraction_list_params.rb +++ b/lib/x_twitter_scraper/models/extraction_list_params.rb @@ -8,37 +8,41 @@ class ExtractionListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute after - # Cursor for pagination + # Cursor for keyset pagination # # @return [String, nil] optional :after, String # @!attribute limit + # Maximum number of items to return (1-100, default 50) # # @return [Integer, nil] optional :limit, Integer # @!attribute status + # Filter by job status # # @return [Symbol, XTwitterScraper::Models::ExtractionListParams::Status, nil] optional :status, enum: -> { XTwitterScraper::ExtractionListParams::Status } # @!attribute tool_type + # Filter by extraction tool type # # @return [Symbol, XTwitterScraper::Models::ExtractionListParams::ToolType, nil] optional :tool_type, enum: -> { XTwitterScraper::ExtractionListParams::ToolType } # @!method initialize(after: nil, limit: nil, status: nil, tool_type: nil, request_options: {}) - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # - # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] + # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] Filter by job status # - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionListParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionListParams::ToolType] Filter by extraction tool type # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Filter by job status module Status extend XTwitterScraper::Internal::Type::Enum @@ -50,6 +54,7 @@ module Status # @return [Array] end + # Filter by extraction tool type module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_list_response.rb b/lib/x_twitter_scraper/models/extraction_list_response.rb index 7b780a9..456eb3a 100644 --- a/lib/x_twitter_scraper/models/extraction_list_response.rb +++ b/lib/x_twitter_scraper/models/extraction_list_response.rb @@ -6,9 +6,8 @@ module Models class ExtractionListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute extractions # - # @return [Array] - required :extractions, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::ExtractionListResponse::Extraction] } + # @return [Array] + required :extractions, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::ExtractionJob] } # @!attribute has_more # @@ -21,92 +20,9 @@ class ExtractionListResponse < XTwitterScraper::Internal::Type::BaseModel optional :next_cursor, String, api_name: :nextCursor # @!method initialize(extractions:, has_more:, next_cursor: nil) - # @param extractions [Array] + # @param extractions [Array] # @param has_more [Boolean] # @param next_cursor [String] - - class Extraction < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [Symbol, XTwitterScraper::Models::ExtractionListResponse::Extraction::Status] - required :status, enum: -> { XTwitterScraper::Models::ExtractionListResponse::Extraction::Status } - - # @!attribute tool_type - # - # @return [Symbol, XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType] - required :tool_type, - enum: -> { XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType }, - api_name: :toolType - - # @!attribute total_results - # - # @return [Integer] - required :total_results, Integer, api_name: :totalResults - - # @!attribute completed_at - # - # @return [Time, nil] - optional :completed_at, Time, api_name: :completedAt - - # @!method initialize(id:, created_at:, status:, tool_type:, total_results:, completed_at: nil) - # @param id [String] - # @param created_at [Time] - # @param status [Symbol, XTwitterScraper::Models::ExtractionListResponse::Extraction::Status] - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType] - # @param total_results [Integer] - # @param completed_at [Time] - - # @see XTwitterScraper::Models::ExtractionListResponse::Extraction#status - module Status - extend XTwitterScraper::Internal::Type::Enum - - RUNNING = :running - COMPLETED = :completed - FAILED = :failed - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::ExtractionListResponse::Extraction#tool_type - module ToolType - extend XTwitterScraper::Internal::Type::Enum - - ARTICLE_EXTRACTOR = :article_extractor - COMMUNITY_EXTRACTOR = :community_extractor - COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer - COMMUNITY_POST_EXTRACTOR = :community_post_extractor - COMMUNITY_SEARCH = :community_search - FOLLOWER_EXPLORER = :follower_explorer - FOLLOWING_EXPLORER = :following_explorer - LIST_FOLLOWER_EXPLORER = :list_follower_explorer - LIST_MEMBER_EXTRACTOR = :list_member_extractor - LIST_POST_EXTRACTOR = :list_post_extractor - MENTION_EXTRACTOR = :mention_extractor - PEOPLE_SEARCH = :people_search - POST_EXTRACTOR = :post_extractor - QUOTE_EXTRACTOR = :quote_extractor - REPLY_EXTRACTOR = :reply_extractor - REPOST_EXTRACTOR = :repost_extractor - SPACE_EXPLORER = :space_explorer - THREAD_EXTRACTOR = :thread_extractor - TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor - VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/x_twitter_scraper/models/extraction_retrieve_params.rb b/lib/x_twitter_scraper/models/extraction_retrieve_params.rb index e05d31a..c0fdd21 100644 --- a/lib/x_twitter_scraper/models/extraction_retrieve_params.rb +++ b/lib/x_twitter_scraper/models/extraction_retrieve_params.rb @@ -13,12 +13,13 @@ class ExtractionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute after - # Cursor for pagination + # Cursor for keyset pagination # # @return [String, nil] optional :after, String # @!attribute limit + # Maximum number of results to return (1-1000, default 100) # # @return [Integer, nil] optional :limit, Integer @@ -26,9 +27,9 @@ class ExtractionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, after: nil, limit: nil, request_options: {}) # @param id [String] # - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of results to return (1-1000, default 100) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/extraction_run_params.rb b/lib/x_twitter_scraper/models/extraction_run_params.rb index 0c24e34..9026fbf 100644 --- a/lib/x_twitter_scraper/models/extraction_run_params.rb +++ b/lib/x_twitter_scraper/models/extraction_run_params.rb @@ -8,6 +8,7 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute tool_type + # Identifier for the extraction tool used to run a job. # # @return [Symbol, XTwitterScraper::Models::ExtractionRunParams::ToolType] required :tool_type, enum: -> { XTwitterScraper::ExtractionRunParams::ToolType }, api_name: :toolType @@ -61,7 +62,7 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel optional :target_username, String, api_name: :targetUsername # @!method initialize(tool_type:, advanced_query: nil, exact_phrase: nil, exclude_words: nil, search_query: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, request_options: {}) - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::ToolType] Identifier for the extraction tool used to run a job. # # @param advanced_query [String] Raw advanced search query appended as-is (tweet_search_extractor) # @@ -83,6 +84,7 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/extraction_run_response.rb b/lib/x_twitter_scraper/models/extraction_run_response.rb index b56aa38..c5b10c6 100644 --- a/lib/x_twitter_scraper/models/extraction_run_response.rb +++ b/lib/x_twitter_scraper/models/extraction_run_response.rb @@ -11,31 +11,26 @@ class ExtractionRunResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute status # - # @return [Symbol, XTwitterScraper::Models::ExtractionRunResponse::Status] - required :status, enum: -> { XTwitterScraper::Models::ExtractionRunResponse::Status } + # @return [Symbol, :running] + required :status, const: :running # @!attribute tool_type + # Identifier for the extraction tool used to run a job. # # @return [Symbol, XTwitterScraper::Models::ExtractionRunResponse::ToolType] required :tool_type, enum: -> { XTwitterScraper::Models::ExtractionRunResponse::ToolType }, api_name: :toolType - # @!method initialize(id:, status:, tool_type:) + # @!method initialize(id:, tool_type:, status: :running) # @param id [String] - # @param status [Symbol, XTwitterScraper::Models::ExtractionRunResponse::Status] - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunResponse::ToolType] - - # @see XTwitterScraper::Models::ExtractionRunResponse#status - module Status - extend XTwitterScraper::Internal::Type::Enum - - RUNNING = :running - - # @!method self.values - # @return [Array] - end + # + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunResponse::ToolType] Identifier for the extraction tool used to run a job. + # + # @param status [Symbol, :running] + # Identifier for the extraction tool used to run a job. + # # @see XTwitterScraper::Models::ExtractionRunResponse#tool_type module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/integration.rb b/lib/x_twitter_scraper/models/integration.rb index ab6ff49..d85d985 100644 --- a/lib/x_twitter_scraper/models/integration.rb +++ b/lib/x_twitter_scraper/models/integration.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Integrations#create class Integration < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -20,10 +21,11 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Integration::EventType] }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute is_active @@ -38,8 +40,8 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel # @!attribute type # - # @return [Symbol, XTwitterScraper::Models::Integration::Type] - required :type, enum: -> { XTwitterScraper::Integration::Type } + # @return [Symbol, :telegram] + required :type, const: :telegram # @!attribute filters # Event filter rules (JSON) @@ -62,21 +64,21 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :silent_push, XTwitterScraper::Internal::Type::Boolean, api_name: :silentPush - # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) + # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil, type: :telegram) + # Third-party integration (e.g. Telegram) subscribed to monitor events. + # # @param id [String] # # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) # # @param created_at [Time] # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param is_active [Boolean] # # @param name [String] # - # @param type [Symbol, XTwitterScraper::Models::Integration::Type] - # # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) # # @param message_template [String] @@ -84,30 +86,8 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel # @param scope_all_monitors [Boolean] # # @param silent_push [Boolean] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::Integration#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end + # + # @param type [Symbol, :telegram] end end end diff --git a/lib/x_twitter_scraper/models/integration_create_params.rb b/lib/x_twitter_scraper/models/integration_create_params.rb index 529ebe9..514dbd2 100644 --- a/lib/x_twitter_scraper/models/integration_create_params.rb +++ b/lib/x_twitter_scraper/models/integration_create_params.rb @@ -14,12 +14,11 @@ class IntegrationCreateParams < XTwitterScraper::Internal::Type::BaseModel required :config, -> { XTwitterScraper::IntegrationCreateParams::Config } # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::IntegrationCreateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute name @@ -29,17 +28,17 @@ class IntegrationCreateParams < XTwitterScraper::Internal::Type::BaseModel # @!attribute type # - # @return [Symbol, XTwitterScraper::Models::IntegrationCreateParams::Type] - required :type, enum: -> { XTwitterScraper::IntegrationCreateParams::Type } + # @return [Symbol, :telegram] + required :type, const: :telegram - # @!method initialize(config:, event_types:, name:, type:, request_options: {}) + # @!method initialize(config:, event_types:, name:, type: :telegram, request_options: {}) # @param config [XTwitterScraper::Models::IntegrationCreateParams::Config] Integration config (e.g. Telegram chatId) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param name [String] # - # @param type [Symbol, XTwitterScraper::Models::IntegrationCreateParams::Type] + # @param type [Symbol, :telegram] # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] @@ -54,29 +53,6 @@ class Config < XTwitterScraper::Internal::Type::BaseModel # # @param chat_id [String] end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/integration_create_response.rb b/lib/x_twitter_scraper/models/integration_create_response.rb deleted file mode 100644 index 163ca88..0000000 --- a/lib/x_twitter_scraper/models/integration_create_response.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#create - class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute config - # Integration config — shape varies by type (JSON) - # - # @return [Hash{Symbol=>Object}] - required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationCreateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::IntegrationCreateResponse::Type] - required :type, enum: -> { XTwitterScraper::Models::IntegrationCreateResponse::Type } - - # @!attribute filters - # Event filter rules (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute message_template - # - # @return [String, nil] - optional :message_template, String, api_name: :messageTemplate - - # @!attribute scope_all_monitors - # - # @return [Boolean, nil] - optional :scope_all_monitors, XTwitterScraper::Internal::Type::Boolean, api_name: :scopeAllMonitors - - # @!attribute silent_push - # - # @return [Boolean, nil] - optional :silent_push, XTwitterScraper::Internal::Type::Boolean, api_name: :silentPush - - # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) - # @param id [String] - # - # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) - # - # @param created_at [Time] - # - # @param event_types [Array] - # - # @param is_active [Boolean] - # - # @param name [String] - # - # @param type [Symbol, XTwitterScraper::Models::IntegrationCreateResponse::Type] - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param message_template [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::IntegrationCreateResponse#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_delivery.rb b/lib/x_twitter_scraper/models/integration_delivery.rb index 7745a29..57a428f 100644 --- a/lib/x_twitter_scraper/models/integration_delivery.rb +++ b/lib/x_twitter_scraper/models/integration_delivery.rb @@ -54,6 +54,8 @@ class IntegrationDelivery < XTwitterScraper::Internal::Type::BaseModel optional :source_type, String, api_name: :sourceType # @!method initialize(id:, attempts:, created_at:, event_type:, status:, delivered_at: nil, last_error: nil, last_status_code: nil, source_id: nil, source_type: nil) + # Integration delivery attempt record with status and retry count. + # # @param id [String] # @param attempts [Integer] # @param created_at [Time] diff --git a/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb b/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb index 481c79f..ddf885e 100644 --- a/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb +++ b/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb @@ -13,13 +13,16 @@ class IntegrationListDeliveriesParams < XTwitterScraper::Internal::Type::BaseMod required :id, String # @!attribute limit + # Maximum number of items to return (1-100, default 50) # # @return [Integer, nil] optional :limit, Integer # @!method initialize(id:, limit: nil, request_options: {}) # @param id [String] - # @param limit [Integer] + # + # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/integration_list_deliveries_response.rb b/lib/x_twitter_scraper/models/integration_list_deliveries_response.rb index e8d21e1..529e3ec 100644 --- a/lib/x_twitter_scraper/models/integration_list_deliveries_response.rb +++ b/lib/x_twitter_scraper/models/integration_list_deliveries_response.rb @@ -6,76 +6,12 @@ module Models class IntegrationListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute deliveries # - # @return [Array] + # @return [Array] required :deliveries, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery] } + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::IntegrationDelivery] } # @!method initialize(deliveries:) - # @param deliveries [Array] - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute attempts - # - # @return [Integer] - required :attempts, Integer - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_type - # - # @return [String] - required :event_type, String, api_name: :eventType - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute delivered_at - # - # @return [Time, nil] - optional :delivered_at, Time, api_name: :deliveredAt - - # @!attribute last_error - # - # @return [String, nil] - optional :last_error, String, api_name: :lastError - - # @!attribute last_status_code - # - # @return [Integer, nil] - optional :last_status_code, Integer, api_name: :lastStatusCode - - # @!attribute source_id - # - # @return [String, nil] - optional :source_id, String, api_name: :sourceId - - # @!attribute source_type - # - # @return [String, nil] - optional :source_type, String, api_name: :sourceType - - # @!method initialize(id:, attempts:, created_at:, event_type:, status:, delivered_at: nil, last_error: nil, last_status_code: nil, source_id: nil, source_type: nil) - # @param id [String] - # @param attempts [Integer] - # @param created_at [Time] - # @param event_type [String] - # @param status [String] - # @param delivered_at [Time] - # @param last_error [String] - # @param last_status_code [Integer] - # @param source_id [String] - # @param source_type [String] - end + # @param deliveries [Array] end end end diff --git a/lib/x_twitter_scraper/models/integration_list_response.rb b/lib/x_twitter_scraper/models/integration_list_response.rb index 1c79c68..13f3155 100644 --- a/lib/x_twitter_scraper/models/integration_list_response.rb +++ b/lib/x_twitter_scraper/models/integration_list_response.rb @@ -6,120 +6,11 @@ module Models class IntegrationListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute integrations # - # @return [Array] - required :integrations, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::IntegrationListResponse::Integration] } + # @return [Array] + required :integrations, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Integration] } # @!method initialize(integrations:) - # @param integrations [Array] - - class Integration < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute config - # Integration config — shape varies by type (JSON) - # - # @return [Hash{Symbol=>Object}] - required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationListResponse::Integration::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::IntegrationListResponse::Integration::Type] - required :type, enum: -> { XTwitterScraper::Models::IntegrationListResponse::Integration::Type } - - # @!attribute filters - # Event filter rules (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute message_template - # - # @return [String, nil] - optional :message_template, String, api_name: :messageTemplate - - # @!attribute scope_all_monitors - # - # @return [Boolean, nil] - optional :scope_all_monitors, XTwitterScraper::Internal::Type::Boolean, api_name: :scopeAllMonitors - - # @!attribute silent_push - # - # @return [Boolean, nil] - optional :silent_push, XTwitterScraper::Internal::Type::Boolean, api_name: :silentPush - - # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) - # @param id [String] - # - # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) - # - # @param created_at [Time] - # - # @param event_types [Array] - # - # @param is_active [Boolean] - # - # @param name [String] - # - # @param type [Symbol, XTwitterScraper::Models::IntegrationListResponse::Integration::Type] - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param message_template [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::IntegrationListResponse::Integration#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end - end + # @param integrations [Array] end end end diff --git a/lib/x_twitter_scraper/models/integration_retrieve_response.rb b/lib/x_twitter_scraper/models/integration_retrieve_response.rb deleted file mode 100644 index 25ef1dc..0000000 --- a/lib/x_twitter_scraper/models/integration_retrieve_response.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#retrieve - class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute config - # Integration config — shape varies by type (JSON) - # - # @return [Hash{Symbol=>Object}] - required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationRetrieveResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::IntegrationRetrieveResponse::Type] - required :type, enum: -> { XTwitterScraper::Models::IntegrationRetrieveResponse::Type } - - # @!attribute filters - # Event filter rules (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute message_template - # - # @return [String, nil] - optional :message_template, String, api_name: :messageTemplate - - # @!attribute scope_all_monitors - # - # @return [Boolean, nil] - optional :scope_all_monitors, XTwitterScraper::Internal::Type::Boolean, api_name: :scopeAllMonitors - - # @!attribute silent_push - # - # @return [Boolean, nil] - optional :silent_push, XTwitterScraper::Internal::Type::Boolean, api_name: :silentPush - - # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) - # @param id [String] - # - # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) - # - # @param created_at [Time] - # - # @param event_types [Array] - # - # @param is_active [Boolean] - # - # @param name [String] - # - # @param type [Symbol, XTwitterScraper::Models::IntegrationRetrieveResponse::Type] - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param message_template [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::IntegrationRetrieveResponse#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_update_params.rb b/lib/x_twitter_scraper/models/integration_update_params.rb index 736a455..1f41337 100644 --- a/lib/x_twitter_scraper/models/integration_update_params.rb +++ b/lib/x_twitter_scraper/models/integration_update_params.rb @@ -13,12 +13,11 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array, nil] + # @return [Array, nil] optional :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::IntegrationUpdateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute filters @@ -58,7 +57,7 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, event_types: nil, filters: nil, is_active: nil, message_template: nil, name: nil, scope_all_monitors: nil, silent_push: nil, request_options: {}) # @param id [String] # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) # @@ -73,20 +72,6 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @param silent_push [Boolean] # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/integration_update_response.rb b/lib/x_twitter_scraper/models/integration_update_response.rb deleted file mode 100644 index e8a2723..0000000 --- a/lib/x_twitter_scraper/models/integration_update_response.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#update - class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute config - # Integration config — shape varies by type (JSON) - # - # @return [Hash{Symbol=>Object}] - required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationUpdateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute type - # - # @return [Symbol, XTwitterScraper::Models::IntegrationUpdateResponse::Type] - required :type, enum: -> { XTwitterScraper::Models::IntegrationUpdateResponse::Type } - - # @!attribute filters - # Event filter rules (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute message_template - # - # @return [String, nil] - optional :message_template, String, api_name: :messageTemplate - - # @!attribute scope_all_monitors - # - # @return [Boolean, nil] - optional :scope_all_monitors, XTwitterScraper::Internal::Type::Boolean, api_name: :scopeAllMonitors - - # @!attribute silent_push - # - # @return [Boolean, nil] - optional :silent_push, XTwitterScraper::Internal::Type::Boolean, api_name: :silentPush - - # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) - # @param id [String] - # - # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) - # - # @param created_at [Time] - # - # @param event_types [Array] - # - # @param is_active [Boolean] - # - # @param name [String] - # - # @param type [Symbol, XTwitterScraper::Models::IntegrationUpdateResponse::Type] - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param message_template [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::IntegrationUpdateResponse#type - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM = :telegram - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/monitor.rb b/lib/x_twitter_scraper/models/monitor.rb index a29cdf1..6bb73e8 100644 --- a/lib/x_twitter_scraper/models/monitor.rb +++ b/lib/x_twitter_scraper/models/monitor.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Monitors#retrieve class Monitor < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -14,10 +15,11 @@ class Monitor < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Monitor::EventType] }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute is_active @@ -36,26 +38,19 @@ class Monitor < XTwitterScraper::Internal::Type::BaseModel required :x_user_id, String, api_name: :xUserId # @!method initialize(id:, created_at:, event_types:, is_active:, username:, x_user_id:) + # Account monitor that tracks activity for a given X user. + # # @param id [String] + # # @param created_at [Time] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param is_active [Boolean] + # # @param username [String] + # # @param x_user_id [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/monitor_create_params.rb b/lib/x_twitter_scraper/models/monitor_create_params.rb index b5bc254..45a6cfa 100644 --- a/lib/x_twitter_scraper/models/monitor_create_params.rb +++ b/lib/x_twitter_scraper/models/monitor_create_params.rb @@ -8,12 +8,11 @@ class MonitorCreateParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::MonitorCreateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute username @@ -23,25 +22,11 @@ class MonitorCreateParams < XTwitterScraper::Internal::Type::BaseModel required :username, String # @!method initialize(event_types:, username:, request_options: {}) - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param username [String] X username (without @) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/monitor_create_response.rb b/lib/x_twitter_scraper/models/monitor_create_response.rb index 70afcbb..0545213 100644 --- a/lib/x_twitter_scraper/models/monitor_create_response.rb +++ b/lib/x_twitter_scraper/models/monitor_create_response.rb @@ -15,10 +15,11 @@ class MonitorCreateResponse < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorCreateResponse::EventType] }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute username @@ -33,24 +34,14 @@ class MonitorCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, created_at:, event_types:, username:, x_user_id:) # @param id [String] + # # @param created_at [Time] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param username [String] + # # @param x_user_id [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/monitor_list_response.rb b/lib/x_twitter_scraper/models/monitor_list_response.rb index c66b58f..ed8c8d9 100644 --- a/lib/x_twitter_scraper/models/monitor_list_response.rb +++ b/lib/x_twitter_scraper/models/monitor_list_response.rb @@ -6,9 +6,8 @@ module Models class MonitorListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute monitors # - # @return [Array] - required :monitors, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::MonitorListResponse::Monitor] } + # @return [Array] + required :monitors, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Monitor] } # @!attribute total # @@ -16,64 +15,8 @@ class MonitorListResponse < XTwitterScraper::Internal::Type::BaseModel required :total, Integer # @!method initialize(monitors:, total:) - # @param monitors [Array] + # @param monitors [Array] # @param total [Integer] - - class Monitor < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorListResponse::Monitor::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute x_user_id - # - # @return [String] - required :x_user_id, String, api_name: :xUserId - - # @!method initialize(id:, created_at:, event_types:, is_active:, username:, x_user_id:) - # @param id [String] - # @param created_at [Time] - # @param event_types [Array] - # @param is_active [Boolean] - # @param username [String] - # @param x_user_id [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/x_twitter_scraper/models/monitor_retrieve_response.rb b/lib/x_twitter_scraper/models/monitor_retrieve_response.rb deleted file mode 100644 index f05d572..0000000 --- a/lib/x_twitter_scraper/models/monitor_retrieve_response.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Monitors#retrieve - class MonitorRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorRetrieveResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute x_user_id - # - # @return [String] - required :x_user_id, String, api_name: :xUserId - - # @!method initialize(id:, created_at:, event_types:, is_active:, username:, x_user_id:) - # @param id [String] - # @param created_at [Time] - # @param event_types [Array] - # @param is_active [Boolean] - # @param username [String] - # @param x_user_id [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/monitor_update_params.rb b/lib/x_twitter_scraper/models/monitor_update_params.rb index 978dd11..1ddf286 100644 --- a/lib/x_twitter_scraper/models/monitor_update_params.rb +++ b/lib/x_twitter_scraper/models/monitor_update_params.rb @@ -13,12 +13,11 @@ class MonitorUpdateParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array, nil] + # @return [Array, nil] optional :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::MonitorUpdateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute is_active @@ -28,23 +27,12 @@ class MonitorUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, event_types: nil, is_active: nil, request_options: {}) # @param id [String] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param is_active [Boolean] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/monitor_update_response.rb b/lib/x_twitter_scraper/models/monitor_update_response.rb deleted file mode 100644 index bf5e0c2..0000000 --- a/lib/x_twitter_scraper/models/monitor_update_response.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Monitors#update - class MonitorUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorUpdateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute x_user_id - # - # @return [String] - required :x_user_id, String, api_name: :xUserId - - # @!method initialize(id:, created_at:, event_types:, is_active:, username:, x_user_id:) - # @param id [String] - # @param created_at [Time] - # @param event_types [Array] - # @param is_active [Boolean] - # @param username [String] - # @param x_user_id [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/paginated_tweets.rb b/lib/x_twitter_scraper/models/paginated_tweets.rb index 8471541..2cff003 100644 --- a/lib/x_twitter_scraper/models/paginated_tweets.rb +++ b/lib/x_twitter_scraper/models/paginated_tweets.rb @@ -15,106 +15,15 @@ class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel # @!attribute tweets # - # @return [Array] - required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::PaginatedTweets::Tweet] } + # @return [Array] + required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet] } # @!method initialize(has_next_page:, next_cursor:, tweets:) + # Paginated list of tweets with cursor-based navigation. + # # @param has_next_page [Boolean] # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::PaginatedTweets::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::PaginatedTweets::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::PaginatedTweets::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::PaginatedTweets::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end + # @param tweets [Array] end end end diff --git a/lib/x_twitter_scraper/models/paginated_users.rb b/lib/x_twitter_scraper/models/paginated_users.rb index 8b8976f..4efadd6 100644 --- a/lib/x_twitter_scraper/models/paginated_users.rb +++ b/lib/x_twitter_scraper/models/paginated_users.rb @@ -15,83 +15,15 @@ class PaginatedUsers < XTwitterScraper::Internal::Type::BaseModel # @!attribute users # - # @return [Array] - required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::PaginatedUsers::User] } + # @return [Array] + required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile] } # @!method initialize(has_next_page:, next_cursor:, users:) + # Paginated list of user profiles with cursor-based navigation. + # # @param has_next_page [Boolean] # @param next_cursor [String] - # @param users [Array] - - class User < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute followers - # - # @return [Integer, nil] - optional :followers, Integer - - # @!attribute following - # - # @return [Integer, nil] - optional :following, Integer - - # @!attribute location - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!attribute statuses_count - # - # @return [Integer, nil] - optional :statuses_count, Integer, api_name: :statusesCount - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param created_at [String] - # @param description [String] - # @param followers [Integer] - # @param following [Integer] - # @param location [String] - # @param profile_picture [String] - # @param statuses_count [Integer] - # @param verified [Boolean] - end + # @param users [Array] end end end diff --git a/lib/x_twitter_scraper/models/radar_item.rb b/lib/x_twitter_scraper/models/radar_item.rb index 45c3e43..4509867 100644 --- a/lib/x_twitter_scraper/models/radar_item.rb +++ b/lib/x_twitter_scraper/models/radar_item.rb @@ -49,6 +49,8 @@ class RadarItem < XTwitterScraper::Internal::Type::BaseModel optional :url, String # @!method initialize(category:, published_at:, region:, score:, source:, title:, description: nil, image_url: nil, url: nil) + # Trending topic with score, category, source, and region. + # # @param category [String] # @param published_at [Time] # @param region [String] diff --git a/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rb b/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rb index 001b544..8f22c9c 100644 --- a/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rb +++ b/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rb @@ -35,8 +35,8 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia # - # @return [String, nil] - optional :source, String + # @return [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Source, nil] + optional :source, enum: -> { XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source } # @!method initialize(category: nil, count: nil, hours: nil, region: nil, source: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -50,9 +50,26 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM # # @param region [String] Region filter (us, global, etc.) # - # @param source [String] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t + # @param source [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Source] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, + # trustmrr, wikipedia + module Source + extend XTwitterScraper::Internal::Type::Enum + + GITHUB = :github + GOOGLE_TRENDS = :google_trends + HACKER_NEWS = :hacker_news + POLYMARKET = :polymarket + REDDIT = :reddit + TRUSTMRR = :trustmrr + WIKIPEDIA = :wikipedia + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rb b/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rb index 0828e7c..d37de6e 100644 --- a/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rb +++ b/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rb @@ -6,9 +6,8 @@ module Models class RadarRetrieveTrendingTopicsResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute items # - # @return [Array] - required :items, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item] } + # @return [Array] + required :items, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::RadarItem] } # @!attribute total # @@ -16,66 +15,8 @@ class RadarRetrieveTrendingTopicsResponse < XTwitterScraper::Internal::Type::Bas required :total, Integer # @!method initialize(items:, total:) - # @param items [Array] + # @param items [Array] # @param total [Integer] - - class Item < XTwitterScraper::Internal::Type::BaseModel - # @!attribute category - # - # @return [String] - required :category, String - - # @!attribute published_at - # - # @return [Time] - required :published_at, Time, api_name: :publishedAt - - # @!attribute region - # - # @return [String] - required :region, String - - # @!attribute score - # - # @return [Float] - required :score, Float - - # @!attribute source - # - # @return [String] - required :source, String - - # @!attribute title - # - # @return [String] - required :title, String - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute image_url - # - # @return [String, nil] - optional :image_url, String, api_name: :imageUrl - - # @!attribute url - # - # @return [String, nil] - optional :url, String - - # @!method initialize(category:, published_at:, region:, score:, source:, title:, description: nil, image_url: nil, url: nil) - # @param category [String] - # @param published_at [Time] - # @param region [String] - # @param score [Float] - # @param source [String] - # @param title [String] - # @param description [String] - # @param image_url [String] - # @param url [String] - end end end end diff --git a/lib/x_twitter_scraper/models/style_analyze_response.rb b/lib/x_twitter_scraper/models/style_analyze_response.rb deleted file mode 100644 index 24acdde..0000000 --- a/lib/x_twitter_scraper/models/style_analyze_response.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Styles#analyze - class StyleAnalyzeResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet] } - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param tweets [Array] - # @param x_username [String] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author_username - # - # @return [String, nil] - optional :author_username, String, api_name: :authorUsername - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, text:, author_username: nil, created_at: nil) - # @param id [String] - # @param text [String] - # @param author_username [String] - # @param created_at [String] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/style_compare_response.rb b/lib/x_twitter_scraper/models/style_compare_response.rb index 2c1d28f..c2b7b4d 100644 --- a/lib/x_twitter_scraper/models/style_compare_response.rb +++ b/lib/x_twitter_scraper/models/style_compare_response.rb @@ -5,146 +5,21 @@ module Models # @see XTwitterScraper::Resources::Styles#compare class StyleCompareResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute style1 + # Full style profile with sampled tweets used for tone analysis. # - # @return [XTwitterScraper::Models::StyleCompareResponse::Style1] - required :style1, -> { XTwitterScraper::Models::StyleCompareResponse::Style1 } + # @return [XTwitterScraper::Models::StyleProfile] + required :style1, -> { XTwitterScraper::StyleProfile } # @!attribute style2 + # Full style profile with sampled tweets used for tone analysis. # - # @return [XTwitterScraper::Models::StyleCompareResponse::Style2] - required :style2, -> { XTwitterScraper::Models::StyleCompareResponse::Style2 } + # @return [XTwitterScraper::Models::StyleProfile] + required :style2, -> { XTwitterScraper::StyleProfile } # @!method initialize(style1:, style2:) - # @param style1 [XTwitterScraper::Models::StyleCompareResponse::Style1] - # @param style2 [XTwitterScraper::Models::StyleCompareResponse::Style2] - - # @see XTwitterScraper::Models::StyleCompareResponse#style1 - class Style1 < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet] } - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param tweets [Array] - # @param x_username [String] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author_username - # - # @return [String, nil] - optional :author_username, String, api_name: :authorUsername - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, text:, author_username: nil, created_at: nil) - # @param id [String] - # @param text [String] - # @param author_username [String] - # @param created_at [String] - end - end - - # @see XTwitterScraper::Models::StyleCompareResponse#style2 - class Style2 < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet] } - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param tweets [Array] - # @param x_username [String] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author_username - # - # @return [String, nil] - optional :author_username, String, api_name: :authorUsername - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, text:, author_username: nil, created_at: nil) - # @param id [String] - # @param text [String] - # @param author_username [String] - # @param created_at [String] - end - end + # @param style1 [XTwitterScraper::Models::StyleProfile] Full style profile with sampled tweets used for tone analysis. + # + # @param style2 [XTwitterScraper::Models::StyleProfile] Full style profile with sampled tweets used for tone analysis. end end end diff --git a/lib/x_twitter_scraper/models/style_delete_params.rb b/lib/x_twitter_scraper/models/style_delete_params.rb index 1c7df5e..3fd6408 100644 --- a/lib/x_twitter_scraper/models/style_delete_params.rb +++ b/lib/x_twitter_scraper/models/style_delete_params.rb @@ -7,13 +7,13 @@ class StyleDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute username + # @!attribute id # # @return [String] - required :username, String + required :id, String - # @!method initialize(username:, request_options: {}) - # @param username [String] + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/style_get_performance_params.rb b/lib/x_twitter_scraper/models/style_get_performance_params.rb index 4a6a9f0..f792f50 100644 --- a/lib/x_twitter_scraper/models/style_get_performance_params.rb +++ b/lib/x_twitter_scraper/models/style_get_performance_params.rb @@ -7,13 +7,13 @@ class StyleGetPerformanceParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute username + # @!attribute id # # @return [String] - required :username, String + required :id, String - # @!method initialize(username:, request_options: {}) - # @param username [String] + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/style_list_response.rb b/lib/x_twitter_scraper/models/style_list_response.rb index 63f3656..738931b 100644 --- a/lib/x_twitter_scraper/models/style_list_response.rb +++ b/lib/x_twitter_scraper/models/style_list_response.rb @@ -6,40 +6,11 @@ module Models class StyleListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute styles # - # @return [Array] - required :styles, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleListResponse::Style] } + # @return [Array] + required :styles, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleProfileSummary] } # @!method initialize(styles:) - # @param styles [Array] - - class Style < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param x_username [String] - end + # @param styles [Array] end end end diff --git a/lib/x_twitter_scraper/models/style_profile.rb b/lib/x_twitter_scraper/models/style_profile.rb index 729ca7f..6c58bac 100644 --- a/lib/x_twitter_scraper/models/style_profile.rb +++ b/lib/x_twitter_scraper/models/style_profile.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Styles#retrieve class StyleProfile < XTwitterScraper::Internal::Type::BaseModel # @!attribute fetched_at # @@ -29,6 +30,8 @@ class StyleProfile < XTwitterScraper::Internal::Type::BaseModel required :x_username, String, api_name: :xUsername # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) + # Full style profile with sampled tweets used for tone analysis. + # # @param fetched_at [Time] # @param is_own_account [Boolean] # @param tweet_count [Integer] diff --git a/lib/x_twitter_scraper/models/style_profile_summary.rb b/lib/x_twitter_scraper/models/style_profile_summary.rb index 0fca962..8e54968 100644 --- a/lib/x_twitter_scraper/models/style_profile_summary.rb +++ b/lib/x_twitter_scraper/models/style_profile_summary.rb @@ -24,6 +24,8 @@ class StyleProfileSummary < XTwitterScraper::Internal::Type::BaseModel required :x_username, String, api_name: :xUsername # @!method initialize(fetched_at:, is_own_account:, tweet_count:, x_username:) + # Style profile summary with tweet count and ownership flag. + # # @param fetched_at [Time] # @param is_own_account [Boolean] # @param tweet_count [Integer] diff --git a/lib/x_twitter_scraper/models/style_retrieve_params.rb b/lib/x_twitter_scraper/models/style_retrieve_params.rb index 0f95c6d..d91eaf7 100644 --- a/lib/x_twitter_scraper/models/style_retrieve_params.rb +++ b/lib/x_twitter_scraper/models/style_retrieve_params.rb @@ -7,13 +7,13 @@ class StyleRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute username + # @!attribute id # # @return [String] - required :username, String + required :id, String - # @!method initialize(username:, request_options: {}) - # @param username [String] + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/style_retrieve_response.rb b/lib/x_twitter_scraper/models/style_retrieve_response.rb deleted file mode 100644 index 148a361..0000000 --- a/lib/x_twitter_scraper/models/style_retrieve_response.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Styles#retrieve - class StyleRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleRetrieveResponse::Tweet] } - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param tweets [Array] - # @param x_username [String] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author_username - # - # @return [String, nil] - optional :author_username, String, api_name: :authorUsername - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, text:, author_username: nil, created_at: nil) - # @param id [String] - # @param text [String] - # @param author_username [String] - # @param created_at [String] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/style_update_params.rb b/lib/x_twitter_scraper/models/style_update_params.rb index 6e92262..89424ac 100644 --- a/lib/x_twitter_scraper/models/style_update_params.rb +++ b/lib/x_twitter_scraper/models/style_update_params.rb @@ -7,10 +7,10 @@ class StyleUpdateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute username + # @!attribute id # # @return [String] - required :username, String + required :id, String # @!attribute label # Display label for the style @@ -25,8 +25,8 @@ class StyleUpdateParams < XTwitterScraper::Internal::Type::BaseModel required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleUpdateParams::Tweet] } - # @!method initialize(username:, label:, tweets:, request_options: {}) - # @param username [String] + # @!method initialize(id:, label:, tweets:, request_options: {}) + # @param id [String] # # @param label [String] Display label for the style # diff --git a/lib/x_twitter_scraper/models/style_update_response.rb b/lib/x_twitter_scraper/models/style_update_response.rb deleted file mode 100644 index ddec7fa..0000000 --- a/lib/x_twitter_scraper/models/style_update_response.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Styles#update - class StyleUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute fetched_at - # - # @return [Time] - required :fetched_at, Time, api_name: :fetchedAt - - # @!attribute is_own_account - # - # @return [Boolean] - required :is_own_account, XTwitterScraper::Internal::Type::Boolean, api_name: :isOwnAccount - - # @!attribute tweet_count - # - # @return [Integer] - required :tweet_count, Integer, api_name: :tweetCount - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleUpdateResponse::Tweet] } - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(fetched_at:, is_own_account:, tweet_count:, tweets:, x_username:) - # @param fetched_at [Time] - # @param is_own_account [Boolean] - # @param tweet_count [Integer] - # @param tweets [Array] - # @param x_username [String] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author_username - # - # @return [String, nil] - optional :author_username, String, api_name: :authorUsername - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, text:, author_username: nil, created_at: nil) - # @param id [String] - # @param text [String] - # @param author_username [String] - # @param created_at [String] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/trend_list_params.rb b/lib/x_twitter_scraper/models/trend_list_params.rb index 6f3e610..7219bed 100644 --- a/lib/x_twitter_scraper/models/trend_list_params.rb +++ b/lib/x_twitter_scraper/models/trend_list_params.rb @@ -8,6 +8,7 @@ class TrendListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute count + # Number of trending topics to return (1-50, default 30) # # @return [Integer, nil] optional :count, Integer @@ -19,7 +20,7 @@ class TrendListParams < XTwitterScraper::Internal::Type::BaseModel optional :woeid, Integer # @!method initialize(count: nil, woeid: nil, request_options: {}) - # @param count [Integer] + # @param count [Integer] Number of trending topics to return (1-50, default 30) # # @param woeid [Integer] Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) # diff --git a/lib/x_twitter_scraper/models/webhook.rb b/lib/x_twitter_scraper/models/webhook.rb index 23cf702..b56312a 100644 --- a/lib/x_twitter_scraper/models/webhook.rb +++ b/lib/x_twitter_scraper/models/webhook.rb @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # @see XTwitterScraper::Resources::Webhooks#update class Webhook < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -14,10 +15,11 @@ class Webhook < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Webhook::EventType] }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute is_active @@ -31,25 +33,17 @@ class Webhook < XTwitterScraper::Internal::Type::BaseModel required :url, String # @!method initialize(id:, created_at:, event_types:, is_active:, url:) + # Webhook endpoint registered to receive event deliveries. + # # @param id [String] + # # @param created_at [Time] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param is_active [Boolean] + # # @param url [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/webhook_create_params.rb b/lib/x_twitter_scraper/models/webhook_create_params.rb index 8589c07..cec3bb7 100644 --- a/lib/x_twitter_scraper/models/webhook_create_params.rb +++ b/lib/x_twitter_scraper/models/webhook_create_params.rb @@ -8,12 +8,11 @@ class WebhookCreateParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::WebhookCreateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute url @@ -23,25 +22,11 @@ class WebhookCreateParams < XTwitterScraper::Internal::Type::BaseModel required :url, String # @!method initialize(event_types:, url:, request_options: {}) - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param url [String] HTTPS URL # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/webhook_create_response.rb b/lib/x_twitter_scraper/models/webhook_create_response.rb index 50b0e3f..b867425 100644 --- a/lib/x_twitter_scraper/models/webhook_create_response.rb +++ b/lib/x_twitter_scraper/models/webhook_create_response.rb @@ -15,10 +15,11 @@ class WebhookCreateResponse < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array] + # @return [Array] required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::WebhookCreateResponse::EventType] }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute secret @@ -33,24 +34,14 @@ class WebhookCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, created_at:, event_types:, secret:, url:) # @param id [String] + # # @param created_at [Time] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param secret [String] + # # @param url [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/webhook_list_deliveries_response.rb b/lib/x_twitter_scraper/models/webhook_list_deliveries_response.rb index 38401e7..f27ff97 100644 --- a/lib/x_twitter_scraper/models/webhook_list_deliveries_response.rb +++ b/lib/x_twitter_scraper/models/webhook_list_deliveries_response.rb @@ -6,64 +6,11 @@ module Models class WebhookListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute deliveries # - # @return [Array] - required :deliveries, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery] } + # @return [Array] + required :deliveries, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Delivery] } # @!method initialize(deliveries:) - # @param deliveries [Array] - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute attempts - # - # @return [Integer] - required :attempts, Integer - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute stream_event_id - # - # @return [String] - required :stream_event_id, String, api_name: :streamEventId - - # @!attribute delivered_at - # - # @return [Time, nil] - optional :delivered_at, Time, api_name: :deliveredAt - - # @!attribute last_error - # - # @return [String, nil] - optional :last_error, String, api_name: :lastError - - # @!attribute last_status_code - # - # @return [Integer, nil] - optional :last_status_code, Integer, api_name: :lastStatusCode - - # @!method initialize(id:, attempts:, created_at:, status:, stream_event_id:, delivered_at: nil, last_error: nil, last_status_code: nil) - # @param id [String] - # @param attempts [Integer] - # @param created_at [Time] - # @param status [String] - # @param stream_event_id [String] - # @param delivered_at [Time] - # @param last_error [String] - # @param last_status_code [Integer] - end + # @param deliveries [Array] end end end diff --git a/lib/x_twitter_scraper/models/webhook_list_response.rb b/lib/x_twitter_scraper/models/webhook_list_response.rb index 80ff66e..34cb122 100644 --- a/lib/x_twitter_scraper/models/webhook_list_response.rb +++ b/lib/x_twitter_scraper/models/webhook_list_response.rb @@ -6,62 +6,11 @@ module Models class WebhookListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute webhooks # - # @return [Array] - required :webhooks, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::WebhookListResponse::Webhook] } + # @return [Array] + required :webhooks, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Webhook] } # @!method initialize(webhooks:) - # @param webhooks [Array] - - class Webhook < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::WebhookListResponse::Webhook::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute url - # - # @return [String] - required :url, String - - # @!method initialize(id:, created_at:, event_types:, is_active:, url:) - # @param id [String] - # @param created_at [Time] - # @param event_types [Array] - # @param is_active [Boolean] - # @param url [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end + # @param webhooks [Array] end end end diff --git a/lib/x_twitter_scraper/models/webhook_update_params.rb b/lib/x_twitter_scraper/models/webhook_update_params.rb index 7e648e0..4d718d3 100644 --- a/lib/x_twitter_scraper/models/webhook_update_params.rb +++ b/lib/x_twitter_scraper/models/webhook_update_params.rb @@ -13,12 +13,11 @@ class WebhookUpdateParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute event_types + # Array of event types to subscribe to. # - # @return [Array, nil] + # @return [Array, nil] optional :event_types, - -> { - XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::WebhookUpdateParams::EventType] - }, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes # @!attribute is_active @@ -33,24 +32,14 @@ class WebhookUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, event_types: nil, is_active: nil, url: nil, request_options: {}) # @param id [String] - # @param event_types [Array] + # + # @param event_types [Array] Array of event types to subscribe to. + # # @param is_active [Boolean] + # # @param url [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/x_twitter_scraper/models/webhook_update_response.rb b/lib/x_twitter_scraper/models/webhook_update_response.rb deleted file mode 100644 index 618ec55..0000000 --- a/lib/x_twitter_scraper/models/webhook_update_response.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Webhooks#update - class WebhookUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute event_types - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::WebhookUpdateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute is_active - # - # @return [Boolean] - required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute url - # - # @return [String] - required :url, String - - # @!method initialize(id:, created_at:, event_types:, is_active:, url:) - # @param id [String] - # @param created_at [Time] - # @param event_types [Array] - # @param is_active [Boolean] - # @param url [String] - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW = :"tweet.new" - TWEET_REPLY = :"tweet.reply" - TWEET_RETWEET = :"tweet.retweet" - TWEET_QUOTE = :"tweet.quote" - FOLLOWER_GAINED = :"follower.gained" - FOLLOWER_LOST = :"follower.lost" - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/winner.rb b/lib/x_twitter_scraper/models/winner.rb index 8558ac3..2afd506 100644 --- a/lib/x_twitter_scraper/models/winner.rb +++ b/lib/x_twitter_scraper/models/winner.rb @@ -24,6 +24,8 @@ class Winner < XTwitterScraper::Internal::Type::BaseModel required :tweet_id, String, api_name: :tweetId # @!method initialize(author_username:, is_backup:, position:, tweet_id:) + # Giveaway draw winner with position and backup flag. + # # @param author_username [String] # @param is_backup [Boolean] # @param position [Integer] diff --git a/lib/x_twitter_scraper/models/x/account_bulk_retry_params.rb b/lib/x_twitter_scraper/models/x/account_bulk_retry_params.rb new file mode 100644 index 0000000..75e0d25 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/account_bulk_retry_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Accounts#bulk_retry + class AccountBulkRetryParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/account_bulk_retry_response.rb b/lib/x_twitter_scraper/models/x/account_bulk_retry_response.rb new file mode 100644 index 0000000..4861d82 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/account_bulk_retry_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Accounts#bulk_retry + class AccountBulkRetryResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute cleared + # Number of accounts cleared + # + # @return [Integer] + required :cleared, Integer + + # @!method initialize(cleared:) + # @param cleared [Integer] Number of accounts cleared + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/account_list_response.rb b/lib/x_twitter_scraper/models/x/account_list_response.rb index 147d140..eb7921d 100644 --- a/lib/x_twitter_scraper/models/x/account_list_response.rb +++ b/lib/x_twitter_scraper/models/x/account_list_response.rb @@ -7,46 +7,11 @@ module X class AccountListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute accounts # - # @return [Array] - required :accounts, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::AccountListResponse::Account] } + # @return [Array] + required :accounts, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::XAccount] } # @!method initialize(accounts:) - # @param accounts [Array] - - class Account < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute x_user_id - # - # @return [String] - required :x_user_id, String, api_name: :xUserId - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!method initialize(id:, created_at:, status:, x_user_id:, x_username:) - # @param id [String] - # @param created_at [Time] - # @param status [String] - # @param x_user_id [String] - # @param x_username [String] - end + # @param accounts [Array] end end end diff --git a/lib/x_twitter_scraper/models/x/account_reauth_params.rb b/lib/x_twitter_scraper/models/x/account_reauth_params.rb index d5129ea..90107bc 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_params.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_params.rb @@ -14,13 +14,13 @@ class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute password - # Account password + # Updated account password # # @return [String] required :password, String # @!attribute totp_secret - # TOTP secret for 2FA + # TOTP secret for 2FA re-authentication # # @return [String, nil] optional :totp_secret, String @@ -28,9 +28,9 @@ class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, password:, totp_secret: nil, request_options: {}) # @param id [String] # - # @param password [String] Account password + # @param password [String] Updated account password # - # @param totp_secret [String] TOTP secret for 2FA + # @param totp_secret [String] TOTP secret for 2FA re-authentication # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/account_retrieve_response.rb b/lib/x_twitter_scraper/models/x/account_retrieve_response.rb deleted file mode 100644 index e7fcc00..0000000 --- a/lib/x_twitter_scraper/models/x/account_retrieve_response.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Accounts#retrieve - class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute status - # - # @return [String] - required :status, String - - # @!attribute x_user_id - # - # @return [String] - required :x_user_id, String, api_name: :xUserId - - # @!attribute x_username - # - # @return [String] - required :x_username, String, api_name: :xUsername - - # @!attribute cookies_obtained_at - # - # @return [Time, nil] - optional :cookies_obtained_at, Time, api_name: :cookiesObtainedAt - - # @!attribute proxy_country - # - # @return [String, nil] - optional :proxy_country, String, api_name: :proxyCountry - - # @!attribute updated_at - # - # @return [Time, nil] - optional :updated_at, Time, api_name: :updatedAt - - # @!method initialize(id:, created_at:, status:, x_user_id:, x_username:, cookies_obtained_at: nil, proxy_country: nil, updated_at: nil) - # @param id [String] - # @param created_at [Time] - # @param status [String] - # @param x_user_id [String] - # @param x_username [String] - # @param cookies_obtained_at [Time] - # @param proxy_country [String] - # @param updated_at [Time] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/bookmark_list_params.rb b/lib/x_twitter_scraper/models/x/bookmark_list_params.rb index 72c7e73..287a626 100644 --- a/lib/x_twitter_scraper/models/x/bookmark_list_params.rb +++ b/lib/x_twitter_scraper/models/x/bookmark_list_params.rb @@ -9,7 +9,7 @@ class BookmarkListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for bookmarks # # @return [String, nil] optional :cursor, String @@ -21,7 +21,7 @@ class BookmarkListParams < XTwitterScraper::Internal::Type::BaseModel optional :folder_id, String # @!method initialize(cursor: nil, folder_id: nil, request_options: {}) - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for bookmarks # # @param folder_id [String] Optional bookmark folder ID # diff --git a/lib/x_twitter_scraper/models/x/bookmark_list_response.rb b/lib/x_twitter_scraper/models/x/bookmark_list_response.rb deleted file mode 100644 index d887b6c..0000000 --- a/lib/x_twitter_scraper/models/x/bookmark_list_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Bookmarks#list - class BookmarkListResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::BookmarkListResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/communities/join_create_params.rb b/lib/x_twitter_scraper/models/x/communities/join_create_params.rb index 9292001..239256b 100644 --- a/lib/x_twitter_scraper/models/x/communities/join_create_params.rb +++ b/lib/x_twitter_scraper/models/x/communities/join_create_params.rb @@ -15,7 +15,7 @@ class JoinCreateParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String @@ -23,7 +23,7 @@ class JoinCreateParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, account:, request_options: {}) # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/communities/join_create_response.rb b/lib/x_twitter_scraper/models/x/communities/join_create_response.rb deleted file mode 100644 index 1151f66..0000000 --- a/lib/x_twitter_scraper/models/x/communities/join_create_response.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - module Communities - # @see XTwitterScraper::Resources::X::Communities::Join#create - class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute community_id - # - # @return [String] - required :community_id, String, api_name: :communityId - - # @!attribute community_name - # - # @return [String] - required :community_name, String, api_name: :communityName - - # @!attribute success - # - # @return [Boolean, true] - required :success, const: true - - # @!method initialize(community_id:, community_name:, success: true) - # @param community_id [String] - # @param community_name [String] - # @param success [Boolean, true] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb b/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb index dc49347..7b3e401 100644 --- a/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb +++ b/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb @@ -15,7 +15,7 @@ class JoinDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String @@ -23,7 +23,7 @@ class JoinDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, account:, request_options: {}) # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb b/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb deleted file mode 100644 index 155334c..0000000 --- a/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - module Communities - # @see XTwitterScraper::Resources::X::Communities::Join#delete_all - class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute community_id - # - # @return [String] - required :community_id, String, api_name: :communityId - - # @!attribute community_name - # - # @return [String] - required :community_name, String, api_name: :communityName - - # @!attribute success - # - # @return [Boolean, true] - required :success, const: true - - # @!method initialize(community_id:, community_name:, success: true) - # @param community_id [String] - # @param community_name [String] - # @param success [Boolean, true] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb b/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb new file mode 100644 index 0000000..909902e --- /dev/null +++ b/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + module Communities + # @see XTwitterScraper::Resources::X::Communities::Tweets#list_by_community + class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute cursor + # Pagination cursor for community tweets + # + # @return [String, nil] + optional :cursor, String + + # @!method initialize(id:, cursor: nil, request_options: {}) + # @param id [String] + # + # @param cursor [String] Pagination cursor for community tweets + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb b/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb index f2371cb..a68015c 100644 --- a/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +++ b/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb @@ -10,29 +10,29 @@ class TweetListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute q - # Search query + # Search query for cross-community tweets # # @return [String] required :q, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for cross-community results # # @return [String, nil] optional :cursor, String # @!attribute query_type - # Sort order (Latest or Top) + # Sort order for cross-community results (Latest or Top) # # @return [String, nil] optional :query_type, String # @!method initialize(q:, cursor: nil, query_type: nil, request_options: {}) - # @param q [String] Search query + # @param q [String] Search query for cross-community tweets # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for cross-community results # - # @param query_type [String] Sort order (Latest or Top) + # @param query_type [String] Sort order for cross-community results (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/community_action_result.rb b/lib/x_twitter_scraper/models/x/community_action_result.rb index 6ae3266..c5759d7 100644 --- a/lib/x_twitter_scraper/models/x/community_action_result.rb +++ b/lib/x_twitter_scraper/models/x/community_action_result.rb @@ -20,6 +20,8 @@ class CommunityActionResult < XTwitterScraper::Internal::Type::BaseModel required :success, const: true # @!method initialize(community_id:, community_name:, success: true) + # Result of a community join or leave action. + # # @param community_id [String] # @param community_name [String] # @param success [Boolean, true] diff --git a/lib/x_twitter_scraper/models/x/community_create_params.rb b/lib/x_twitter_scraper/models/x/community_create_params.rb index 7ae8079..fcab891 100644 --- a/lib/x_twitter_scraper/models/x/community_create_params.rb +++ b/lib/x_twitter_scraper/models/x/community_create_params.rb @@ -9,7 +9,7 @@ class CommunityCreateParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) creating the community # # @return [String] required :account, String @@ -27,7 +27,7 @@ class CommunityCreateParams < XTwitterScraper::Internal::Type::BaseModel optional :description, String # @!method initialize(account:, name:, description: nil, request_options: {}) - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) creating the community # # @param name [String] Community name # diff --git a/lib/x_twitter_scraper/models/x/community_delete_params.rb b/lib/x_twitter_scraper/models/x/community_delete_params.rb index fb24b9f..fbc8a83 100644 --- a/lib/x_twitter_scraper/models/x/community_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/community_delete_params.rb @@ -14,7 +14,7 @@ class CommunityDeleteParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) deleting the community # # @return [String] required :account, String @@ -28,7 +28,7 @@ class CommunityDeleteParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, account:, community_name:, request_options: {}) # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) deleting the community # # @param community_name [String] Community name for confirmation # diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb index 7da5eac..a8bcf72 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb @@ -17,7 +17,7 @@ class CommunityRetrieveInfoResponse < XTwitterScraper::Internal::Type::BaseModel # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse#community class Community < XTwitterScraper::Internal::Type::BaseModel # @!attribute id - # Community ID + # Unique community identifier # # @return [String] required :id, String @@ -35,7 +35,7 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :created_at, String # @!attribute description - # Community description + # About text for the community # # @return [String, nil] optional :description, String @@ -59,7 +59,7 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :moderator_count, Integer # @!attribute name - # Community name + # Display name of the community # # @return [String, nil] optional :name, String @@ -81,13 +81,13 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, banner_url: nil, created_at: nil, description: nil, join_policy: nil, member_count: nil, moderator_count: nil, name: nil, primary_topic: nil, rules: nil) # Community info object # - # @param id [String] Community ID + # @param id [String] Unique community identifier # # @param banner_url [String] Community banner image URL # # @param created_at [String] Community creation timestamp # - # @param description [String] Community description + # @param description [String] About text for the community # # @param join_policy [String] Join policy (open or restricted) # @@ -95,7 +95,7 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # # @param moderator_count [Integer] Total moderator count # - # @param name [String] Community name + # @param name [String] Display name of the community # # @param primary_topic [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic] Primary topic # diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_moderators_params.rb b/lib/x_twitter_scraper/models/x/community_retrieve_moderators_params.rb index 2f85823..bf0d6f7 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_moderators_params.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_moderators_params.rb @@ -14,7 +14,7 @@ class CommunityRetrieveModeratorsParams < XTwitterScraper::Internal::Type::BaseM required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for community moderators # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class CommunityRetrieveModeratorsParams < XTwitterScraper::Internal::Type::BaseM # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for community moderators # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb b/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb index f4c3ead..9df60ca 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb @@ -15,7 +15,7 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel required :q, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for community search # # @return [String, nil] optional :cursor, String @@ -29,7 +29,7 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(q:, cursor: nil, query_type: nil, request_options: {}) # @param q [String] Search query # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for community search # # @param query_type [String] Sort order (Latest or Top) # diff --git a/lib/x_twitter_scraper/models/x/dm_retrieve_history_params.rb b/lib/x_twitter_scraper/models/x/dm_retrieve_history_params.rb index 45abbff..1e38998 100644 --- a/lib/x_twitter_scraper/models/x/dm_retrieve_history_params.rb +++ b/lib/x_twitter_scraper/models/x/dm_retrieve_history_params.rb @@ -14,7 +14,7 @@ class DmRetrieveHistoryParams < XTwitterScraper::Internal::Type::BaseModel required :user_id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for DM history # # @return [String, nil] optional :cursor, String @@ -28,7 +28,7 @@ class DmRetrieveHistoryParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(user_id:, cursor: nil, max_id: nil, request_options: {}) # @param user_id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for DM history # # @param max_id [String] Legacy pagination cursor (backward compat) # diff --git a/lib/x_twitter_scraper/models/x/dm_send_params.rb b/lib/x_twitter_scraper/models/x/dm_send_params.rb index df124fc..8921ae9 100644 --- a/lib/x_twitter_scraper/models/x/dm_send_params.rb +++ b/lib/x_twitter_scraper/models/x/dm_send_params.rb @@ -14,7 +14,7 @@ class DmSendParams < XTwitterScraper::Internal::Type::BaseModel required :user_id, String # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) sending the DM # # @return [String] required :account, String @@ -37,7 +37,7 @@ class DmSendParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(user_id:, account:, text:, media_ids: nil, reply_to_message_id: nil, request_options: {}) # @param user_id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) sending the DM # # @param text [String] # diff --git a/lib/x_twitter_scraper/models/x/list_retrieve_followers_params.rb b/lib/x_twitter_scraper/models/x/list_retrieve_followers_params.rb index f63a74a..be0e53d 100644 --- a/lib/x_twitter_scraper/models/x/list_retrieve_followers_params.rb +++ b/lib/x_twitter_scraper/models/x/list_retrieve_followers_params.rb @@ -14,7 +14,7 @@ class ListRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for list followers # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class ListRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list followers # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/list_retrieve_members_params.rb b/lib/x_twitter_scraper/models/x/list_retrieve_members_params.rb index 96c3f6a..663b6cb 100644 --- a/lib/x_twitter_scraper/models/x/list_retrieve_members_params.rb +++ b/lib/x_twitter_scraper/models/x/list_retrieve_members_params.rb @@ -14,7 +14,7 @@ class ListRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for list members # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class ListRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list members # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb b/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb index ed89485..9cd2cdc 100644 --- a/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +++ b/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb @@ -14,7 +14,7 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for list tweets # # @return [String, nil] optional :cursor, String @@ -40,7 +40,7 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list tweets # # @param include_replies [Boolean] Include replies (default false) # diff --git a/lib/x_twitter_scraper/models/x/media_upload_params.rb b/lib/x_twitter_scraper/models/x/media_upload_params.rb index 7d79196..b23b4e7 100644 --- a/lib/x_twitter_scraper/models/x/media_upload_params.rb +++ b/lib/x_twitter_scraper/models/x/media_upload_params.rb @@ -9,7 +9,7 @@ class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) uploading media # # @return [String] required :account, String @@ -26,7 +26,7 @@ class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel optional :is_long_video, XTwitterScraper::Internal::Type::Boolean # @!method initialize(account:, file:, is_long_video: nil, request_options: {}) - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) uploading media # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Media file to upload # diff --git a/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb b/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb index 3c0bb5f..8918f53 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb @@ -9,7 +9,7 @@ class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) for avatar update # # @return [String] required :account, String @@ -21,7 +21,7 @@ class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel required :file, XTwitterScraper::Internal::Type::FileInput # @!method initialize(account:, file:, request_options: {}) - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) for avatar update # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Avatar image (max 716KB) # diff --git a/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb b/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb index 283c5ba..9b12227 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb @@ -9,7 +9,7 @@ class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) for banner update # # @return [String] required :account, String @@ -21,7 +21,7 @@ class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel required :file, XTwitterScraper::Internal::Type::FileInput # @!method initialize(account:, file:, request_options: {}) - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) for banner update # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Banner image (max 2MB) # diff --git a/lib/x_twitter_scraper/models/x/profile_update_params.rb b/lib/x_twitter_scraper/models/x/profile_update_params.rb index 5e85cc9..b96a96a 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_params.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_params.rb @@ -9,7 +9,7 @@ class ProfileUpdateParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or account ID) + # X account (@username or ID) to update profile # # @return [String] required :account, String @@ -38,7 +38,7 @@ class ProfileUpdateParams < XTwitterScraper::Internal::Type::BaseModel optional :url, String # @!method initialize(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) to update profile # # @param description [String] Bio description # diff --git a/lib/x_twitter_scraper/models/x/search_tweet.rb b/lib/x_twitter_scraper/models/x/search_tweet.rb index 64df0ce..9f6f293 100644 --- a/lib/x_twitter_scraper/models/x/search_tweet.rb +++ b/lib/x_twitter_scraper/models/x/search_tweet.rb @@ -29,6 +29,12 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :created_at, String, api_name: :createdAt + # @!attribute is_note_tweet + # True for Note Tweets (long-form content, up to 25,000 characters) + # + # @return [Boolean, nil] + optional :is_note_tweet, XTwitterScraper::Internal::Type::Boolean, api_name: :isNoteTweet + # @!attribute like_count # # @return [Integer, nil] @@ -54,16 +60,29 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :view_count, Integer, api_name: :viewCount - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) + # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, is_note_tweet: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) + # Tweet returned from search results with inline author info. + # # @param id [String] + # # @param text [String] + # # @param author [XTwitterScraper::Models::X::SearchTweet::Author] + # # @param bookmark_count [Integer] + # # @param created_at [String] + # + # @param is_note_tweet [Boolean] True for Note Tweets (long-form content, up to 25,000 characters) + # # @param like_count [Integer] + # # @param quote_count [Integer] + # # @param reply_count [Integer] + # # @param retweet_count [Integer] + # # @param view_count [Integer] # @see XTwitterScraper::Models::X::SearchTweet#author diff --git a/lib/x_twitter_scraper/models/x/tweet_author.rb b/lib/x_twitter_scraper/models/x/tweet_author.rb index 5dd442a..e441342 100644 --- a/lib/x_twitter_scraper/models/x/tweet_author.rb +++ b/lib/x_twitter_scraper/models/x/tweet_author.rb @@ -30,6 +30,8 @@ class TweetAuthor < XTwitterScraper::Internal::Type::BaseModel optional :profile_picture, String, api_name: :profilePicture # @!method initialize(id:, followers:, username:, verified:, profile_picture: nil) + # Author of a tweet with follower count and verification status. + # # @param id [String] # @param followers [Integer] # @param username [String] diff --git a/lib/x_twitter_scraper/models/x/tweet_delete_params.rb b/lib/x_twitter_scraper/models/x/tweet_delete_params.rb index 55b1044..cc4c0d2 100644 --- a/lib/x_twitter_scraper/models/x/tweet_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_delete_params.rb @@ -8,21 +8,21 @@ class TweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(tweet_id:, account:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_detail.rb b/lib/x_twitter_scraper/models/x/tweet_detail.rb index 1d2924a..61c2e05 100644 --- a/lib/x_twitter_scraper/models/x/tweet_detail.rb +++ b/lib/x_twitter_scraper/models/x/tweet_detail.rb @@ -44,21 +44,129 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Integer] required :view_count, Integer, api_name: :viewCount + # @!attribute conversation_id + # ID of the root tweet in the conversation thread + # + # @return [String, nil] + optional :conversation_id, String, api_name: :conversationId + # @!attribute created_at # # @return [String, nil] optional :created_at, String, api_name: :createdAt - # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, created_at: nil) + # @!attribute entities + # Parsed entities from the tweet text (URLs, mentions, hashtags, media) + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute is_note_tweet + # Whether this is a Note Tweet (long-form post, up to 25,000 characters) + # + # @return [Boolean, nil] + optional :is_note_tweet, XTwitterScraper::Internal::Type::Boolean, api_name: :isNoteTweet + + # @!attribute is_quote_status + # Whether this tweet quotes another tweet + # + # @return [Boolean, nil] + optional :is_quote_status, XTwitterScraper::Internal::Type::Boolean, api_name: :isQuoteStatus + + # @!attribute is_reply + # Whether this tweet is a reply to another tweet + # + # @return [Boolean, nil] + optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + + # @!attribute media + # Attached media items, omitted when the tweet has no media + # + # @return [Array, nil] + optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::TweetDetail::Media] } + + # @!attribute quoted_tweet + # The quoted tweet object, present when isQuoteStatus is true + # + # @return [Hash{Symbol=>Object}, nil] + optional :quoted_tweet, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute source + # Client application used to post this tweet + # + # @return [String, nil] + optional :source, String + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, conversation_id: nil, created_at: nil, entities: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, media: nil, quoted_tweet: nil, source: nil) + # Full tweet with text, engagement metrics, media, and metadata. + # # @param id [String] + # # @param bookmark_count [Integer] + # # @param like_count [Integer] + # # @param quote_count [Integer] + # # @param reply_count [Integer] + # # @param retweet_count [Integer] + # # @param text [String] + # # @param view_count [Integer] + # + # @param conversation_id [String] ID of the root tweet in the conversation thread + # # @param created_at [String] + # + # @param entities [Hash{Symbol=>Object}] Parsed entities from the tweet text (URLs, mentions, hashtags, media) + # + # @param is_note_tweet [Boolean] Whether this is a Note Tweet (long-form post, up to 25,000 characters) + # + # @param is_quote_status [Boolean] Whether this tweet quotes another tweet + # + # @param is_reply [Boolean] Whether this tweet is a reply to another tweet + # + # @param media [Array] Attached media items, omitted when the tweet has no media + # + # @param quoted_tweet [Hash{Symbol=>Object}] The quoted tweet object, present when isQuoteStatus is true + # + # @param source [String] Client application used to post this tweet + + class Media < XTwitterScraper::Internal::Type::BaseModel + # @!attribute media_url + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDetail::Media::Type, nil] + optional :type, enum: -> { XTwitterScraper::X::TweetDetail::Media::Type } + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(media_url: nil, type: nil, url: nil) + # @param media_url [String] + # @param type [Symbol, XTwitterScraper::Models::X::TweetDetail::Media::Type] + # @param url [String] + + # @see XTwitterScraper::Models::X::TweetDetail::Media#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + PHOTO = :photo + VIDEO = :video + ANIMATED_GIF = :animated_gif + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_favoriters_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_favoriters_params.rb index f7e0810..e325ee2 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_favoriters_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_favoriters_params.rb @@ -14,7 +14,7 @@ class TweetGetFavoritersParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for favoriters # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class TweetGetFavoritersParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for favoriters # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_favoriters_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_favoriters_response.rb deleted file mode 100644 index f2bd76f..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_get_favoriters_response.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#get_favoriters - class TweetGetFavoritersResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute users - # - # @return [Array] - required :users, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User] } - - # @!method initialize(has_next_page:, next_cursor:, users:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param users [Array] - - class User < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute followers - # - # @return [Integer, nil] - optional :followers, Integer - - # @!attribute following - # - # @return [Integer, nil] - optional :following, Integer - - # @!attribute location - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!attribute statuses_count - # - # @return [Integer, nil] - optional :statuses_count, Integer, api_name: :statusesCount - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param created_at [String] - # @param description [String] - # @param followers [Integer] - # @param following [Integer] - # @param location [String] - # @param profile_picture [String] - # @param statuses_count [Integer] - # @param verified [Boolean] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb index 10f67b4..cac3055 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb @@ -14,25 +14,25 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for quote tweets # # @return [String, nil] optional :cursor, String # @!attribute include_replies - # Include replies (default false) + # Include reply quotes (default false) # # @return [Boolean, nil] optional :include_replies, XTwitterScraper::Internal::Type::Boolean # @!attribute since_time - # Unix timestamp - filter after + # Unix timestamp - return quotes posted after this time # # @return [String, nil] optional :since_time, String # @!attribute until_time - # Unix timestamp - filter before + # Unix timestamp - return quotes posted before this time # # @return [String, nil] optional :until_time, String @@ -40,13 +40,13 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for quote tweets # - # @param include_replies [Boolean] Include replies (default false) + # @param include_replies [Boolean] Include reply quotes (default false) # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return quotes posted after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return quotes posted before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_quotes_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_quotes_response.rb deleted file mode 100644 index f5fa93c..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_get_quotes_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#get_quotes - class TweetGetQuotesResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb index d2651c6..97d916e 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb @@ -14,19 +14,19 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for tweet replies # # @return [String, nil] optional :cursor, String # @!attribute since_time - # Unix timestamp - filter after + # Unix timestamp - return replies posted after this time # # @return [String, nil] optional :since_time, String # @!attribute until_time - # Unix timestamp - filter before + # Unix timestamp - return replies posted before this time # # @return [String, nil] optional :until_time, String @@ -34,11 +34,11 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for tweet replies # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return replies posted after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return replies posted before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb deleted file mode 100644 index 3a80f25..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#get_replies - class TweetGetRepliesResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_retweeters_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_retweeters_params.rb index 105e679..b92b475 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_retweeters_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_retweeters_params.rb @@ -14,7 +14,7 @@ class TweetGetRetweetersParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for retweeters # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class TweetGetRetweetersParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for retweeters # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_retweeters_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_retweeters_response.rb deleted file mode 100644 index 67f3821..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_get_retweeters_response.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#get_retweeters - class TweetGetRetweetersResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute users - # - # @return [Array] - required :users, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User] } - - # @!method initialize(has_next_page:, next_cursor:, users:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param users [Array] - - class User < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute followers - # - # @return [Integer, nil] - optional :followers, Integer - - # @!attribute following - # - # @return [Integer, nil] - optional :following, Integer - - # @!attribute location - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!attribute statuses_count - # - # @return [Integer, nil] - optional :statuses_count, Integer, api_name: :statusesCount - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param created_at [String] - # @param description [String] - # @param followers [Integer] - # @param following [Integer] - # @param location [String] - # @param profile_picture [String] - # @param statuses_count [Integer] - # @param verified [Boolean] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb index b1fbcd9..f395e34 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb @@ -14,7 +14,7 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for thread tweets # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for thread tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_get_thread_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_thread_response.rb deleted file mode 100644 index bf7d8ac..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_get_thread_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#get_thread - class TweetGetThreadResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweet_retrieve_params.rb b/lib/x_twitter_scraper/models/x/tweet_retrieve_params.rb index 0fc92d3..6eaf416 100644 --- a/lib/x_twitter_scraper/models/x/tweet_retrieve_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_retrieve_params.rb @@ -8,13 +8,13 @@ class TweetRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String - # @!method initialize(tweet_id:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb b/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb index 50387f8..276e9e3 100644 --- a/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb @@ -6,112 +6,21 @@ module X # @see XTwitterScraper::Resources::X::Tweets#retrieve class TweetRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute tweet + # Full tweet with text, engagement metrics, media, and metadata. # - # @return [XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet] - required :tweet, -> { XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet } + # @return [XTwitterScraper::Models::X::TweetDetail] + required :tweet, -> { XTwitterScraper::X::TweetDetail } # @!attribute author + # Author of a tweet with follower count and verification status. # - # @return [XTwitterScraper::Models::X::TweetRetrieveResponse::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::TweetRetrieveResponse::Author } + # @return [XTwitterScraper::Models::X::TweetAuthor, nil] + optional :author, -> { XTwitterScraper::X::TweetAuthor } # @!method initialize(tweet:, author: nil) - # @param tweet [XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet] - # @param author [XTwitterScraper::Models::X::TweetRetrieveResponse::Author] - - # @see XTwitterScraper::Models::X::TweetRetrieveResponse#tweet - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute bookmark_count - # - # @return [Integer] - required :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute like_count - # - # @return [Integer] - required :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer] - required :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer] - required :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer] - required :retweet_count, Integer, api_name: :retweetCount - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute view_count - # - # @return [Integer] - required :view_count, Integer, api_name: :viewCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, created_at: nil) - # @param id [String] - # @param bookmark_count [Integer] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param text [String] - # @param view_count [Integer] - # @param created_at [String] - end - - # @see XTwitterScraper::Models::X::TweetRetrieveResponse#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute followers - # - # @return [Integer] - required :followers, Integer - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean] - required :verified, XTwitterScraper::Internal::Type::Boolean - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!method initialize(id:, followers:, username:, verified:, profile_picture: nil) - # @param id [String] - # @param followers [Integer] - # @param username [String] - # @param verified [Boolean] - # @param profile_picture [String] - end + # @param tweet [XTwitterScraper::Models::X::TweetDetail] Full tweet with text, engagement metrics, media, and metadata. + # + # @param author [XTwitterScraper::Models::X::TweetAuthor] Author of a tweet with follower count and verification status. end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_search_params.rb b/lib/x_twitter_scraper/models/x/tweet_search_params.rb index 6988a46..0704d7c 100644 --- a/lib/x_twitter_scraper/models/x/tweet_search_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_search_params.rb @@ -21,7 +21,7 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute limit - # Deprecated — use cursor-based pagination instead + # Max tweets to return (server paginates internally). Omit for single page (~20). # # @return [Integer, nil] optional :limit, Integer @@ -49,7 +49,7 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel # # @param cursor [String] Pagination cursor from previous response # - # @param limit [Integer] Deprecated — use cursor-based pagination instead + # @param limit [Integer] Max tweets to return (server paginates internally). Omit for single page (~20). # # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order — Latest (chronological) or Top (engagement-ranked) # diff --git a/lib/x_twitter_scraper/models/x/tweet_search_response.rb b/lib/x_twitter_scraper/models/x/tweet_search_response.rb deleted file mode 100644 index 71b172b..0000000 --- a/lib/x_twitter_scraper/models/x/tweet_search_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Tweets#search - class TweetSearchResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::TweetSearchResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb b/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb index be50f8e..81be06b 100644 --- a/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb +++ b/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb @@ -9,21 +9,21 @@ class LikeCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(tweet_id:, account:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb b/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb index 71f075d..5957625 100644 --- a/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb @@ -9,21 +9,21 @@ class LikeDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(tweet_id:, account:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb b/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb index aa4d24c..f1626c2 100644 --- a/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb +++ b/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb @@ -9,21 +9,21 @@ class RetweetCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(tweet_id:, account:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb b/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb index 88d35b4..115dc5e 100644 --- a/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb @@ -9,21 +9,21 @@ class RetweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute tweet_id + # @!attribute id # # @return [String] - required :tweet_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(tweet_id:, account:, request_options: {}) - # @param tweet_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_profile.rb b/lib/x_twitter_scraper/models/x/user_profile.rb index a833e96..b570228 100644 --- a/lib/x_twitter_scraper/models/x/user_profile.rb +++ b/lib/x_twitter_scraper/models/x/user_profile.rb @@ -3,6 +3,7 @@ module XTwitterScraper module Models module X + # @see XTwitterScraper::Resources::X::Users#retrieve class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -60,6 +61,8 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel optional :verified, XTwitterScraper::Internal::Type::Boolean # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) + # X user profile with bio, follower counts, and verification status. + # # @param id [String] # @param name [String] # @param username [String] diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_followers_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_followers_params.rb index 8807277..d7026d8 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_followers_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_followers_params.rb @@ -14,7 +14,7 @@ class UserRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for followers list # # @return [String, nil] optional :cursor, String @@ -28,7 +28,7 @@ class UserRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for followers list # # @param page_size [Integer] Items per page (20-200, default 200) # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rb index 9c06136..a403f5f 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rb @@ -14,7 +14,7 @@ class UserRetrieveFollowersYouKnowParams < XTwitterScraper::Internal::Type::Base required :id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for followers-you-know # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class UserRetrieveFollowersYouKnowParams < XTwitterScraper::Internal::Type::Base # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for followers-you-know # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rb deleted file mode 100644 index 7235e1b..0000000 --- a/lib/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve_followers_you_know - class UserRetrieveFollowersYouKnowResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute users - # - # @return [Array] - required :users, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User] } - - # @!method initialize(has_next_page:, next_cursor:, users:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param users [Array] - - class User < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute followers - # - # @return [Integer, nil] - optional :followers, Integer - - # @!attribute following - # - # @return [Integer, nil] - optional :following, Integer - - # @!attribute location - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!attribute statuses_count - # - # @return [Integer, nil] - optional :statuses_count, Integer, api_name: :statusesCount - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param created_at [String] - # @param description [String] - # @param followers [Integer] - # @param following [Integer] - # @param location [String] - # @param profile_picture [String] - # @param statuses_count [Integer] - # @param verified [Boolean] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb index a7c2d5a..21d3736 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb @@ -14,13 +14,13 @@ class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for following list # # @return [String, nil] optional :cursor, String # @!attribute page_size - # Items per page (20-200, default 200) + # Results per page (20-200, default 200) # # @return [Integer, nil] optional :page_size, Integer @@ -28,9 +28,9 @@ class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for following list # - # @param page_size [Integer] Items per page (20-200, default 200) + # @param page_size [Integer] Results per page (20-200, default 200) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb index 9cdcf08..d774710 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb @@ -14,7 +14,7 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for liked tweets # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for liked tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_likes_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_likes_response.rb deleted file mode 100644 index d30dcfd..0000000 --- a/lib/x_twitter_scraper/models/x/user_retrieve_likes_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve_likes - class UserRetrieveLikesResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb index 7c7183c..47f3528 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb @@ -14,7 +14,7 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for media tweets # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for media tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_media_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_media_response.rb deleted file mode 100644 index 31106aa..0000000 --- a/lib/x_twitter_scraper/models/x/user_retrieve_media_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve_media - class UserRetrieveMediaResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb index 6f5f643..7965ff4 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb @@ -14,19 +14,19 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for mentions # # @return [String, nil] optional :cursor, String # @!attribute since_time - # Unix timestamp - filter after + # Unix timestamp - return mentions after this time # # @return [String, nil] optional :since_time, String # @!attribute until_time - # Unix timestamp - filter before + # Unix timestamp - return mentions before this time # # @return [String, nil] optional :until_time, String @@ -34,11 +34,11 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for mentions # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return mentions after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return mentions before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_params.rb index 3c60560..eba408f 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_params.rb @@ -8,13 +8,13 @@ class UserRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute username + # @!attribute id # # @return [String] - required :username, String + required :id, String - # @!method initialize(username:, request_options: {}) - # @param username [String] + # @!method initialize(id:, request_options: {}) + # @param id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_response.rb deleted file mode 100644 index b988dc9..0000000 --- a/lib/x_twitter_scraper/models/x/user_retrieve_response.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve - class UserRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute description - # - # @return [String, nil] - optional :description, String - - # @!attribute followers - # - # @return [Integer, nil] - optional :followers, Integer - - # @!attribute following - # - # @return [Integer, nil] - optional :following, Integer - - # @!attribute location - # - # @return [String, nil] - optional :location, String - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!attribute statuses_count - # - # @return [Integer, nil] - optional :statuses_count, Integer, api_name: :statusesCount - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, created_at: nil, description: nil, followers: nil, following: nil, location: nil, profile_picture: nil, statuses_count: nil, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param created_at [String] - # @param description [String] - # @param followers [Integer] - # @param following [Integer] - # @param location [String] - # @param profile_picture [String] - # @param statuses_count [Integer] - # @param verified [Boolean] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_search_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_search_params.rb index 243d9de..2e48715 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_search_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_search_params.rb @@ -9,21 +9,21 @@ class UserRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute q - # Search query + # User search query # # @return [String] required :q, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for user search # # @return [String, nil] optional :cursor, String # @!method initialize(q:, cursor: nil, request_options: {}) - # @param q [String] Search query + # @param q [String] User search query # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for user search # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb index 01f62af..e4a987c 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb @@ -14,7 +14,7 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for user tweets # # @return [String, nil] optional :cursor, String @@ -34,7 +34,7 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, cursor: nil, include_parent_tweet: nil, include_replies: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for user tweets # # @param include_parent_tweet [Boolean] Include parent tweet for replies # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_tweets_response.rb deleted file mode 100644 index 4c77b97..0000000 --- a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_response.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve_tweets - class UserRetrieveTweetsResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rb index d868d77..ae01891 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rb @@ -14,7 +14,7 @@ class UserRetrieveVerifiedFollowersParams < XTwitterScraper::Internal::Type::Bas required :id, String # @!attribute cursor - # Pagination cursor + # Pagination cursor for verified followers # # @return [String, nil] optional :cursor, String @@ -22,7 +22,7 @@ class UserRetrieveVerifiedFollowersParams < XTwitterScraper::Internal::Type::Bas # @!method initialize(id:, cursor: nil, request_options: {}) # @param id [String] # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for verified followers # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/users/follow_create_params.rb b/lib/x_twitter_scraper/models/x/users/follow_create_params.rb index 210da20..ae79adb 100644 --- a/lib/x_twitter_scraper/models/x/users/follow_create_params.rb +++ b/lib/x_twitter_scraper/models/x/users/follow_create_params.rb @@ -9,21 +9,21 @@ class FollowCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute user_id + # @!attribute id # # @return [String] - required :user_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(user_id:, account:, request_options: {}) - # @param user_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb b/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb index e6a9637..76b44c9 100644 --- a/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb +++ b/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb @@ -9,21 +9,21 @@ class FollowDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute user_id + # @!attribute id # # @return [String] - required :user_id, String + required :id, String # @!attribute account - # X account (@username or account ID) + # X account identifier (@username or account ID) # # @return [String] required :account, String - # @!method initialize(user_id:, account:, request_options: {}) - # @param user_id [String] + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/x_account.rb b/lib/x_twitter_scraper/models/x/x_account.rb index 0a3a271..3e3e1b9 100644 --- a/lib/x_twitter_scraper/models/x/x_account.rb +++ b/lib/x_twitter_scraper/models/x/x_account.rb @@ -30,6 +30,8 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel required :x_username, String, api_name: :xUsername # @!method initialize(id:, created_at:, status:, x_user_id:, x_username:) + # Linked X account summary with username and connection status. + # # @param id [String] # @param created_at [Time] # @param status [String] diff --git a/lib/x_twitter_scraper/models/x/x_account_detail.rb b/lib/x_twitter_scraper/models/x/x_account_detail.rb index ae69e2f..4b7e069 100644 --- a/lib/x_twitter_scraper/models/x/x_account_detail.rb +++ b/lib/x_twitter_scraper/models/x/x_account_detail.rb @@ -3,6 +3,7 @@ module XTwitterScraper module Models module X + # @see XTwitterScraper::Resources::X::Accounts#retrieve class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # @@ -45,6 +46,8 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel optional :updated_at, Time, api_name: :updatedAt # @!method initialize(id:, created_at:, status:, x_user_id:, x_username:, cookies_obtained_at: nil, proxy_country: nil, updated_at: nil) + # Full X account details including proxy, cookies, and update timestamp. + # # @param id [String] # @param created_at [Time] # @param status [String] diff --git a/lib/x_twitter_scraper/models/x_get_article_response.rb b/lib/x_twitter_scraper/models/x_get_article_response.rb index 6d692cd..47bac28 100644 --- a/lib/x_twitter_scraper/models/x_get_article_response.rb +++ b/lib/x_twitter_scraper/models/x_get_article_response.rb @@ -10,13 +10,15 @@ class XGetArticleResponse < XTwitterScraper::Internal::Type::BaseModel required :article, -> { XTwitterScraper::Models::XGetArticleResponse::Article } # @!attribute author + # Author of a tweet with follower count and verification status. # - # @return [XTwitterScraper::Models::XGetArticleResponse::Author, nil] - optional :author, -> { XTwitterScraper::Models::XGetArticleResponse::Author } + # @return [XTwitterScraper::Models::X::TweetAuthor, nil] + optional :author, -> { XTwitterScraper::X::TweetAuthor } # @!method initialize(article:, author: nil) # @param article [XTwitterScraper::Models::XGetArticleResponse::Article] - # @param author [XTwitterScraper::Models::XGetArticleResponse::Author] + # + # @param author [XTwitterScraper::Models::X::TweetAuthor] Author of a tweet with follower count and verification status. # @see XTwitterScraper::Models::XGetArticleResponse#article class Article < XTwitterScraper::Internal::Type::BaseModel @@ -122,41 +124,6 @@ class Content < XTwitterScraper::Internal::Type::BaseModel # @param width [Integer] end end - - # @see XTwitterScraper::Models::XGetArticleResponse#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute followers - # - # @return [Integer] - required :followers, Integer - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean] - required :verified, XTwitterScraper::Internal::Type::Boolean - - # @!attribute profile_picture - # - # @return [String, nil] - optional :profile_picture, String, api_name: :profilePicture - - # @!method initialize(id:, followers:, username:, verified:, profile_picture: nil) - # @param id [String] - # @param followers [Integer] - # @param username [String] - # @param verified [Boolean] - # @param profile_picture [String] - end end end end diff --git a/lib/x_twitter_scraper/models/x_get_home_timeline_params.rb b/lib/x_twitter_scraper/models/x_get_home_timeline_params.rb index f595c20..4a1d44d 100644 --- a/lib/x_twitter_scraper/models/x_get_home_timeline_params.rb +++ b/lib/x_twitter_scraper/models/x_get_home_timeline_params.rb @@ -8,7 +8,7 @@ class XGetHomeTimelineParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for timeline # # @return [String, nil] optional :cursor, String @@ -20,7 +20,7 @@ class XGetHomeTimelineParams < XTwitterScraper::Internal::Type::BaseModel optional :seen_tweet_ids, String # @!method initialize(cursor: nil, seen_tweet_ids: nil, request_options: {}) - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for timeline # # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results # diff --git a/lib/x_twitter_scraper/models/x_get_home_timeline_response.rb b/lib/x_twitter_scraper/models/x_get_home_timeline_response.rb deleted file mode 100644 index f52f36b..0000000 --- a/lib/x_twitter_scraper/models/x_get_home_timeline_response.rb +++ /dev/null @@ -1,122 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::X#get_home_timeline - class XGetHomeTimelineResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, XTwitterScraper::Internal::Type::Boolean - - # @!attribute next_cursor - # - # @return [String] - required :next_cursor, String - - # @!attribute tweets - # - # @return [Array] - required :tweets, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] } - - # @!method initialize(has_next_page:, next_cursor:, tweets:) - # @param has_next_page [Boolean] - # @param next_cursor [String] - # @param tweets [Array] - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, nil] - optional :author, -> { XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author } - - # @!attribute bookmark_count - # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount - - # @!attribute created_at - # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt - - # @!attribute like_count - # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount - - # @!attribute quote_count - # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount - - # @!attribute reply_count - # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount - - # @!attribute retweet_count - # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount - - # @!attribute view_count - # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount - - # @!method initialize(id:, text:, author: nil, bookmark_count: nil, created_at: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil, view_count: nil) - # @param id [String] - # @param text [String] - # @param author [XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author] - # @param bookmark_count [Integer] - # @param created_at [String] - # @param like_count [Integer] - # @param quote_count [Integer] - # @param reply_count [Integer] - # @param retweet_count [Integer] - # @param view_count [Integer] - - # @see XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet#author - class Author < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute username - # - # @return [String] - required :username, String - - # @!attribute verified - # - # @return [Boolean, nil] - optional :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(id:, name:, username:, verified: nil) - # @param id [String] - # @param name [String] - # @param username [String] - # @param verified [Boolean] - end - end - end - end -end diff --git a/lib/x_twitter_scraper/models/x_get_notifications_params.rb b/lib/x_twitter_scraper/models/x_get_notifications_params.rb index 9ea6b6e..b061a4f 100644 --- a/lib/x_twitter_scraper/models/x_get_notifications_params.rb +++ b/lib/x_twitter_scraper/models/x_get_notifications_params.rb @@ -8,7 +8,7 @@ class XGetNotificationsParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute cursor - # Pagination cursor from previous response + # Pagination cursor for notifications # # @return [String, nil] optional :cursor, String @@ -20,7 +20,7 @@ class XGetNotificationsParams < XTwitterScraper::Internal::Type::BaseModel optional :type, enum: -> { XTwitterScraper::XGetNotificationsParams::Type } # @!method initialize(cursor: nil, type: nil, request_options: {}) - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for notifications # # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter # diff --git a/lib/x_twitter_scraper/models/x_get_trends_response.rb b/lib/x_twitter_scraper/models/x_get_trends_response.rb new file mode 100644 index 0000000..105147d --- /dev/null +++ b/lib/x_twitter_scraper/models/x_get_trends_response.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::X#get_trends + class XGetTrendsResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute count + # + # @return [Integer] + required :count, Integer + + # @!attribute trends + # + # @return [Array] + required :trends, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::XGetTrendsResponse::Trend] } + + # @!attribute woeid + # + # @return [Integer] + required :woeid, Integer + + # @!method initialize(count:, trends:, woeid:) + # @param count [Integer] + # @param trends [Array] + # @param woeid [Integer] + + class Trend < XTwitterScraper::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute query + # + # @return [String, nil] + optional :query, String + + # @!attribute rank + # + # @return [Integer, nil] + optional :rank, Integer + + # @!method initialize(name:, description: nil, query: nil, rank: nil) + # @param name [String] + # @param description [String] + # @param query [String] + # @param rank [Integer] + end + end + end +end diff --git a/lib/x_twitter_scraper/resources/drafts.rb b/lib/x_twitter_scraper/resources/drafts.rb index 4764ca2..cd46d58 100644 --- a/lib/x_twitter_scraper/resources/drafts.rb +++ b/lib/x_twitter_scraper/resources/drafts.rb @@ -13,7 +13,7 @@ class Drafts # @param topic [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::DraftCreateResponse] + # @return [XTwitterScraper::Models::DraftDetail] # # @see XTwitterScraper::Models::DraftCreateParams def create(params) @@ -22,7 +22,7 @@ def create(params) method: :post, path: "drafts", body: parsed, - model: XTwitterScraper::Models::DraftCreateResponse, + model: XTwitterScraper::DraftDetail, options: options ) end @@ -35,14 +35,14 @@ def create(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::DraftRetrieveResponse] + # @return [XTwitterScraper::Models::DraftDetail] # # @see XTwitterScraper::Models::DraftRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["drafts/%1$s", id], - model: XTwitterScraper::Models::DraftRetrieveResponse, + model: XTwitterScraper::DraftDetail, options: params[:request_options] ) end @@ -53,7 +53,7 @@ def retrieve(id, params = {}) # # @param after_cursor [String] Cursor for pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/draws.rb b/lib/x_twitter_scraper/resources/draws.rb index f77b974..1ad74e0 100644 --- a/lib/x_twitter_scraper/resources/draws.rb +++ b/lib/x_twitter_scraper/resources/draws.rb @@ -28,9 +28,9 @@ def retrieve(id, params = {}) # # @overload list(after: nil, limit: nil, request_options: {}) # - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -55,7 +55,7 @@ def list(params = {}) # # @param id [String] Resource ID (stringified bigint) # - # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] + # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] Export output format # # @param type [Symbol, XTwitterScraper::Models::DrawExportParams::Type] Export winners or all entries # diff --git a/lib/x_twitter_scraper/resources/events.rb b/lib/x_twitter_scraper/resources/events.rb index 95445d1..213f663 100644 --- a/lib/x_twitter_scraper/resources/events.rb +++ b/lib/x_twitter_scraper/resources/events.rb @@ -12,14 +12,14 @@ class Events # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::EventRetrieveResponse] + # @return [XTwitterScraper::Models::EventDetail] # # @see XTwitterScraper::Models::EventRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["events/%1$s", id], - model: XTwitterScraper::Models::EventRetrieveResponse, + model: XTwitterScraper::EventDetail, options: params[:request_options] ) end @@ -28,13 +28,13 @@ def retrieve(id, params = {}) # # @overload list(after: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) # - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param event_type [Symbol, XTwitterScraper::Models::EventListParams::EventType] + # @param event_type [Symbol, XTwitterScraper::Models::EventType] Filter events by type # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # - # @param monitor_id [String] + # @param monitor_id [String] Filter events by monitor ID # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/extractions.rb b/lib/x_twitter_scraper/resources/extractions.rb index c8b142c..bcd54f3 100644 --- a/lib/x_twitter_scraper/resources/extractions.rb +++ b/lib/x_twitter_scraper/resources/extractions.rb @@ -10,9 +10,9 @@ class Extractions # # @param id [String] Extraction public ID (UUID) # - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of results to return (1-1000, default 100) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -35,13 +35,13 @@ def retrieve(id, params = {}) # # @overload list(after: nil, limit: nil, status: nil, tool_type: nil, request_options: {}) # - # @param after [String] Cursor for pagination + # @param after [String] Cursor for keyset pagination # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # - # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] + # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] Filter by job status # - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionListParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionListParams::ToolType] Filter by extraction tool type # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -64,13 +64,13 @@ def list(params = {}) # # @overload estimate_cost(tool_type:, advanced_query: nil, exact_phrase: nil, exclude_words: nil, search_query: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, request_options: {}) # - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] Identifier for the extraction tool used to run a job. # - # @param advanced_query [String] Raw advanced search query appended as-is (tweet_search_extractor) + # @param advanced_query [String] Raw advanced query string appended to the estimate (tweet_search_extractor) # - # @param exact_phrase [String] Exact phrase to match (tweet_search_extractor) + # @param exact_phrase [String] Exact phrase filter for search estimation # - # @param exclude_words [String] Words to exclude from results (tweet_search_extractor) + # @param exclude_words [String] Words excluded from estimated search results # # @param search_query [String] # @@ -106,7 +106,7 @@ def estimate_cost(params) # # @param id [String] Extraction public ID # - # @param format_ [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] + # @param format_ [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] Export file format # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -130,7 +130,7 @@ def export_results(id, params = {}) # # @overload run(tool_type:, advanced_query: nil, exact_phrase: nil, exclude_words: nil, search_query: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, request_options: {}) # - # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::ToolType] + # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::ToolType] Identifier for the extraction tool used to run a job. # # @param advanced_query [String] Raw advanced search query appended as-is (tweet_search_extractor) # diff --git a/lib/x_twitter_scraper/resources/integrations.rb b/lib/x_twitter_scraper/resources/integrations.rb index 661a62f..286abbe 100644 --- a/lib/x_twitter_scraper/resources/integrations.rb +++ b/lib/x_twitter_scraper/resources/integrations.rb @@ -6,19 +6,19 @@ module Resources class Integrations # Create integration # - # @overload create(config:, event_types:, name:, type:, request_options: {}) + # @overload create(config:, event_types:, name:, type: :telegram, request_options: {}) # # @param config [XTwitterScraper::Models::IntegrationCreateParams::Config] Integration config (e.g. Telegram chatId) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param name [String] # - # @param type [Symbol, XTwitterScraper::Models::IntegrationCreateParams::Type] + # @param type [Symbol, :telegram] # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::IntegrationCreateResponse] + # @return [XTwitterScraper::Models::Integration] # # @see XTwitterScraper::Models::IntegrationCreateParams def create(params) @@ -27,7 +27,7 @@ def create(params) method: :post, path: "integrations", body: parsed, - model: XTwitterScraper::Models::IntegrationCreateResponse, + model: XTwitterScraper::Integration, options: options ) end @@ -40,14 +40,14 @@ def create(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::IntegrationRetrieveResponse] + # @return [XTwitterScraper::Models::Integration] # # @see XTwitterScraper::Models::IntegrationRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["integrations/%1$s", id], - model: XTwitterScraper::Models::IntegrationRetrieveResponse, + model: XTwitterScraper::Integration, options: params[:request_options] ) end @@ -58,7 +58,7 @@ def retrieve(id, params = {}) # # @param id [String] Resource ID (stringified bigint) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) # @@ -74,7 +74,7 @@ def retrieve(id, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::IntegrationUpdateResponse] + # @return [XTwitterScraper::Models::Integration] # # @see XTwitterScraper::Models::IntegrationUpdateParams def update(id, params = {}) @@ -83,7 +83,7 @@ def update(id, params = {}) method: :patch, path: ["integrations/%1$s", id], body: parsed, - model: XTwitterScraper::Models::IntegrationUpdateResponse, + model: XTwitterScraper::Integration, options: options ) end @@ -132,7 +132,7 @@ def delete(id, params = {}) # # @param id [String] Resource ID (stringified bigint) # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return (1-100, default 50) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/monitors.rb b/lib/x_twitter_scraper/resources/monitors.rb index 9c9fc79..a1f279c 100644 --- a/lib/x_twitter_scraper/resources/monitors.rb +++ b/lib/x_twitter_scraper/resources/monitors.rb @@ -8,7 +8,7 @@ class Monitors # # @overload create(event_types:, username:, request_options: {}) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param username [String] X username (without @) # @@ -36,14 +36,14 @@ def create(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::MonitorRetrieveResponse] + # @return [XTwitterScraper::Models::Monitor] # # @see XTwitterScraper::Models::MonitorRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["monitors/%1$s", id], - model: XTwitterScraper::Models::MonitorRetrieveResponse, + model: XTwitterScraper::Monitor, options: params[:request_options] ) end @@ -54,13 +54,13 @@ def retrieve(id, params = {}) # # @param id [String] Resource ID (stringified bigint) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param is_active [Boolean] # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::MonitorUpdateResponse] + # @return [XTwitterScraper::Models::Monitor] # # @see XTwitterScraper::Models::MonitorUpdateParams def update(id, params = {}) @@ -69,7 +69,7 @@ def update(id, params = {}) method: :patch, path: ["monitors/%1$s", id], body: parsed, - model: XTwitterScraper::Models::MonitorUpdateResponse, + model: XTwitterScraper::Monitor, options: options ) end diff --git a/lib/x_twitter_scraper/resources/radar.rb b/lib/x_twitter_scraper/resources/radar.rb index 10967e3..88632a5 100644 --- a/lib/x_twitter_scraper/resources/radar.rb +++ b/lib/x_twitter_scraper/resources/radar.rb @@ -19,7 +19,7 @@ class Radar # # @param region [String] Region filter (us, global, etc.) # - # @param source [String] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t + # @param source [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Source] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/styles.rb b/lib/x_twitter_scraper/resources/styles.rb index f9d3b5f..59708df 100644 --- a/lib/x_twitter_scraper/resources/styles.rb +++ b/lib/x_twitter_scraper/resources/styles.rb @@ -6,29 +6,29 @@ module Resources class Styles # Get cached style profile # - # @overload retrieve(username, request_options: {}) + # @overload retrieve(id, request_options: {}) # - # @param username [String] X username of cached style + # @param id [String] Style profile ID or X username # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::StyleRetrieveResponse] + # @return [XTwitterScraper::Models::StyleProfile] # # @see XTwitterScraper::Models::StyleRetrieveParams - def retrieve(username, params = {}) + def retrieve(id, params = {}) @client.request( method: :get, - path: ["styles/%1$s", username], - model: XTwitterScraper::Models::StyleRetrieveResponse, + path: ["styles/%1$s", id], + model: XTwitterScraper::StyleProfile, options: params[:request_options] ) end # Save style profile with custom tweets # - # @overload update(username, label:, tweets:, request_options: {}) + # @overload update(id, label:, tweets:, request_options: {}) # - # @param username [String] X username of cached style + # @param id [String] Style profile ID or X username # # @param label [String] Display label for the style # @@ -36,16 +36,16 @@ def retrieve(username, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::StyleUpdateResponse] + # @return [XTwitterScraper::Models::StyleProfile] # # @see XTwitterScraper::Models::StyleUpdateParams - def update(username, params) + def update(id, params) parsed, options = XTwitterScraper::StyleUpdateParams.dump_request(params) @client.request( method: :put, - path: ["styles/%1$s", username], + path: ["styles/%1$s", id], body: parsed, - model: XTwitterScraper::Models::StyleUpdateResponse, + model: XTwitterScraper::StyleProfile, options: options ) end @@ -70,19 +70,19 @@ def list(params = {}) # Delete a style profile # - # @overload delete(username, request_options: {}) + # @overload delete(id, request_options: {}) # - # @param username [String] X username of cached style + # @param id [String] Style profile ID or X username # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [nil] # # @see XTwitterScraper::Models::StyleDeleteParams - def delete(username, params = {}) + def delete(id, params = {}) @client.request( method: :delete, - path: ["styles/%1$s", username], + path: ["styles/%1$s", id], model: NilClass, options: params[:request_options] ) @@ -96,7 +96,7 @@ def delete(username, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::StyleAnalyzeResponse] + # @return [XTwitterScraper::Models::StyleProfile] # # @see XTwitterScraper::Models::StyleAnalyzeParams def analyze(params) @@ -105,7 +105,7 @@ def analyze(params) method: :post, path: "styles", body: parsed, - model: XTwitterScraper::Models::StyleAnalyzeResponse, + model: XTwitterScraper::StyleProfile, options: options ) end @@ -137,19 +137,19 @@ def compare(params) # Get engagement metrics for style tweets # - # @overload get_performance(username, request_options: {}) + # @overload get_performance(id, request_options: {}) # - # @param username [String] X username of cached style + # @param id [String] Style profile ID or X username # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::StyleGetPerformanceResponse] # # @see XTwitterScraper::Models::StyleGetPerformanceParams - def get_performance(username, params = {}) + def get_performance(id, params = {}) @client.request( method: :get, - path: ["styles/%1$s/performance", username], + path: ["styles/%1$s/performance", id], model: XTwitterScraper::Models::StyleGetPerformanceResponse, options: params[:request_options] ) diff --git a/lib/x_twitter_scraper/resources/support/tickets.rb b/lib/x_twitter_scraper/resources/support/tickets.rb index cd5fa5d..89eef61 100644 --- a/lib/x_twitter_scraper/resources/support/tickets.rb +++ b/lib/x_twitter_scraper/resources/support/tickets.rb @@ -31,7 +31,8 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] + # @param id [String] Support ticket ID + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::Support::TicketRetrieveResponse] @@ -50,8 +51,10 @@ def retrieve(id, params = {}) # # @overload update(id, status:, request_options: {}) # - # @param id [String] + # @param id [String] Support ticket ID to update + # # @param status [Symbol, XTwitterScraper::Models::Support::TicketUpdateParams::Status] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::Support::TicketUpdateResponse] @@ -90,8 +93,10 @@ def list(params = {}) # # @overload reply(id, body:, request_options: {}) # - # @param id [String] + # @param id [String] Support ticket ID for the reply + # # @param body [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::Support::TicketReplyResponse] diff --git a/lib/x_twitter_scraper/resources/trends.rb b/lib/x_twitter_scraper/resources/trends.rb index a22483c..134894e 100644 --- a/lib/x_twitter_scraper/resources/trends.rb +++ b/lib/x_twitter_scraper/resources/trends.rb @@ -4,11 +4,11 @@ module XTwitterScraper module Resources # Trending topics by region class Trends - # Get trending topics + # Get regional trending topics # # @overload list(count: nil, woeid: nil, request_options: {}) # - # @param count [Integer] + # @param count [Integer] Number of trending topics to return (1-50, default 30) # # @param woeid [Integer] Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) # diff --git a/lib/x_twitter_scraper/resources/webhooks.rb b/lib/x_twitter_scraper/resources/webhooks.rb index 875c9c9..e3bd142 100644 --- a/lib/x_twitter_scraper/resources/webhooks.rb +++ b/lib/x_twitter_scraper/resources/webhooks.rb @@ -8,7 +8,7 @@ class Webhooks # # @overload create(event_types:, url:, request_options: {}) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param url [String] HTTPS URL # @@ -34,7 +34,7 @@ def create(params) # # @param id [String] Resource ID (stringified bigint) # - # @param event_types [Array] + # @param event_types [Array] Array of event types to subscribe to. # # @param is_active [Boolean] # @@ -42,7 +42,7 @@ def create(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::WebhookUpdateResponse] + # @return [XTwitterScraper::Models::Webhook] # # @see XTwitterScraper::Models::WebhookUpdateParams def update(id, params = {}) @@ -51,7 +51,7 @@ def update(id, params = {}) method: :patch, path: ["webhooks/%1$s", id], body: parsed, - model: XTwitterScraper::Models::WebhookUpdateResponse, + model: XTwitterScraper::Webhook, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x.rb b/lib/x_twitter_scraper/resources/x.rb index a7bcdbc..61f73cf 100644 --- a/lib/x_twitter_scraper/resources/x.rb +++ b/lib/x_twitter_scraper/resources/x.rb @@ -45,7 +45,8 @@ class X # # @overload get_article(tweet_id, request_options: {}) # - # @param tweet_id [String] + # @param tweet_id [String] Tweet ID of the article + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::XGetArticleResponse] @@ -64,13 +65,13 @@ def get_article(tweet_id, params = {}) # # @overload get_home_timeline(cursor: nil, seen_tweet_ids: nil, request_options: {}) # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for timeline # # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::XGetHomeTimelineResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::XGetHomeTimelineParams def get_home_timeline(params = {}) @@ -80,7 +81,7 @@ def get_home_timeline(params = {}) method: :get, path: "x/timeline", query: query.transform_keys(seen_tweet_ids: "seenTweetIds"), - model: XTwitterScraper::Models::XGetHomeTimelineResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -89,7 +90,7 @@ def get_home_timeline(params = {}) # # @overload get_notifications(cursor: nil, type: nil, request_options: {}) # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for notifications # # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter # @@ -116,11 +117,16 @@ def get_notifications(params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::XGetTrendsResponse] # # @see XTwitterScraper::Models::XGetTrendsParams def get_trends(params = {}) - @client.request(method: :get, path: "x/trends", model: NilClass, options: params[:request_options]) + @client.request( + method: :get, + path: "x/trends", + model: XTwitterScraper::Models::XGetTrendsResponse, + options: params[:request_options] + ) end # @api private diff --git a/lib/x_twitter_scraper/resources/x/accounts.rb b/lib/x_twitter_scraper/resources/x/accounts.rb index d04a93c..ef832fb 100644 --- a/lib/x_twitter_scraper/resources/x/accounts.rb +++ b/lib/x_twitter_scraper/resources/x/accounts.rb @@ -44,14 +44,14 @@ def create(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::AccountRetrieveResponse] + # @return [XTwitterScraper::Models::X::XAccountDetail] # # @see XTwitterScraper::Models::X::AccountRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["x/accounts/%1$s", id], - model: XTwitterScraper::Models::X::AccountRetrieveResponse, + model: XTwitterScraper::X::XAccountDetail, security: {auth_api_key: true}, options: params[:request_options] ) @@ -97,15 +97,35 @@ def delete(id, params = {}) ) end + # Clears loginFailedAt and loginFailureReason for all accounts with transient or + # automated failure reasons, making them eligible for retry on next use. + # + # @overload bulk_retry(request_options: {}) + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::X::AccountBulkRetryResponse] + # + # @see XTwitterScraper::Models::X::AccountBulkRetryParams + def bulk_retry(params = {}) + @client.request( + method: :post, + path: "x/accounts/bulk-retry", + model: XTwitterScraper::Models::X::AccountBulkRetryResponse, + security: {auth_api_key: true}, + options: params[:request_options] + ) + end + # Re-authenticate X account # # @overload reauth(id, password:, totp_secret: nil, request_options: {}) # # @param id [String] Resource ID (stringified bigint) # - # @param password [String] Account password + # @param password [String] Updated account password # - # @param totp_secret [String] TOTP secret for 2FA + # @param totp_secret [String] TOTP secret for 2FA re-authentication # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/bookmarks.rb b/lib/x_twitter_scraper/resources/x/bookmarks.rb index 05e89ea..f46ff83 100644 --- a/lib/x_twitter_scraper/resources/x/bookmarks.rb +++ b/lib/x_twitter_scraper/resources/x/bookmarks.rb @@ -9,13 +9,13 @@ class Bookmarks # # @overload list(cursor: nil, folder_id: nil, request_options: {}) # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for bookmarks # # @param folder_id [String] Optional bookmark folder ID # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::BookmarkListResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::BookmarkListParams def list(params = {}) @@ -25,7 +25,7 @@ def list(params = {}) method: :get, path: "x/bookmarks", query: query.transform_keys(folder_id: "folderId"), - model: XTwitterScraper::Models::X::BookmarkListResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index f8a0a59..7c899df 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -16,7 +16,7 @@ class Communities # # @overload create(account:, name:, description: nil, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) creating the community # # @param name [String] Community name # @@ -44,7 +44,7 @@ def create(params) # # @param id [String] Resource ID (stringified bigint) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) deleting the community # # @param community_name [String] Community name for confirmation # @@ -88,13 +88,13 @@ def retrieve_info(id, params = {}) # # @overload retrieve_members(id, cursor: nil, request_options: {}) # - # @param id [String] Community ID + # @param id [String] Community ID for member lookup # # @param cursor [String] Pagination cursor # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::CommunityRetrieveMembersParams def retrieve_members(id, params = {}) @@ -104,7 +104,7 @@ def retrieve_members(id, params = {}) method: :get, path: ["x/communities/%1$s/members", id], query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -113,13 +113,13 @@ def retrieve_members(id, params = {}) # # @overload retrieve_moderators(id, cursor: nil, request_options: {}) # - # @param id [String] Community ID + # @param id [String] Community ID for moderator lookup # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for community moderators # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::CommunityRetrieveModeratorsParams def retrieve_moderators(id, params = {}) @@ -129,7 +129,7 @@ def retrieve_moderators(id, params = {}) method: :get, path: ["x/communities/%1$s/moderators", id], query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -140,13 +140,13 @@ def retrieve_moderators(id, params = {}) # # @param q [String] Search query # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for community search # # @param query_type [String] Sort order (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::CommunityRetrieveSearchParams def retrieve_search(params) @@ -156,7 +156,7 @@ def retrieve_search(params) method: :get, path: "x/communities/search", query: query.transform_keys(query_type: "queryType"), - model: NilClass, + model: XTwitterScraper::PaginatedTweets, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/communities/join.rb b/lib/x_twitter_scraper/resources/x/communities/join.rb index 17fe772..5f6a8fd 100644 --- a/lib/x_twitter_scraper/resources/x/communities/join.rb +++ b/lib/x_twitter_scraper/resources/x/communities/join.rb @@ -12,11 +12,11 @@ class Join # # @param id [String] Resource ID (stringified bigint) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse] + # @return [XTwitterScraper::Models::X::CommunityActionResult] # # @see XTwitterScraper::Models::X::Communities::JoinCreateParams def create(id, params) @@ -25,7 +25,7 @@ def create(id, params) method: :post, path: ["x/communities/%1$s/join", id], body: parsed, - model: XTwitterScraper::Models::X::Communities::JoinCreateResponse, + model: XTwitterScraper::X::CommunityActionResult, options: options ) end @@ -36,11 +36,11 @@ def create(id, params) # # @param id [String] Resource ID (stringified bigint) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse] + # @return [XTwitterScraper::Models::X::CommunityActionResult] # # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllParams def delete_all(id, params) @@ -49,7 +49,7 @@ def delete_all(id, params) method: :delete, path: ["x/communities/%1$s/join", id], body: parsed, - model: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse, + model: XTwitterScraper::X::CommunityActionResult, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/communities/tweets.rb b/lib/x_twitter_scraper/resources/x/communities/tweets.rb index d540b27..615b6de 100644 --- a/lib/x_twitter_scraper/resources/x/communities/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/communities/tweets.rb @@ -10,15 +10,15 @@ class Tweets # # @overload list(q:, cursor: nil, query_type: nil, request_options: {}) # - # @param q [String] Search query + # @param q [String] Search query for cross-community tweets # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for cross-community results # - # @param query_type [String] Sort order (Latest or Top) + # @param query_type [String] Sort order for cross-community results (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::Communities::TweetListParams def list(params) @@ -28,7 +28,32 @@ def list(params) method: :get, path: "x/communities/tweets", query: query.transform_keys(query_type: "queryType"), - model: NilClass, + model: XTwitterScraper::PaginatedTweets, + options: options + ) + end + + # Get community tweets + # + # @overload list_by_community(id, cursor: nil, request_options: {}) + # + # @param id [String] Community ID for tweet lookup + # + # @param cursor [String] Pagination cursor for community tweets + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::PaginatedTweets] + # + # @see XTwitterScraper::Models::X::Communities::TweetListByCommunityParams + def list_by_community(id, params = {}) + parsed, options = XTwitterScraper::X::Communities::TweetListByCommunityParams.dump_request(params) + query = XTwitterScraper::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["x/communities/%1$s/tweets", id], + query: query, + model: XTwitterScraper::PaginatedTweets, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/dm.rb b/lib/x_twitter_scraper/resources/x/dm.rb index 8762497..8cf352d 100644 --- a/lib/x_twitter_scraper/resources/x/dm.rb +++ b/lib/x_twitter_scraper/resources/x/dm.rb @@ -10,7 +10,7 @@ class Dm # # @param user_id [String] Target user ID # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for DM history # # @param max_id [String] Legacy pagination cursor (backward compat) # @@ -37,7 +37,7 @@ def retrieve_history(user_id, params = {}) # # @param user_id [String] Recipient user ID # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) sending the DM # # @param text [String] # diff --git a/lib/x_twitter_scraper/resources/x/lists.rb b/lib/x_twitter_scraper/resources/x/lists.rb index af67cd5..785b207 100644 --- a/lib/x_twitter_scraper/resources/x/lists.rb +++ b/lib/x_twitter_scraper/resources/x/lists.rb @@ -11,11 +11,11 @@ class Lists # # @param id [String] List ID # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list followers # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::ListRetrieveFollowersParams def retrieve_followers(id, params = {}) @@ -25,7 +25,7 @@ def retrieve_followers(id, params = {}) method: :get, path: ["x/lists/%1$s/followers", id], query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -34,13 +34,13 @@ def retrieve_followers(id, params = {}) # # @overload retrieve_members(id, cursor: nil, request_options: {}) # - # @param id [String] List ID + # @param id [String] List ID for member lookup # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list members # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::ListRetrieveMembersParams def retrieve_members(id, params = {}) @@ -50,7 +50,7 @@ def retrieve_members(id, params = {}) method: :get, path: ["x/lists/%1$s/members", id], query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -59,9 +59,9 @@ def retrieve_members(id, params = {}) # # @overload retrieve_tweets(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # - # @param id [String] List ID + # @param id [String] List ID for tweet lookup # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for list tweets # # @param include_replies [Boolean] Include replies (default false) # @@ -71,7 +71,7 @@ def retrieve_members(id, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::ListRetrieveTweetsParams def retrieve_tweets(id, params = {}) @@ -85,7 +85,7 @@ def retrieve_tweets(id, params = {}) since_time: "sinceTime", until_time: "untilTime" ), - model: NilClass, + model: XTwitterScraper::PaginatedTweets, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/media.rb b/lib/x_twitter_scraper/resources/x/media.rb index 32fa984..10af42c 100644 --- a/lib/x_twitter_scraper/resources/x/media.rb +++ b/lib/x_twitter_scraper/resources/x/media.rb @@ -33,7 +33,7 @@ def download(params = {}) # # @overload upload(account:, file:, is_long_video: nil, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) uploading media # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Media file to upload # diff --git a/lib/x_twitter_scraper/resources/x/profile.rb b/lib/x_twitter_scraper/resources/x/profile.rb index 22cad34..cafdcb9 100644 --- a/lib/x_twitter_scraper/resources/x/profile.rb +++ b/lib/x_twitter_scraper/resources/x/profile.rb @@ -9,7 +9,7 @@ class Profile # # @overload update(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) to update profile # # @param description [String] Bio description # @@ -39,7 +39,7 @@ def update(params) # # @overload update_avatar(account:, file:, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) for avatar update # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Avatar image (max 716KB) # @@ -64,7 +64,7 @@ def update_avatar(params) # # @overload update_banner(account:, file:, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] X account (@username or ID) for banner update # # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Banner image (max 2MB) # diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index 93714af..2ab9e5d 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -48,18 +48,19 @@ def create(params) # Look up tweet # - # @overload retrieve(tweet_id, request_options: {}) + # @overload retrieve(id, request_options: {}) + # + # @param id [String] Tweet ID # - # @param tweet_id [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::TweetRetrieveResponse] # # @see XTwitterScraper::Models::X::TweetRetrieveParams - def retrieve(tweet_id, params = {}) + def retrieve(id, params = {}) @client.request( method: :get, - path: ["x/tweets/%1$s", tweet_id], + path: ["x/tweets/%1$s", id], model: XTwitterScraper::Models::X::TweetRetrieveResponse, options: params[:request_options] ) @@ -73,33 +74,39 @@ def retrieve(tweet_id, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::TweetListParams def list(params) parsed, options = XTwitterScraper::X::TweetListParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) - @client.request(method: :get, path: "x/tweets", query: query, model: NilClass, options: options) + @client.request( + method: :get, + path: "x/tweets", + query: query, + model: XTwitterScraper::PaginatedTweets, + options: options + ) end # Delete tweet # - # @overload delete(tweet_id, account:, request_options: {}) + # @overload delete(id, account:, request_options: {}) # - # @param tweet_id [String] + # @param id [String] Tweet ID to delete # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::TweetDeleteResponse] # # @see XTwitterScraper::Models::X::TweetDeleteParams - def delete(tweet_id, params) + def delete(id, params) parsed, options = XTwitterScraper::X::TweetDeleteParams.dump_request(params) @client.request( method: :delete, - path: ["x/tweets/%1$s", tweet_id], + path: ["x/tweets/%1$s", id], body: parsed, model: XTwitterScraper::Models::X::TweetDeleteResponse, options: options @@ -110,13 +117,13 @@ def delete(tweet_id, params) # # @overload get_favoriters(id, cursor: nil, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Tweet ID to get favoriters # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for favoriters # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetGetFavoritersResponse] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::TweetGetFavoritersParams def get_favoriters(id, params = {}) @@ -126,7 +133,7 @@ def get_favoriters(id, params = {}) method: :get, path: ["x/tweets/%1$s/favoriters", id], query: query, - model: XTwitterScraper::Models::X::TweetGetFavoritersResponse, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -135,19 +142,19 @@ def get_favoriters(id, params = {}) # # @overload get_quotes(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Tweet ID to get quotes # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for quote tweets # - # @param include_replies [Boolean] Include replies (default false) + # @param include_replies [Boolean] Include reply quotes (default false) # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return quotes posted after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return quotes posted before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetGetQuotesResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::TweetGetQuotesParams def get_quotes(id, params = {}) @@ -161,7 +168,7 @@ def get_quotes(id, params = {}) since_time: "sinceTime", until_time: "untilTime" ), - model: XTwitterScraper::Models::X::TweetGetQuotesResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -170,17 +177,17 @@ def get_quotes(id, params = {}) # # @overload get_replies(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Tweet ID to get replies # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for tweet replies # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return replies posted after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return replies posted before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetGetRepliesResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::TweetGetRepliesParams def get_replies(id, params = {}) @@ -190,7 +197,7 @@ def get_replies(id, params = {}) method: :get, path: ["x/tweets/%1$s/replies", id], query: query.transform_keys(since_time: "sinceTime", until_time: "untilTime"), - model: XTwitterScraper::Models::X::TweetGetRepliesResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -199,13 +206,13 @@ def get_replies(id, params = {}) # # @overload get_retweeters(id, cursor: nil, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Tweet ID to get retweeters # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for retweeters # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetGetRetweetersResponse] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::TweetGetRetweetersParams def get_retweeters(id, params = {}) @@ -215,7 +222,7 @@ def get_retweeters(id, params = {}) method: :get, path: ["x/tweets/%1$s/retweeters", id], query: query, - model: XTwitterScraper::Models::X::TweetGetRetweetersResponse, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -224,13 +231,13 @@ def get_retweeters(id, params = {}) # # @overload get_thread(id, cursor: nil, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Tweet ID to get thread context # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for thread tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetGetThreadResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::TweetGetThreadParams def get_thread(id, params = {}) @@ -240,7 +247,7 @@ def get_thread(id, params = {}) method: :get, path: ["x/tweets/%1$s/thread", id], query: query, - model: XTwitterScraper::Models::X::TweetGetThreadResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -253,7 +260,7 @@ def get_thread(id, params = {}) # # @param cursor [String] Pagination cursor from previous response # - # @param limit [Integer] Deprecated — use cursor-based pagination instead + # @param limit [Integer] Max tweets to return (server paginates internally). Omit for single page (~20). # # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order — Latest (chronological) or Top (engagement-ranked) # @@ -263,7 +270,7 @@ def get_thread(id, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::TweetSearchResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::TweetSearchParams def search(params) @@ -277,7 +284,7 @@ def search(params) since_time: "sinceTime", until_time: "untilTime" ), - model: XTwitterScraper::Models::X::TweetSearchResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/tweets/like.rb b/lib/x_twitter_scraper/resources/x/tweets/like.rb index a45f934..483942c 100644 --- a/lib/x_twitter_scraper/resources/x/tweets/like.rb +++ b/lib/x_twitter_scraper/resources/x/tweets/like.rb @@ -8,22 +8,22 @@ class Tweets class Like # Like tweet # - # @overload create(tweet_id, account:, request_options: {}) + # @overload create(id, account:, request_options: {}) # - # @param tweet_id [String] + # @param id [String] Tweet ID to like # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse] # # @see XTwitterScraper::Models::X::Tweets::LikeCreateParams - def create(tweet_id, params) + def create(id, params) parsed, options = XTwitterScraper::X::Tweets::LikeCreateParams.dump_request(params) @client.request( method: :post, - path: ["x/tweets/%1$s/like", tweet_id], + path: ["x/tweets/%1$s/like", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::LikeCreateResponse, options: options @@ -32,22 +32,22 @@ def create(tweet_id, params) # Unlike tweet # - # @overload delete(tweet_id, account:, request_options: {}) + # @overload delete(id, account:, request_options: {}) # - # @param tweet_id [String] + # @param id [String] Tweet ID to unlike # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse] # # @see XTwitterScraper::Models::X::Tweets::LikeDeleteParams - def delete(tweet_id, params) + def delete(id, params) parsed, options = XTwitterScraper::X::Tweets::LikeDeleteParams.dump_request(params) @client.request( method: :delete, - path: ["x/tweets/%1$s/like", tweet_id], + path: ["x/tweets/%1$s/like", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse, options: options diff --git a/lib/x_twitter_scraper/resources/x/tweets/retweet.rb b/lib/x_twitter_scraper/resources/x/tweets/retweet.rb index 518b740..7571505 100644 --- a/lib/x_twitter_scraper/resources/x/tweets/retweet.rb +++ b/lib/x_twitter_scraper/resources/x/tweets/retweet.rb @@ -8,22 +8,22 @@ class Tweets class Retweet # Retweet # - # @overload create(tweet_id, account:, request_options: {}) + # @overload create(id, account:, request_options: {}) # - # @param tweet_id [String] + # @param id [String] Tweet ID to retweet # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse] # # @see XTwitterScraper::Models::X::Tweets::RetweetCreateParams - def create(tweet_id, params) + def create(id, params) parsed, options = XTwitterScraper::X::Tweets::RetweetCreateParams.dump_request(params) @client.request( method: :post, - path: ["x/tweets/%1$s/retweet", tweet_id], + path: ["x/tweets/%1$s/retweet", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse, options: options @@ -32,22 +32,22 @@ def create(tweet_id, params) # Unretweet # - # @overload delete(tweet_id, account:, request_options: {}) + # @overload delete(id, account:, request_options: {}) # - # @param tweet_id [String] + # @param id [String] Tweet ID to unretweet # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse] # # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteParams - def delete(tweet_id, params) + def delete(id, params) parsed, options = XTwitterScraper::X::Tweets::RetweetDeleteParams.dump_request(params) @client.request( method: :delete, - path: ["x/tweets/%1$s/retweet", tweet_id], + path: ["x/tweets/%1$s/retweet", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse, options: options diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index cafe029..4fb06d8 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -11,20 +11,20 @@ class Users # Look up X user # - # @overload retrieve(username, request_options: {}) + # @overload retrieve(id, request_options: {}) # - # @param username [String] X username (without @) + # @param id [String] X username (without @) or user ID # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserRetrieveResponse] + # @return [XTwitterScraper::Models::X::UserProfile] # # @see XTwitterScraper::Models::X::UserRetrieveParams - def retrieve(username, params = {}) + def retrieve(id, params = {}) @client.request( method: :get, - path: ["x/users/%1$s", username], - model: XTwitterScraper::Models::X::UserRetrieveResponse, + path: ["x/users/%1$s", id], + model: XTwitterScraper::X::UserProfile, options: params[:request_options] ) end @@ -37,7 +37,7 @@ def retrieve(username, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveBatchParams def retrieve_batch(params) @@ -47,7 +47,7 @@ def retrieve_batch(params) method: :get, path: "x/users/batch", query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -58,13 +58,13 @@ def retrieve_batch(params) # # @param id [String] User ID or username # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for followers list # # @param page_size [Integer] Items per page (20-200, default 200) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveFollowersParams def retrieve_followers(id, params = {}) @@ -74,7 +74,7 @@ def retrieve_followers(id, params = {}) method: :get, path: ["x/users/%1$s/followers", id], query: query.transform_keys(page_size: "pageSize"), - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -83,13 +83,13 @@ def retrieve_followers(id, params = {}) # # @overload retrieve_followers_you_know(id, cursor: nil, request_options: {}) # - # @param id [String] User ID + # @param id [String] User ID for followers-you-know lookup # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for followers-you-know # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowParams def retrieve_followers_you_know(id, params = {}) @@ -99,7 +99,7 @@ def retrieve_followers_you_know(id, params = {}) method: :get, path: ["x/users/%1$s/followers-you-know", id], query: query, - model: XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -108,15 +108,15 @@ def retrieve_followers_you_know(id, params = {}) # # @overload retrieve_following(id, cursor: nil, page_size: nil, request_options: {}) # - # @param id [String] User ID or username + # @param id [String] User ID or username for following lookup # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for following list # - # @param page_size [Integer] Items per page (20-200, default 200) + # @param page_size [Integer] Results per page (20-200, default 200) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveFollowingParams def retrieve_following(id, params = {}) @@ -126,7 +126,7 @@ def retrieve_following(id, params = {}) method: :get, path: ["x/users/%1$s/following", id], query: query.transform_keys(page_size: "pageSize"), - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -137,11 +137,11 @@ def retrieve_following(id, params = {}) # # @param id [String] User ID # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for liked tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserRetrieveLikesResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::UserRetrieveLikesParams def retrieve_likes(id, params = {}) @@ -151,7 +151,7 @@ def retrieve_likes(id, params = {}) method: :get, path: ["x/users/%1$s/likes", id], query: query, - model: XTwitterScraper::Models::X::UserRetrieveLikesResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -160,13 +160,13 @@ def retrieve_likes(id, params = {}) # # @overload retrieve_media(id, cursor: nil, request_options: {}) # - # @param id [String] User ID + # @param id [String] User ID for media lookup # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for media tweets # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserRetrieveMediaResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::UserRetrieveMediaParams def retrieve_media(id, params = {}) @@ -176,7 +176,7 @@ def retrieve_media(id, params = {}) method: :get, path: ["x/users/%1$s/media", id], query: query, - model: XTwitterScraper::Models::X::UserRetrieveMediaResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -185,17 +185,17 @@ def retrieve_media(id, params = {}) # # @overload retrieve_mentions(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # - # @param id [String] User ID or username + # @param id [String] User ID or username for mentions lookup # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for mentions # - # @param since_time [String] Unix timestamp - filter after + # @param since_time [String] Unix timestamp - return mentions after this time # - # @param until_time [String] Unix timestamp - filter before + # @param until_time [String] Unix timestamp - return mentions before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::UserRetrieveMentionsParams def retrieve_mentions(id, params = {}) @@ -205,7 +205,7 @@ def retrieve_mentions(id, params = {}) method: :get, path: ["x/users/%1$s/mentions", id], query: query.transform_keys(since_time: "sinceTime", until_time: "untilTime"), - model: NilClass, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -214,13 +214,13 @@ def retrieve_mentions(id, params = {}) # # @overload retrieve_search(q:, cursor: nil, request_options: {}) # - # @param q [String] Search query + # @param q [String] User search query # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for user search # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveSearchParams def retrieve_search(params) @@ -230,7 +230,7 @@ def retrieve_search(params) method: :get, path: "x/users/search", query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end @@ -239,9 +239,9 @@ def retrieve_search(params) # # @overload retrieve_tweets(id, cursor: nil, include_parent_tweet: nil, include_replies: nil, request_options: {}) # - # @param id [String] + # @param id [String] X user ID or username # - # @param cursor [String] Pagination cursor from previous response + # @param cursor [String] Pagination cursor for user tweets # # @param include_parent_tweet [Boolean] Include parent tweet for replies # @@ -249,7 +249,7 @@ def retrieve_search(params) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserRetrieveTweetsResponse] + # @return [XTwitterScraper::Models::PaginatedTweets] # # @see XTwitterScraper::Models::X::UserRetrieveTweetsParams def retrieve_tweets(id, params = {}) @@ -262,7 +262,7 @@ def retrieve_tweets(id, params = {}) include_parent_tweet: "includeParentTweet", include_replies: "includeReplies" ), - model: XTwitterScraper::Models::X::UserRetrieveTweetsResponse, + model: XTwitterScraper::PaginatedTweets, options: options ) end @@ -271,13 +271,13 @@ def retrieve_tweets(id, params = {}) # # @overload retrieve_verified_followers(id, cursor: nil, request_options: {}) # - # @param id [String] User ID or username + # @param id [String] User ID or username for verified followers # - # @param cursor [String] Pagination cursor + # @param cursor [String] Pagination cursor for verified followers # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [nil] + # @return [XTwitterScraper::Models::PaginatedUsers] # # @see XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersParams def retrieve_verified_followers(id, params = {}) @@ -287,7 +287,7 @@ def retrieve_verified_followers(id, params = {}) method: :get, path: ["x/users/%1$s/verified-followers", id], query: query, - model: NilClass, + model: XTwitterScraper::PaginatedUsers, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/users/follow.rb b/lib/x_twitter_scraper/resources/x/users/follow.rb index edeea72..1272c93 100644 --- a/lib/x_twitter_scraper/resources/x/users/follow.rb +++ b/lib/x_twitter_scraper/resources/x/users/follow.rb @@ -8,22 +8,22 @@ class Users class Follow # Follow user # - # @overload create(user_id, account:, request_options: {}) + # @overload create(id, account:, request_options: {}) # - # @param user_id [String] User ID to follow + # @param id [String] User ID to follow # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse] # # @see XTwitterScraper::Models::X::Users::FollowCreateParams - def create(user_id, params) + def create(id, params) parsed, options = XTwitterScraper::X::Users::FollowCreateParams.dump_request(params) @client.request( method: :post, - path: ["x/users/%1$s/follow", user_id], + path: ["x/users/%1$s/follow", id], body: parsed, model: XTwitterScraper::Models::X::Users::FollowCreateResponse, options: options @@ -32,22 +32,22 @@ def create(user_id, params) # Unfollow user # - # @overload delete_all(user_id, account:, request_options: {}) + # @overload delete_all(id, account:, request_options: {}) # - # @param user_id [String] User ID to unfollow + # @param id [String] User ID to unfollow # - # @param account [String] X account (@username or account ID) + # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse] # # @see XTwitterScraper::Models::X::Users::FollowDeleteAllParams - def delete_all(user_id, params) + def delete_all(id, params) parsed, options = XTwitterScraper::X::Users::FollowDeleteAllParams.dump_request(params) @client.request( method: :delete, - path: ["x/users/%1$s/follow", user_id], + path: ["x/users/%1$s/follow", id], body: parsed, model: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse, options: options diff --git a/lib/x_twitter_scraper/version.rb b/lib/x_twitter_scraper/version.rb index ae36159..3acf7ad 100644 --- a/lib/x_twitter_scraper/version.rb +++ b/lib/x_twitter_scraper/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module XTwitterScraper - VERSION = "0.3.0" + VERSION = "0.4.0" end diff --git a/rbi/x_twitter_scraper/models/api_key.rbi b/rbi/x_twitter_scraper/models/api_key.rbi index 8dcd825..a6d9126 100644 --- a/rbi/x_twitter_scraper/models/api_key.rbi +++ b/rbi/x_twitter_scraper/models/api_key.rbi @@ -29,6 +29,7 @@ module XTwitterScraper sig { params(last_used_at: Time).void } attr_writer :last_used_at + # API key metadata returned when listing keys. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/api_key_list_response.rbi b/rbi/x_twitter_scraper/models/api_key_list_response.rbi index ab7150b..e8a3dd2 100644 --- a/rbi/x_twitter_scraper/models/api_key_list_response.rbi +++ b/rbi/x_twitter_scraper/models/api_key_list_response.rbi @@ -11,93 +11,20 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::APIKeyListResponse::Key]) - end + sig { returns(T::Array[XTwitterScraper::APIKey]) } attr_accessor :keys sig do - params( - keys: - T::Array[XTwitterScraper::Models::APIKeyListResponse::Key::OrHash] - ).returns(T.attached_class) + params(keys: T::Array[XTwitterScraper::APIKey::OrHash]).returns( + T.attached_class + ) end def self.new(keys:) end - sig do - override.returns( - { keys: T::Array[XTwitterScraper::Models::APIKeyListResponse::Key] } - ) - end + sig { override.returns({ keys: T::Array[XTwitterScraper::APIKey] }) } def to_hash end - - class Key < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::APIKeyListResponse::Key, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :prefix - - sig { returns(T.nilable(Time)) } - attr_reader :last_used_at - - sig { params(last_used_at: Time).void } - attr_writer :last_used_at - - sig do - params( - id: String, - created_at: Time, - is_active: T::Boolean, - name: String, - prefix: String, - last_used_at: Time - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - is_active:, - name:, - prefix:, - last_used_at: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - is_active: T::Boolean, - name: String, - prefix: String, - last_used_at: Time - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/delivery.rbi b/rbi/x_twitter_scraper/models/delivery.rbi index 3e87327..d0f5bc6 100644 --- a/rbi/x_twitter_scraper/models/delivery.rbi +++ b/rbi/x_twitter_scraper/models/delivery.rbi @@ -41,6 +41,7 @@ module XTwitterScraper sig { params(last_status_code: Integer).void } attr_writer :last_status_code + # Webhook delivery attempt record with status and retry count. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/draft.rbi b/rbi/x_twitter_scraper/models/draft.rbi index 457eed3..d51cbfa 100644 --- a/rbi/x_twitter_scraper/models/draft.rbi +++ b/rbi/x_twitter_scraper/models/draft.rbi @@ -29,6 +29,7 @@ module XTwitterScraper sig { params(topic: String).void } attr_writer :topic + # Saved tweet draft with optional topic and goal. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/draft_create_response.rbi b/rbi/x_twitter_scraper/models/draft_create_response.rbi deleted file mode 100644 index 8682972..0000000 --- a/rbi/x_twitter_scraper/models/draft_create_response.rbi +++ /dev/null @@ -1,67 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class DraftCreateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DraftCreateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :text - - sig { returns(Time) } - attr_accessor :updated_at - - sig { returns(T.nilable(String)) } - attr_reader :goal - - sig { params(goal: String).void } - attr_writer :goal - - sig { returns(T.nilable(String)) } - attr_reader :topic - - sig { params(topic: String).void } - attr_writer :topic - - sig do - params( - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, text:, updated_at:, goal: nil, topic: nil) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/draft_detail.rbi b/rbi/x_twitter_scraper/models/draft_detail.rbi index 3ad3318..047678c 100644 --- a/rbi/x_twitter_scraper/models/draft_detail.rbi +++ b/rbi/x_twitter_scraper/models/draft_detail.rbi @@ -35,6 +35,7 @@ module XTwitterScraper sig { params(topic: String).void } attr_writer :topic + # Full tweet draft including update timestamp. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/draft_list_params.rbi b/rbi/x_twitter_scraper/models/draft_list_params.rbi index 99cceca..d8639d4 100644 --- a/rbi/x_twitter_scraper/models/draft_list_params.rbi +++ b/rbi/x_twitter_scraper/models/draft_list_params.rbi @@ -21,6 +21,7 @@ module XTwitterScraper sig { params(after_cursor: String).void } attr_writer :after_cursor + # Maximum number of items to return (1-100, default 50) sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -37,6 +38,7 @@ module XTwitterScraper def self.new( # Cursor for pagination after_cursor: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/draft_list_response.rbi b/rbi/x_twitter_scraper/models/draft_list_response.rbi index dfb8449..60eda0c 100644 --- a/rbi/x_twitter_scraper/models/draft_list_response.rbi +++ b/rbi/x_twitter_scraper/models/draft_list_response.rbi @@ -11,9 +11,7 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::DraftListResponse::Draft]) - end + sig { returns(T::Array[XTwitterScraper::Draft]) } attr_accessor :drafts sig { returns(T::Boolean) } @@ -27,8 +25,7 @@ module XTwitterScraper sig do params( - drafts: - T::Array[XTwitterScraper::Models::DraftListResponse::Draft::OrHash], + drafts: T::Array[XTwitterScraper::Draft::OrHash], has_more: T::Boolean, next_cursor: String ).returns(T.attached_class) @@ -39,7 +36,7 @@ module XTwitterScraper sig do override.returns( { - drafts: T::Array[XTwitterScraper::Models::DraftListResponse::Draft], + drafts: T::Array[XTwitterScraper::Draft], has_more: T::Boolean, next_cursor: String } @@ -47,63 +44,6 @@ module XTwitterScraper end def to_hash end - - class Draft < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DraftListResponse::Draft, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :goal - - sig { params(goal: String).void } - attr_writer :goal - - sig { returns(T.nilable(String)) } - attr_reader :topic - - sig { params(topic: String).void } - attr_writer :topic - - sig do - params( - id: String, - created_at: Time, - text: String, - goal: String, - topic: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, text:, goal: nil, topic: nil) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - text: String, - goal: String, - topic: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/draft_retrieve_response.rbi b/rbi/x_twitter_scraper/models/draft_retrieve_response.rbi deleted file mode 100644 index e76e428..0000000 --- a/rbi/x_twitter_scraper/models/draft_retrieve_response.rbi +++ /dev/null @@ -1,67 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class DraftRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DraftRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :text - - sig { returns(Time) } - attr_accessor :updated_at - - sig { returns(T.nilable(String)) } - attr_reader :goal - - sig { params(goal: String).void } - attr_writer :goal - - sig { returns(T.nilable(String)) } - attr_reader :topic - - sig { params(topic: String).void } - attr_writer :topic - - sig do - params( - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, text:, updated_at:, goal: nil, topic: nil) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/draw_detail.rbi b/rbi/x_twitter_scraper/models/draw_detail.rbi index aa9bb9a..ee9f32f 100644 --- a/rbi/x_twitter_scraper/models/draw_detail.rbi +++ b/rbi/x_twitter_scraper/models/draw_detail.rbi @@ -53,6 +53,7 @@ module XTwitterScraper sig { params(drawn_at: Time).void } attr_writer :drawn_at + # Full giveaway draw with tweet metrics, entries, and timing. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/draw_export_params.rbi b/rbi/x_twitter_scraper/models/draw_export_params.rbi index c79407b..60bd8f4 100644 --- a/rbi/x_twitter_scraper/models/draw_export_params.rbi +++ b/rbi/x_twitter_scraper/models/draw_export_params.rbi @@ -17,6 +17,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Export output format sig do returns(T.nilable(XTwitterScraper::DrawExportParams::Format::OrSymbol)) end @@ -50,6 +51,7 @@ module XTwitterScraper end def self.new( id:, + # Export output format format_: nil, # Export winners or all entries type: nil, @@ -70,6 +72,7 @@ module XTwitterScraper def to_hash end + # Export output format module Format extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/draw_list_item.rbi b/rbi/x_twitter_scraper/models/draw_list_item.rbi index ac76826..16387e7 100644 --- a/rbi/x_twitter_scraper/models/draw_list_item.rbi +++ b/rbi/x_twitter_scraper/models/draw_list_item.rbi @@ -35,6 +35,7 @@ module XTwitterScraper sig { params(drawn_at: Time).void } attr_writer :drawn_at + # Giveaway draw summary with entry counts and status. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/draw_list_params.rbi b/rbi/x_twitter_scraper/models/draw_list_params.rbi index 9a59400..fc1b5bd 100644 --- a/rbi/x_twitter_scraper/models/draw_list_params.rbi +++ b/rbi/x_twitter_scraper/models/draw_list_params.rbi @@ -14,13 +14,14 @@ module XTwitterScraper ) end - # Cursor for pagination + # Cursor for keyset pagination sig { returns(T.nilable(String)) } attr_reader :after sig { params(after: String).void } attr_writer :after + # Maximum number of items to return (1-100, default 50) sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -35,8 +36,9 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/draw_list_response.rbi b/rbi/x_twitter_scraper/models/draw_list_response.rbi index ff4cb3e..664d21f 100644 --- a/rbi/x_twitter_scraper/models/draw_list_response.rbi +++ b/rbi/x_twitter_scraper/models/draw_list_response.rbi @@ -11,7 +11,7 @@ module XTwitterScraper ) end - sig { returns(T::Array[XTwitterScraper::Models::DrawListResponse::Draw]) } + sig { returns(T::Array[XTwitterScraper::DrawListItem]) } attr_accessor :draws sig { returns(T::Boolean) } @@ -25,8 +25,7 @@ module XTwitterScraper sig do params( - draws: - T::Array[XTwitterScraper::Models::DrawListResponse::Draw::OrHash], + draws: T::Array[XTwitterScraper::DrawListItem::OrHash], has_more: T::Boolean, next_cursor: String ).returns(T.attached_class) @@ -37,7 +36,7 @@ module XTwitterScraper sig do override.returns( { - draws: T::Array[XTwitterScraper::Models::DrawListResponse::Draw], + draws: T::Array[XTwitterScraper::DrawListItem], has_more: T::Boolean, next_cursor: String } @@ -45,78 +44,6 @@ module XTwitterScraper end def to_hash end - - class Draw < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DrawListResponse::Draw, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :status - - sig { returns(Integer) } - attr_accessor :total_entries - - sig { returns(String) } - attr_accessor :tweet_url - - sig { returns(Integer) } - attr_accessor :valid_entries - - sig { returns(T.nilable(Time)) } - attr_reader :drawn_at - - sig { params(drawn_at: Time).void } - attr_writer :drawn_at - - sig do - params( - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - status:, - total_entries:, - tweet_url:, - valid_entries:, - drawn_at: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/draw_retrieve_response.rbi b/rbi/x_twitter_scraper/models/draw_retrieve_response.rbi index 4886465..3749ed4 100644 --- a/rbi/x_twitter_scraper/models/draw_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/draw_retrieve_response.rbi @@ -11,204 +11,39 @@ module XTwitterScraper ) end - sig { returns(XTwitterScraper::Models::DrawRetrieveResponse::Draw) } + # Full giveaway draw with tweet metrics, entries, and timing. + sig { returns(XTwitterScraper::DrawDetail) } attr_reader :draw - sig do - params( - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw::OrHash - ).void - end + sig { params(draw: XTwitterScraper::DrawDetail::OrHash).void } attr_writer :draw - sig do - returns(T::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner]) - end + sig { returns(T::Array[XTwitterScraper::Winner]) } attr_accessor :winners sig do params( - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw::OrHash, - winners: - T::Array[ - XTwitterScraper::Models::DrawRetrieveResponse::Winner::OrHash - ] + draw: XTwitterScraper::DrawDetail::OrHash, + winners: T::Array[XTwitterScraper::Winner::OrHash] ).returns(T.attached_class) end - def self.new(draw:, winners:) + def self.new( + # Full giveaway draw with tweet metrics, entries, and timing. + draw:, + winners: + ) end sig do override.returns( { - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw, - winners: - T::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner] + draw: XTwitterScraper::DrawDetail, + winners: T::Array[XTwitterScraper::Winner] } ) end def to_hash end - - class Draw < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DrawRetrieveResponse::Draw, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :status - - sig { returns(Integer) } - attr_accessor :total_entries - - sig { returns(String) } - attr_accessor :tweet_author_username - - sig { returns(String) } - attr_accessor :tweet_id - - sig { returns(Integer) } - attr_accessor :tweet_like_count - - sig { returns(Integer) } - attr_accessor :tweet_quote_count - - sig { returns(Integer) } - attr_accessor :tweet_reply_count - - sig { returns(Integer) } - attr_accessor :tweet_retweet_count - - sig { returns(String) } - attr_accessor :tweet_text - - sig { returns(String) } - attr_accessor :tweet_url - - sig { returns(Integer) } - attr_accessor :valid_entries - - sig { returns(T.nilable(Time)) } - attr_reader :drawn_at - - sig { params(drawn_at: Time).void } - attr_writer :drawn_at - - sig do - params( - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_author_username: String, - tweet_id: String, - tweet_like_count: Integer, - tweet_quote_count: Integer, - tweet_reply_count: Integer, - tweet_retweet_count: Integer, - tweet_text: String, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - status:, - total_entries:, - tweet_author_username:, - tweet_id:, - tweet_like_count:, - tweet_quote_count:, - tweet_reply_count:, - tweet_retweet_count:, - tweet_text:, - tweet_url:, - valid_entries:, - drawn_at: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_author_username: String, - tweet_id: String, - tweet_like_count: Integer, - tweet_quote_count: Integer, - tweet_reply_count: Integer, - tweet_retweet_count: Integer, - tweet_text: String, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - ) - end - def to_hash - end - end - - class Winner < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DrawRetrieveResponse::Winner, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :author_username - - sig { returns(T::Boolean) } - attr_accessor :is_backup - - sig { returns(Integer) } - attr_accessor :position - - sig { returns(String) } - attr_accessor :tweet_id - - sig do - params( - author_username: String, - is_backup: T::Boolean, - position: Integer, - tweet_id: String - ).returns(T.attached_class) - end - def self.new(author_username:, is_backup:, position:, tweet_id:) - end - - sig do - override.returns( - { - author_username: String, - is_backup: T::Boolean, - position: Integer, - tweet_id: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/draw_run_response.rbi b/rbi/x_twitter_scraper/models/draw_run_response.rbi index 0c26238..33b2005 100644 --- a/rbi/x_twitter_scraper/models/draw_run_response.rbi +++ b/rbi/x_twitter_scraper/models/draw_run_response.rbi @@ -23,9 +23,7 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :valid_entries - sig do - returns(T::Array[XTwitterScraper::Models::DrawRunResponse::Winner]) - end + sig { returns(T::Array[XTwitterScraper::Winner]) } attr_accessor :winners sig do @@ -34,8 +32,7 @@ module XTwitterScraper total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: - T::Array[XTwitterScraper::Models::DrawRunResponse::Winner::OrHash] + winners: T::Array[XTwitterScraper::Winner::OrHash] ).returns(T.attached_class) end def self.new(id:, total_entries:, tweet_id:, valid_entries:, winners:) @@ -48,58 +45,12 @@ module XTwitterScraper total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: T::Array[XTwitterScraper::Models::DrawRunResponse::Winner] + winners: T::Array[XTwitterScraper::Winner] } ) end def to_hash end - - class Winner < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::DrawRunResponse::Winner, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :author_username - - sig { returns(T::Boolean) } - attr_accessor :is_backup - - sig { returns(Integer) } - attr_accessor :position - - sig { returns(String) } - attr_accessor :tweet_id - - sig do - params( - author_username: String, - is_backup: T::Boolean, - position: Integer, - tweet_id: String - ).returns(T.attached_class) - end - def self.new(author_username:, is_backup:, position:, tweet_id:) - end - - sig do - override.returns( - { - author_username: String, - is_backup: T::Boolean, - position: Integer, - tweet_id: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index 049d07e..1bff9f2 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -11,6 +11,7 @@ module XTwitterScraper sig { returns(XTwitterScraper::Error::Error::OrSymbol) } attr_accessor :error + # Error response containing a machine-readable error code. sig do params(error: XTwitterScraper::Error::Error::OrSymbol).returns( T.attached_class diff --git a/rbi/x_twitter_scraper/models/event.rbi b/rbi/x_twitter_scraper/models/event.rbi index 21515f8..c5725db 100644 --- a/rbi/x_twitter_scraper/models/event.rbi +++ b/rbi/x_twitter_scraper/models/event.rbi @@ -20,23 +20,33 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :occurred_at - sig { returns(XTwitterScraper::Event::Type::OrSymbol) } + # Type of monitor event fired when account activity occurs. + sig { returns(XTwitterScraper::EventType::TaggedSymbol) } attr_accessor :type sig { returns(String) } attr_accessor :username + # Monitor event summary with type, username, and occurrence time. sig do params( id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Event::Type::OrSymbol, + type: XTwitterScraper::EventType::OrSymbol, username: String ).returns(T.attached_class) end - def self.new(id:, data:, monitor_id:, occurred_at:, type:, username:) + def self.new( + id:, + data:, + monitor_id:, + occurred_at:, + # Type of monitor event fired when account activity occurs. + type:, + username: + ) end sig do @@ -46,40 +56,13 @@ module XTwitterScraper data: T::Hash[Symbol, T.anything], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Event::Type::OrSymbol, + type: XTwitterScraper::EventType::TaggedSymbol, username: String } ) end def to_hash end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::Event::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let(:"tweet.new", XTwitterScraper::Event::Type::TaggedSymbol) - TWEET_REPLY = - T.let(:"tweet.reply", XTwitterScraper::Event::Type::TaggedSymbol) - TWEET_RETWEET = - T.let(:"tweet.retweet", XTwitterScraper::Event::Type::TaggedSymbol) - TWEET_QUOTE = - T.let(:"tweet.quote", XTwitterScraper::Event::Type::TaggedSymbol) - FOLLOWER_GAINED = - T.let(:"follower.gained", XTwitterScraper::Event::Type::TaggedSymbol) - FOLLOWER_LOST = - T.let(:"follower.lost", XTwitterScraper::Event::Type::TaggedSymbol) - - sig do - override.returns(T::Array[XTwitterScraper::Event::Type::TaggedSymbol]) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/event_detail.rbi b/rbi/x_twitter_scraper/models/event_detail.rbi index 9b52aa0..c5e3279 100644 --- a/rbi/x_twitter_scraper/models/event_detail.rbi +++ b/rbi/x_twitter_scraper/models/event_detail.rbi @@ -24,7 +24,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :occurred_at - sig { returns(XTwitterScraper::EventDetail::Type::OrSymbol) } + # Type of monitor event fired when account activity occurs. + sig { returns(XTwitterScraper::EventType::TaggedSymbol) } attr_accessor :type sig { returns(String) } @@ -36,13 +37,14 @@ module XTwitterScraper sig { params(x_event_id: String).void } attr_writer :x_event_id + # Full monitor event including payload data and optional X event ID. sig do params( id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::EventDetail::Type::OrSymbol, + type: XTwitterScraper::EventType::OrSymbol, username: String, x_event_id: String ).returns(T.attached_class) @@ -53,6 +55,7 @@ module XTwitterScraper data:, monitor_id:, occurred_at:, + # Type of monitor event fired when account activity occurs. type:, username:, x_event_id: nil @@ -66,7 +69,7 @@ module XTwitterScraper data: T::Hash[Symbol, T.anything], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::EventDetail::Type::OrSymbol, + type: XTwitterScraper::EventType::TaggedSymbol, username: String, x_event_id: String } @@ -74,50 +77,6 @@ module XTwitterScraper end def to_hash end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::EventDetail::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let(:"tweet.new", XTwitterScraper::EventDetail::Type::TaggedSymbol) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::EventDetail::Type::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::EventDetail::Type::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::EventDetail::Type::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::EventDetail::Type::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::EventDetail::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[XTwitterScraper::EventDetail::Type::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/event_list_params.rbi b/rbi/x_twitter_scraper/models/event_list_params.rbi index 4af1461..f2f84a2 100644 --- a/rbi/x_twitter_scraper/models/event_list_params.rbi +++ b/rbi/x_twitter_scraper/models/event_list_params.rbi @@ -14,33 +14,28 @@ module XTwitterScraper ) end - # Cursor for pagination + # Cursor for keyset pagination sig { returns(T.nilable(String)) } attr_reader :after sig { params(after: String).void } attr_writer :after - sig do - returns( - T.nilable(XTwitterScraper::EventListParams::EventType::OrSymbol) - ) - end + # Filter events by type + sig { returns(T.nilable(XTwitterScraper::EventType::OrSymbol)) } attr_reader :event_type - sig do - params( - event_type: XTwitterScraper::EventListParams::EventType::OrSymbol - ).void - end + sig { params(event_type: XTwitterScraper::EventType::OrSymbol).void } attr_writer :event_type + # Maximum number of items to return (1-100, default 50) sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit + # Filter events by monitor ID sig { returns(T.nilable(String)) } attr_reader :monitor_id @@ -50,17 +45,20 @@ module XTwitterScraper sig do params( after: String, - event_type: XTwitterScraper::EventListParams::EventType::OrSymbol, + event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Filter events by type event_type: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, + # Filter events by monitor ID monitor_id: nil, request_options: {} ) @@ -70,7 +68,7 @@ module XTwitterScraper override.returns( { after: String, - event_type: XTwitterScraper::EventListParams::EventType::OrSymbol, + event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, request_options: XTwitterScraper::RequestOptions @@ -79,55 +77,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::EventListParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::EventListParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[XTwitterScraper::EventListParams::EventType::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/event_list_response.rbi b/rbi/x_twitter_scraper/models/event_list_response.rbi index b2d1baf..c1d7d95 100644 --- a/rbi/x_twitter_scraper/models/event_list_response.rbi +++ b/rbi/x_twitter_scraper/models/event_list_response.rbi @@ -11,9 +11,7 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::EventListResponse::Event]) - end + sig { returns(T::Array[XTwitterScraper::Event]) } attr_accessor :events sig { returns(T::Boolean) } @@ -27,8 +25,7 @@ module XTwitterScraper sig do params( - events: - T::Array[XTwitterScraper::Models::EventListResponse::Event::OrHash], + events: T::Array[XTwitterScraper::Event::OrHash], has_more: T::Boolean, next_cursor: String ).returns(T.attached_class) @@ -39,7 +36,7 @@ module XTwitterScraper sig do override.returns( { - events: T::Array[XTwitterScraper::Models::EventListResponse::Event], + events: T::Array[XTwitterScraper::Event], has_more: T::Boolean, next_cursor: String } @@ -47,122 +44,6 @@ module XTwitterScraper end def to_hash end - - class Event < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::EventListResponse::Event, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :data - - sig { returns(String) } - attr_accessor :monitor_id - - sig { returns(Time) } - attr_accessor :occurred_at - - sig do - returns( - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - end - attr_accessor :type - - sig { returns(String) } - attr_accessor :username - - sig do - params( - id: String, - data: T::Hash[Symbol, T.anything], - monitor_id: String, - occurred_at: Time, - type: - XTwitterScraper::Models::EventListResponse::Event::Type::OrSymbol, - username: String - ).returns(T.attached_class) - end - def self.new(id:, data:, monitor_id:, occurred_at:, type:, username:) - end - - sig do - override.returns( - { - id: String, - data: T::Hash[Symbol, T.anything], - monitor_id: String, - occurred_at: Time, - type: - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol, - username: String - } - ) - end - def to_hash - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::EventListResponse::Event::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::EventListResponse::Event::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/event_retrieve_response.rbi b/rbi/x_twitter_scraper/models/event_retrieve_response.rbi deleted file mode 100644 index 78cf7e8..0000000 --- a/rbi/x_twitter_scraper/models/event_retrieve_response.rbi +++ /dev/null @@ -1,135 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class EventRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::EventRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # Event payload — shape varies by event type (JSON) - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :data - - sig { returns(String) } - attr_accessor :monitor_id - - sig { returns(Time) } - attr_accessor :occurred_at - - sig do - returns( - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - end - attr_accessor :type - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :x_event_id - - sig { params(x_event_id: String).void } - attr_writer :x_event_id - - sig do - params( - id: String, - data: T::Hash[Symbol, T.anything], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventRetrieveResponse::Type::OrSymbol, - username: String, - x_event_id: String - ).returns(T.attached_class) - end - def self.new( - id:, - # Event payload — shape varies by event type (JSON) - data:, - monitor_id:, - occurred_at:, - type:, - username:, - x_event_id: nil - ) - end - - sig do - override.returns( - { - id: String, - data: T::Hash[Symbol, T.anything], - monitor_id: String, - occurred_at: Time, - type: - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol, - username: String, - x_event_id: String - } - ) - end - def to_hash - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::Models::EventRetrieveResponse::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::EventRetrieveResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/event_type.rbi b/rbi/x_twitter_scraper/models/event_type.rbi index fab47c9..1252975 100644 --- a/rbi/x_twitter_scraper/models/event_type.rbi +++ b/rbi/x_twitter_scraper/models/event_type.rbi @@ -2,6 +2,7 @@ module XTwitterScraper module Models + # Type of monitor event fired when account activity occurs. module EventType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi b/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi index d4e7e6f..2ff52c5 100644 --- a/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi @@ -14,6 +14,7 @@ module XTwitterScraper ) end + # Identifier for the extraction tool used to run a job. sig do returns( XTwitterScraper::ExtractionEstimateCostParams::ToolType::OrSymbol @@ -21,21 +22,21 @@ module XTwitterScraper end attr_accessor :tool_type - # Raw advanced search query appended as-is (tweet_search_extractor) + # Raw advanced query string appended to the estimate (tweet_search_extractor) sig { returns(T.nilable(String)) } attr_reader :advanced_query sig { params(advanced_query: String).void } attr_writer :advanced_query - # Exact phrase to match (tweet_search_extractor) + # Exact phrase filter for search estimation sig { returns(T.nilable(String)) } attr_reader :exact_phrase sig { params(exact_phrase: String).void } attr_writer :exact_phrase - # Words to exclude from results (tweet_search_extractor) + # Words excluded from estimated search results sig { returns(T.nilable(String)) } attr_reader :exclude_words @@ -95,12 +96,13 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Identifier for the extraction tool used to run a job. tool_type:, - # Raw advanced search query appended as-is (tweet_search_extractor) + # Raw advanced query string appended to the estimate (tweet_search_extractor) advanced_query: nil, - # Exact phrase to match (tweet_search_extractor) + # Exact phrase filter for search estimation exact_phrase: nil, - # Words to exclude from results (tweet_search_extractor) + # Words excluded from estimated search results exclude_words: nil, search_query: nil, target_community_id: nil, @@ -133,6 +135,7 @@ module XTwitterScraper def to_hash end + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi b/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi index e5ebeb6..9ea0141 100644 --- a/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi @@ -17,6 +17,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Export file format sig do returns( T.nilable( @@ -42,7 +43,12 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, format_: nil, request_options: {}) + def self.new( + id:, + # Export file format + format_: nil, + request_options: {} + ) end sig do @@ -58,6 +64,7 @@ module XTwitterScraper def to_hash end + # Export file format module Format extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_job.rbi b/rbi/x_twitter_scraper/models/extraction_job.rbi index d1887a2..52f77cc 100644 --- a/rbi/x_twitter_scraper/models/extraction_job.rbi +++ b/rbi/x_twitter_scraper/models/extraction_job.rbi @@ -17,10 +17,11 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig { returns(XTwitterScraper::ExtractionJob::Status::OrSymbol) } + sig { returns(XTwitterScraper::ExtractionJob::Status::TaggedSymbol) } attr_accessor :status - sig { returns(XTwitterScraper::ExtractionJob::ToolType::OrSymbol) } + # Identifier for the extraction tool used to run a job. + sig { returns(XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol) } attr_accessor :tool_type sig { returns(Integer) } @@ -32,6 +33,7 @@ module XTwitterScraper sig { params(completed_at: Time).void } attr_writer :completed_at + # Extraction job tracking status, tool type, and result count. sig do params( id: String, @@ -46,6 +48,7 @@ module XTwitterScraper id:, created_at:, status:, + # Identifier for the extraction tool used to run a job. tool_type:, total_results:, completed_at: nil @@ -57,8 +60,8 @@ module XTwitterScraper { id: String, created_at: Time, - status: XTwitterScraper::ExtractionJob::Status::OrSymbol, - tool_type: XTwitterScraper::ExtractionJob::ToolType::OrSymbol, + status: XTwitterScraper::ExtractionJob::Status::TaggedSymbol, + tool_type: XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol, total_results: Integer, completed_at: Time } @@ -93,6 +96,7 @@ module XTwitterScraper end end + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_list_params.rbi b/rbi/x_twitter_scraper/models/extraction_list_params.rbi index 71b44a1..86b2e75 100644 --- a/rbi/x_twitter_scraper/models/extraction_list_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_list_params.rbi @@ -14,19 +14,21 @@ module XTwitterScraper ) end - # Cursor for pagination + # Cursor for keyset pagination sig { returns(T.nilable(String)) } attr_reader :after sig { params(after: String).void } attr_writer :after + # Maximum number of items to return (1-100, default 50) sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit + # Filter by job status sig do returns( T.nilable(XTwitterScraper::ExtractionListParams::Status::OrSymbol) @@ -41,6 +43,7 @@ module XTwitterScraper end attr_writer :status + # Filter by extraction tool type sig do returns( T.nilable(XTwitterScraper::ExtractionListParams::ToolType::OrSymbol) @@ -65,10 +68,13 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, + # Filter by job status status: nil, + # Filter by extraction tool type tool_type: nil, request_options: {} ) @@ -89,6 +95,7 @@ module XTwitterScraper def to_hash end + # Filter by job status module Status extend XTwitterScraper::Internal::Type::Enum @@ -125,6 +132,7 @@ module XTwitterScraper end end + # Filter by extraction tool type module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_list_response.rbi b/rbi/x_twitter_scraper/models/extraction_list_response.rbi index 6861bc1..dfe2955 100644 --- a/rbi/x_twitter_scraper/models/extraction_list_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_list_response.rbi @@ -11,11 +11,7 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction] - ) - end + sig { returns(T::Array[XTwitterScraper::ExtractionJob]) } attr_accessor :extractions sig { returns(T::Boolean) } @@ -29,10 +25,7 @@ module XTwitterScraper sig do params( - extractions: - T::Array[ - XTwitterScraper::Models::ExtractionListResponse::Extraction::OrHash - ], + extractions: T::Array[XTwitterScraper::ExtractionJob::OrHash], has_more: T::Boolean, next_cursor: String ).returns(T.attached_class) @@ -43,10 +36,7 @@ module XTwitterScraper sig do override.returns( { - extractions: - T::Array[ - XTwitterScraper::Models::ExtractionListResponse::Extraction - ], + extractions: T::Array[XTwitterScraper::ExtractionJob], has_more: T::Boolean, next_cursor: String } @@ -54,247 +44,6 @@ module XTwitterScraper end def to_hash end - - class Extraction < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::ExtractionListResponse::Extraction, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig do - returns( - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - end - attr_accessor :tool_type - - sig { returns(Integer) } - attr_accessor :total_results - - sig { returns(T.nilable(Time)) } - attr_reader :completed_at - - sig { params(completed_at: Time).void } - attr_writer :completed_at - - sig do - params( - id: String, - created_at: Time, - status: - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::OrSymbol, - tool_type: - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::OrSymbol, - total_results: Integer, - completed_at: Time - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - status:, - tool_type:, - total_results:, - completed_at: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - status: - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol, - tool_type: - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol, - total_results: Integer, - completed_at: Time - } - ) - end - def to_hash - end - - module Status - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - RUNNING = - T.let( - :running, - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol - ) - COMPLETED = - T.let( - :completed, - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol - ) - FAILED = - T.let( - :failed, - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::ExtractionListResponse::Extraction::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ToolType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ARTICLE_EXTRACTOR = - T.let( - :article_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - COMMUNITY_EXTRACTOR = - T.let( - :community_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - COMMUNITY_MODERATOR_EXPLORER = - T.let( - :community_moderator_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - COMMUNITY_POST_EXTRACTOR = - T.let( - :community_post_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - COMMUNITY_SEARCH = - T.let( - :community_search, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - FOLLOWER_EXPLORER = - T.let( - :follower_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - FOLLOWING_EXPLORER = - T.let( - :following_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - LIST_FOLLOWER_EXPLORER = - T.let( - :list_follower_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - LIST_MEMBER_EXTRACTOR = - T.let( - :list_member_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - LIST_POST_EXTRACTOR = - T.let( - :list_post_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - MENTION_EXTRACTOR = - T.let( - :mention_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - PEOPLE_SEARCH = - T.let( - :people_search, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - POST_EXTRACTOR = - T.let( - :post_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - QUOTE_EXTRACTOR = - T.let( - :quote_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - REPLY_EXTRACTOR = - T.let( - :reply_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - REPOST_EXTRACTOR = - T.let( - :repost_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - SPACE_EXPLORER = - T.let( - :space_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - THREAD_EXTRACTOR = - T.let( - :thread_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - TWEET_SEARCH_EXTRACTOR = - T.let( - :tweet_search_extractor, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - VERIFIED_FOLLOWER_EXPLORER = - T.let( - :verified_follower_explorer, - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::ExtractionListResponse::Extraction::ToolType::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi b/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi index 202b559..424c84d 100644 --- a/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi @@ -17,13 +17,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Cursor for pagination + # Cursor for keyset pagination sig { returns(T.nilable(String)) } attr_reader :after sig { params(after: String).void } attr_writer :after + # Maximum number of results to return (1-1000, default 100) sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -40,8 +41,9 @@ module XTwitterScraper end def self.new( id:, - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of results to return (1-1000, default 100) limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/extraction_run_params.rbi b/rbi/x_twitter_scraper/models/extraction_run_params.rbi index a1efd64..d965b4e 100644 --- a/rbi/x_twitter_scraper/models/extraction_run_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_run_params.rbi @@ -14,6 +14,7 @@ module XTwitterScraper ) end + # Identifier for the extraction tool used to run a job. sig { returns(XTwitterScraper::ExtractionRunParams::ToolType::OrSymbol) } attr_accessor :tool_type @@ -90,6 +91,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Identifier for the extraction tool used to run a job. tool_type:, # Raw advanced search query appended as-is (tweet_search_extractor) advanced_query: nil, @@ -127,6 +129,7 @@ module XTwitterScraper def to_hash end + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/extraction_run_response.rbi b/rbi/x_twitter_scraper/models/extraction_run_response.rbi index f6e1742..2b74df7 100644 --- a/rbi/x_twitter_scraper/models/extraction_run_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_run_response.rbi @@ -14,13 +14,10 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - sig do - returns( - XTwitterScraper::Models::ExtractionRunResponse::Status::TaggedSymbol - ) - end + sig { returns(Symbol) } attr_accessor :status + # Identifier for the extraction tool used to run a job. sig do returns( XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol @@ -31,21 +28,24 @@ module XTwitterScraper sig do params( id: String, - status: - XTwitterScraper::Models::ExtractionRunResponse::Status::OrSymbol, tool_type: - XTwitterScraper::Models::ExtractionRunResponse::ToolType::OrSymbol + XTwitterScraper::Models::ExtractionRunResponse::ToolType::OrSymbol, + status: Symbol ).returns(T.attached_class) end - def self.new(id:, status:, tool_type:) + def self.new( + id:, + # Identifier for the extraction tool used to run a job. + tool_type:, + status: :running + ) end sig do override.returns( { id: String, - status: - XTwitterScraper::Models::ExtractionRunResponse::Status::TaggedSymbol, + status: Symbol, tool_type: XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol } @@ -54,35 +54,7 @@ module XTwitterScraper def to_hash end - module Status - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::ExtractionRunResponse::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - RUNNING = - T.let( - :running, - XTwitterScraper::Models::ExtractionRunResponse::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::ExtractionRunResponse::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - + # Identifier for the extraction tool used to run a job. module ToolType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/integration.rbi b/rbi/x_twitter_scraper/models/integration.rbi index e5b80cf..c252cc5 100644 --- a/rbi/x_twitter_scraper/models/integration.rbi +++ b/rbi/x_twitter_scraper/models/integration.rbi @@ -21,9 +21,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig do - returns(T::Array[XTwitterScraper::Integration::EventType::OrSymbol]) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types sig { returns(T::Boolean) } @@ -32,7 +31,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :name - sig { returns(XTwitterScraper::Integration::Type::OrSymbol) } + sig { returns(Symbol) } attr_accessor :type # Event filter rules (JSON) @@ -60,20 +59,20 @@ module XTwitterScraper sig { params(silent_push: T::Boolean).void } attr_writer :silent_push + # Third-party integration (e.g. Telegram) subscribed to monitor events. sig do params( id: String, config: T::Hash[Symbol, T.anything], created_at: Time, - event_types: - T::Array[XTwitterScraper::Integration::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, name: String, - type: XTwitterScraper::Integration::Type::OrSymbol, filters: T::Hash[Symbol, T.anything], message_template: String, scope_all_monitors: T::Boolean, - silent_push: T::Boolean + silent_push: T::Boolean, + type: Symbol ).returns(T.attached_class) end def self.new( @@ -81,15 +80,16 @@ module XTwitterScraper # Integration config — shape varies by type (JSON) config:, created_at:, + # Array of event types to subscribe to. event_types:, is_active:, name:, - type:, # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, - silent_push: nil + silent_push: nil, + type: :telegram ) end @@ -99,11 +99,10 @@ module XTwitterScraper id: String, config: T::Hash[Symbol, T.anything], created_at: Time, - event_types: - T::Array[XTwitterScraper::Integration::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], is_active: T::Boolean, name: String, - type: XTwitterScraper::Integration::Type::OrSymbol, + type: Symbol, filters: T::Hash[Symbol, T.anything], message_template: String, scope_all_monitors: T::Boolean, @@ -113,74 +112,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::Integration::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Integration::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[XTwitterScraper::Integration::EventType::TaggedSymbol] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::Integration::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let(:telegram, XTwitterScraper::Integration::Type::TaggedSymbol) - - sig do - override.returns( - T::Array[XTwitterScraper::Integration::Type::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/integration_create_params.rbi b/rbi/x_twitter_scraper/models/integration_create_params.rbi index a4775c3..4711f28 100644 --- a/rbi/x_twitter_scraper/models/integration_create_params.rbi +++ b/rbi/x_twitter_scraper/models/integration_create_params.rbi @@ -25,39 +25,32 @@ module XTwitterScraper end attr_writer :config - sig do - returns( - T::Array[ - XTwitterScraper::IntegrationCreateParams::EventType::OrSymbol - ] - ) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::OrSymbol]) } attr_accessor :event_types sig { returns(String) } attr_accessor :name - sig { returns(XTwitterScraper::IntegrationCreateParams::Type::OrSymbol) } + sig { returns(Symbol) } attr_accessor :type sig do params( config: XTwitterScraper::IntegrationCreateParams::Config::OrHash, - event_types: - T::Array[ - XTwitterScraper::IntegrationCreateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], name: String, - type: XTwitterScraper::IntegrationCreateParams::Type::OrSymbol, + type: Symbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # Integration config (e.g. Telegram chatId) config:, + # Array of event types to subscribe to. event_types:, name:, - type:, + type: :telegram, request_options: {} ) end @@ -66,12 +59,9 @@ module XTwitterScraper override.returns( { config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: - T::Array[ - XTwitterScraper::IntegrationCreateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], name: String, - type: XTwitterScraper::IntegrationCreateParams::Type::OrSymbol, + type: Symbol, request_options: XTwitterScraper::RequestOptions } ) @@ -100,83 +90,6 @@ module XTwitterScraper def to_hash end end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::IntegrationCreateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::IntegrationCreateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::IntegrationCreateParams::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let( - :telegram, - XTwitterScraper::IntegrationCreateParams::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::IntegrationCreateParams::Type::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/integration_create_response.rbi b/rbi/x_twitter_scraper/models/integration_create_response.rbi deleted file mode 100644 index 6a04a6e..0000000 --- a/rbi/x_twitter_scraper/models/integration_create_response.rbi +++ /dev/null @@ -1,215 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationCreateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # Integration config — shape varies by type (JSON) - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :config - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig do - returns( - XTwitterScraper::Models::IntegrationCreateResponse::Type::TaggedSymbol - ) - end - attr_accessor :type - - # Event filter rules (JSON) - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :filters - - sig { params(filters: T::Hash[Symbol, T.anything]).void } - attr_writer :filters - - sig { returns(T.nilable(String)) } - attr_reader :message_template - - sig { params(message_template: String).void } - attr_writer :message_template - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :scope_all_monitors - - sig { params(scope_all_monitors: T::Boolean).void } - attr_writer :scope_all_monitors - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :silent_push - - sig { params(silent_push: T::Boolean).void } - attr_writer :silent_push - - sig do - params( - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationCreateResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationCreateResponse::Type::OrSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - # Integration config — shape varies by type (JSON) - config:, - created_at:, - event_types:, - is_active:, - name:, - type:, - # Event filter rules (JSON) - filters: nil, - message_template: nil, - scope_all_monitors: nil, - silent_push: nil - ) - end - - sig do - override.returns( - { - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationCreateResponse::Type::TaggedSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationCreateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationCreateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationCreateResponse::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let( - :telegram, - XTwitterScraper::Models::IntegrationCreateResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationCreateResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_delivery.rbi b/rbi/x_twitter_scraper/models/integration_delivery.rbi index c68c96c..da0a75a 100644 --- a/rbi/x_twitter_scraper/models/integration_delivery.rbi +++ b/rbi/x_twitter_scraper/models/integration_delivery.rbi @@ -56,6 +56,7 @@ module XTwitterScraper sig { params(source_type: String).void } attr_writer :source_type + # Integration delivery attempt record with status and retry count. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi b/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi index 2b8f138..00dd336 100644 --- a/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi +++ b/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi @@ -17,6 +17,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Maximum number of items to return (1-100, default 50) sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -30,7 +31,12 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, limit: nil, request_options: {}) + def self.new( + id:, + # Maximum number of items to return (1-100, default 50) + limit: nil, + request_options: {} + ) end sig do diff --git a/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi b/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi index 23a8164..d1b45e4 100644 --- a/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi @@ -11,21 +11,12 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery - ] - ) - end + sig { returns(T::Array[XTwitterScraper::IntegrationDelivery]) } attr_accessor :deliveries sig do params( - deliveries: - T::Array[ - XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery::OrHash - ] + deliveries: T::Array[XTwitterScraper::IntegrationDelivery::OrHash] ).returns(T.attached_class) end def self.new(deliveries:) @@ -33,118 +24,11 @@ module XTwitterScraper sig do override.returns( - { - deliveries: - T::Array[ - XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery - ] - } + { deliveries: T::Array[XTwitterScraper::IntegrationDelivery] } ) end def to_hash end - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Integer) } - attr_accessor :attempts - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :event_type - - sig { returns(String) } - attr_accessor :status - - sig { returns(T.nilable(Time)) } - attr_reader :delivered_at - - sig { params(delivered_at: Time).void } - attr_writer :delivered_at - - sig { returns(T.nilable(String)) } - attr_reader :last_error - - sig { params(last_error: String).void } - attr_writer :last_error - - sig { returns(T.nilable(Integer)) } - attr_reader :last_status_code - - sig { params(last_status_code: Integer).void } - attr_writer :last_status_code - - sig { returns(T.nilable(String)) } - attr_reader :source_id - - sig { params(source_id: String).void } - attr_writer :source_id - - sig { returns(T.nilable(String)) } - attr_reader :source_type - - sig { params(source_type: String).void } - attr_writer :source_type - - sig do - params( - id: String, - attempts: Integer, - created_at: Time, - event_type: String, - status: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer, - source_id: String, - source_type: String - ).returns(T.attached_class) - end - def self.new( - id:, - attempts:, - created_at:, - event_type:, - status:, - delivered_at: nil, - last_error: nil, - last_status_code: nil, - source_id: nil, - source_type: nil - ) - end - - sig do - override.returns( - { - id: String, - attempts: Integer, - created_at: Time, - event_type: String, - status: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer, - source_id: String, - source_type: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/integration_list_response.rbi b/rbi/x_twitter_scraper/models/integration_list_response.rbi index 9ccccf0..be7e3d4 100644 --- a/rbi/x_twitter_scraper/models/integration_list_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_list_response.rbi @@ -11,21 +11,12 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration - ] - ) - end + sig { returns(T::Array[XTwitterScraper::Integration]) } attr_accessor :integrations sig do params( - integrations: - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::OrHash - ] + integrations: T::Array[XTwitterScraper::Integration::OrHash] ).returns(T.attached_class) end def self.new(integrations:) @@ -33,226 +24,11 @@ module XTwitterScraper sig do override.returns( - { - integrations: - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration - ] - } + { integrations: T::Array[XTwitterScraper::Integration] } ) end def to_hash end - - class Integration < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationListResponse::Integration, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # Integration config — shape varies by type (JSON) - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :config - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig do - returns( - XTwitterScraper::Models::IntegrationListResponse::Integration::Type::TaggedSymbol - ) - end - attr_accessor :type - - # Event filter rules (JSON) - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :filters - - sig { params(filters: T::Hash[Symbol, T.anything]).void } - attr_writer :filters - - sig { returns(T.nilable(String)) } - attr_reader :message_template - - sig { params(message_template: String).void } - attr_writer :message_template - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :scope_all_monitors - - sig { params(scope_all_monitors: T::Boolean).void } - attr_writer :scope_all_monitors - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :silent_push - - sig { params(silent_push: T::Boolean).void } - attr_writer :silent_push - - sig do - params( - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::OrSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationListResponse::Integration::Type::OrSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - # Integration config — shape varies by type (JSON) - config:, - created_at:, - event_types:, - is_active:, - name:, - type:, - # Event filter rules (JSON) - filters: nil, - message_template: nil, - scope_all_monitors: nil, - silent_push: nil - ) - end - - sig do - override.returns( - { - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationListResponse::Integration::Type::TaggedSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationListResponse::Integration::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let( - :telegram, - XTwitterScraper::Models::IntegrationListResponse::Integration::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationListResponse::Integration::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi b/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi deleted file mode 100644 index 7ea765d..0000000 --- a/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi +++ /dev/null @@ -1,215 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # Integration config — shape varies by type (JSON) - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :config - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig do - returns( - XTwitterScraper::Models::IntegrationRetrieveResponse::Type::TaggedSymbol - ) - end - attr_accessor :type - - # Event filter rules (JSON) - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :filters - - sig { params(filters: T::Hash[Symbol, T.anything]).void } - attr_writer :filters - - sig { returns(T.nilable(String)) } - attr_reader :message_template - - sig { params(message_template: String).void } - attr_writer :message_template - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :scope_all_monitors - - sig { params(scope_all_monitors: T::Boolean).void } - attr_writer :scope_all_monitors - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :silent_push - - sig { params(silent_push: T::Boolean).void } - attr_writer :silent_push - - sig do - params( - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationRetrieveResponse::Type::OrSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - # Integration config — shape varies by type (JSON) - config:, - created_at:, - event_types:, - is_active:, - name:, - type:, - # Event filter rules (JSON) - filters: nil, - message_template: nil, - scope_all_monitors: nil, - silent_push: nil - ) - end - - sig do - override.returns( - { - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationRetrieveResponse::Type::TaggedSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationRetrieveResponse::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let( - :telegram, - XTwitterScraper::Models::IntegrationRetrieveResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationRetrieveResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_update_params.rbi b/rbi/x_twitter_scraper/models/integration_update_params.rbi index f90d545..f58d3a6 100644 --- a/rbi/x_twitter_scraper/models/integration_update_params.rbi +++ b/rbi/x_twitter_scraper/models/integration_update_params.rbi @@ -17,24 +17,12 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - sig do - returns( - T.nilable( - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::OrSymbol - ] - ) - ) - end + # Array of event types to subscribe to. + sig { returns(T.nilable(T::Array[XTwitterScraper::EventType::OrSymbol])) } attr_reader :event_types sig do - params( - event_types: - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::OrSymbol - ] - ).void + params(event_types: T::Array[XTwitterScraper::EventType::OrSymbol]).void end attr_writer :event_types @@ -79,10 +67,7 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], filters: T::Hash[Symbol, T.anything], is_active: T::Boolean, message_template: T::Hash[Symbol, T.anything], @@ -94,6 +79,7 @@ module XTwitterScraper end def self.new( id:, + # Array of event types to subscribe to. event_types: nil, # Event filter rules (JSON) filters: nil, @@ -111,10 +97,7 @@ module XTwitterScraper override.returns( { id: String, - event_types: - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], filters: T::Hash[Symbol, T.anything], is_active: T::Boolean, message_template: T::Hash[Symbol, T.anything], @@ -127,57 +110,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::IntegrationUpdateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/integration_update_response.rbi b/rbi/x_twitter_scraper/models/integration_update_response.rbi deleted file mode 100644 index 7daa736..0000000 --- a/rbi/x_twitter_scraper/models/integration_update_response.rbi +++ /dev/null @@ -1,215 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationUpdateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # Integration config — shape varies by type (JSON) - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :config - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig do - returns( - XTwitterScraper::Models::IntegrationUpdateResponse::Type::TaggedSymbol - ) - end - attr_accessor :type - - # Event filter rules (JSON) - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :filters - - sig { params(filters: T::Hash[Symbol, T.anything]).void } - attr_writer :filters - - sig { returns(T.nilable(String)) } - attr_reader :message_template - - sig { params(message_template: String).void } - attr_writer :message_template - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :scope_all_monitors - - sig { params(scope_all_monitors: T::Boolean).void } - attr_writer :scope_all_monitors - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :silent_push - - sig { params(silent_push: T::Boolean).void } - attr_writer :silent_push - - sig do - params( - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationUpdateResponse::Type::OrSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - # Integration config — shape varies by type (JSON) - config:, - created_at:, - event_types:, - is_active:, - name:, - type:, - # Event filter rules (JSON) - filters: nil, - message_template: nil, - scope_all_monitors: nil, - silent_push: nil - ) - end - - sig do - override.returns( - { - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - name: String, - type: - XTwitterScraper::Models::IntegrationUpdateResponse::Type::TaggedSymbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationUpdateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationUpdateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::IntegrationUpdateResponse::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TELEGRAM = - T.let( - :telegram, - XTwitterScraper::Models::IntegrationUpdateResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::IntegrationUpdateResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/monitor.rbi b/rbi/x_twitter_scraper/models/monitor.rbi index 0949cb0..9921c01 100644 --- a/rbi/x_twitter_scraper/models/monitor.rbi +++ b/rbi/x_twitter_scraper/models/monitor.rbi @@ -14,7 +14,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig { returns(T::Array[XTwitterScraper::Monitor::EventType::OrSymbol]) } + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types sig { returns(T::Boolean) } @@ -26,11 +27,12 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_user_id + # Account monitor that tracks activity for a given X user. sig do params( id: String, created_at: Time, - event_types: T::Array[XTwitterScraper::Monitor::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, username: String, x_user_id: String @@ -39,6 +41,7 @@ module XTwitterScraper def self.new( id:, created_at:, + # Array of event types to subscribe to. event_types:, is_active:, username:, @@ -51,8 +54,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: - T::Array[XTwitterScraper::Monitor::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], is_active: T::Boolean, username: String, x_user_id: String @@ -61,50 +63,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::Monitor::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let(:"tweet.new", XTwitterScraper::Monitor::EventType::TaggedSymbol) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Monitor::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Monitor::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Monitor::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Monitor::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Monitor::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[XTwitterScraper::Monitor::EventType::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/monitor_create_params.rbi b/rbi/x_twitter_scraper/models/monitor_create_params.rbi index 82997ac..6b01fbe 100644 --- a/rbi/x_twitter_scraper/models/monitor_create_params.rbi +++ b/rbi/x_twitter_scraper/models/monitor_create_params.rbi @@ -14,11 +14,8 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[XTwitterScraper::MonitorCreateParams::EventType::OrSymbol] - ) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::OrSymbol]) } attr_accessor :event_types # X username (without @) @@ -27,13 +24,13 @@ module XTwitterScraper sig do params( - event_types: - T::Array[XTwitterScraper::MonitorCreateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], username: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Array of event types to subscribe to. event_types:, # X username (without @) username:, @@ -44,10 +41,7 @@ module XTwitterScraper sig do override.returns( { - event_types: - T::Array[ - XTwitterScraper::MonitorCreateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], username: String, request_options: XTwitterScraper::RequestOptions } @@ -55,57 +49,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::MonitorCreateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::MonitorCreateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/monitor_create_response.rbi b/rbi/x_twitter_scraper/models/monitor_create_response.rbi index 52ecce9..b68050c 100644 --- a/rbi/x_twitter_scraper/models/monitor_create_response.rbi +++ b/rbi/x_twitter_scraper/models/monitor_create_response.rbi @@ -17,13 +17,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig do - returns( - T::Array[ - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ] - ) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types sig { returns(String) } @@ -36,15 +31,19 @@ module XTwitterScraper params( id: String, created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorCreateResponse::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], username: String, x_user_id: String ).returns(T.attached_class) end - def self.new(id:, created_at:, event_types:, username:, x_user_id:) + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + username:, + x_user_id: + ) end sig do @@ -52,10 +51,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], username: String, x_user_id: String } @@ -63,60 +59,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::MonitorCreateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::MonitorCreateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/monitor_list_response.rbi b/rbi/x_twitter_scraper/models/monitor_list_response.rbi index 8629c8e..abc03ce 100644 --- a/rbi/x_twitter_scraper/models/monitor_list_response.rbi +++ b/rbi/x_twitter_scraper/models/monitor_list_response.rbi @@ -11,9 +11,7 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::MonitorListResponse::Monitor]) - end + sig { returns(T::Array[XTwitterScraper::Monitor]) } attr_accessor :monitors sig { returns(Integer) } @@ -21,10 +19,7 @@ module XTwitterScraper sig do params( - monitors: - T::Array[ - XTwitterScraper::Models::MonitorListResponse::Monitor::OrHash - ], + monitors: T::Array[XTwitterScraper::Monitor::OrHash], total: Integer ).returns(T.attached_class) end @@ -33,144 +28,11 @@ module XTwitterScraper sig do override.returns( - { - monitors: - T::Array[XTwitterScraper::Models::MonitorListResponse::Monitor], - total: Integer - } + { monitors: T::Array[XTwitterScraper::Monitor], total: Integer } ) end def to_hash end - - class Monitor < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::MonitorListResponse::Monitor, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :username - - sig { returns(String) } - attr_accessor :x_user_id - - sig do - params( - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::OrSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - event_types:, - is_active:, - username:, - x_user_id: - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::MonitorListResponse::Monitor::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/monitor_retrieve_response.rbi b/rbi/x_twitter_scraper/models/monitor_retrieve_response.rbi deleted file mode 100644 index 3ad0230..0000000 --- a/rbi/x_twitter_scraper/models/monitor_retrieve_response.rbi +++ /dev/null @@ -1,134 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class MonitorRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::MonitorRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :username - - sig { returns(String) } - attr_accessor :x_user_id - - sig do - params( - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - event_types:, - is_active:, - username:, - x_user_id: - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::MonitorRetrieveResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::MonitorRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/monitor_update_params.rbi b/rbi/x_twitter_scraper/models/monitor_update_params.rbi index dab7ab9..bf85f0a 100644 --- a/rbi/x_twitter_scraper/models/monitor_update_params.rbi +++ b/rbi/x_twitter_scraper/models/monitor_update_params.rbi @@ -17,20 +17,12 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - sig do - returns( - T.nilable( - T::Array[XTwitterScraper::MonitorUpdateParams::EventType::OrSymbol] - ) - ) - end + # Array of event types to subscribe to. + sig { returns(T.nilable(T::Array[XTwitterScraper::EventType::OrSymbol])) } attr_reader :event_types sig do - params( - event_types: - T::Array[XTwitterScraper::MonitorUpdateParams::EventType::OrSymbol] - ).void + params(event_types: T::Array[XTwitterScraper::EventType::OrSymbol]).void end attr_writer :event_types @@ -43,23 +35,25 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[XTwitterScraper::MonitorUpdateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, event_types: nil, is_active: nil, request_options: {}) + def self.new( + id:, + # Array of event types to subscribe to. + event_types: nil, + is_active: nil, + request_options: {} + ) end sig do override.returns( { id: String, - event_types: - T::Array[ - XTwitterScraper::MonitorUpdateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, request_options: XTwitterScraper::RequestOptions } @@ -67,57 +61,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::MonitorUpdateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::MonitorUpdateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/monitor_update_response.rbi b/rbi/x_twitter_scraper/models/monitor_update_response.rbi deleted file mode 100644 index d692c9a..0000000 --- a/rbi/x_twitter_scraper/models/monitor_update_response.rbi +++ /dev/null @@ -1,134 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class MonitorUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::MonitorUpdateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :username - - sig { returns(String) } - attr_accessor :x_user_id - - sig do - params( - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorUpdateResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - event_types:, - is_active:, - username:, - x_user_id: - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - username: String, - x_user_id: String - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::MonitorUpdateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::MonitorUpdateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/paginated_tweets.rbi b/rbi/x_twitter_scraper/models/paginated_tweets.rbi index 7325230..571a80c 100644 --- a/rbi/x_twitter_scraper/models/paginated_tweets.rbi +++ b/rbi/x_twitter_scraper/models/paginated_tweets.rbi @@ -17,14 +17,15 @@ module XTwitterScraper sig { returns(String) } attr_accessor :next_cursor - sig { returns(T::Array[XTwitterScraper::PaginatedTweets::Tweet]) } + sig { returns(T::Array[XTwitterScraper::X::SearchTweet]) } attr_accessor :tweets + # Paginated list of tweets with cursor-based navigation. sig do params( has_next_page: T::Boolean, next_cursor: String, - tweets: T::Array[XTwitterScraper::PaginatedTweets::Tweet::OrHash] + tweets: T::Array[XTwitterScraper::X::SearchTweet::OrHash] ).returns(T.attached_class) end def self.new(has_next_page:, next_cursor:, tweets:) @@ -35,178 +36,12 @@ module XTwitterScraper { has_next_page: T::Boolean, next_cursor: String, - tweets: T::Array[XTwitterScraper::PaginatedTweets::Tweet] + tweets: T::Array[XTwitterScraper::X::SearchTweet] } ) end def to_hash end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::PaginatedTweets::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns(T.nilable(XTwitterScraper::PaginatedTweets::Tweet::Author)) - end - attr_reader :author - - sig do - params( - author: XTwitterScraper::PaginatedTweets::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: XTwitterScraper::PaginatedTweets::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: XTwitterScraper::PaginatedTweets::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::PaginatedTweets::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/paginated_users.rbi b/rbi/x_twitter_scraper/models/paginated_users.rbi index 43eabe3..dd04ec3 100644 --- a/rbi/x_twitter_scraper/models/paginated_users.rbi +++ b/rbi/x_twitter_scraper/models/paginated_users.rbi @@ -17,14 +17,15 @@ module XTwitterScraper sig { returns(String) } attr_accessor :next_cursor - sig { returns(T::Array[XTwitterScraper::PaginatedUsers::User]) } + sig { returns(T::Array[XTwitterScraper::X::UserProfile]) } attr_accessor :users + # Paginated list of user profiles with cursor-based navigation. sig do params( has_next_page: T::Boolean, next_cursor: String, - users: T::Array[XTwitterScraper::PaginatedUsers::User::OrHash] + users: T::Array[XTwitterScraper::X::UserProfile::OrHash] ).returns(T.attached_class) end def self.new(has_next_page:, next_cursor:, users:) @@ -35,129 +36,12 @@ module XTwitterScraper { has_next_page: T::Boolean, next_cursor: String, - users: T::Array[XTwitterScraper::PaginatedUsers::User] + users: T::Array[XTwitterScraper::X::UserProfile] } ) end def to_hash end - - class User < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::PaginatedUsers::User, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(Integer)) } - attr_reader :followers - - sig { params(followers: Integer).void } - attr_writer :followers - - sig { returns(T.nilable(Integer)) } - attr_reader :following - - sig { params(following: Integer).void } - attr_writer :following - - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig { returns(T.nilable(Integer)) } - attr_reader :statuses_count - - sig { params(statuses_count: Integer).void } - attr_writer :statuses_count - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - name:, - username:, - created_at: nil, - description: nil, - followers: nil, - following: nil, - location: nil, - profile_picture: nil, - statuses_count: nil, - verified: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/radar_item.rbi b/rbi/x_twitter_scraper/models/radar_item.rbi index 496ab15..7ef6eea 100644 --- a/rbi/x_twitter_scraper/models/radar_item.rbi +++ b/rbi/x_twitter_scraper/models/radar_item.rbi @@ -44,6 +44,7 @@ module XTwitterScraper sig { params(url: String).void } attr_writer :url + # Trending topic with score, category, source, and region. sig do params( category: String, diff --git a/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbi b/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbi index eb966fc..0a95692 100644 --- a/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbi +++ b/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbi @@ -44,10 +44,21 @@ module XTwitterScraper # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia - sig { returns(T.nilable(String)) } + sig do + returns( + T.nilable( + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol + ) + ) + end attr_reader :source - sig { params(source: String).void } + sig do + params( + source: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol + ).void + end attr_writer :source sig do @@ -56,7 +67,8 @@ module XTwitterScraper count: Integer, hours: Integer, region: String, - source: String, + source: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -83,13 +95,75 @@ module XTwitterScraper count: Integer, hours: Integer, region: String, - source: String, + source: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, + # trustmrr, wikipedia + module Source + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB = + T.let( + :github, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + GOOGLE_TRENDS = + T.let( + :google_trends, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + HACKER_NEWS = + T.let( + :hacker_news, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + POLYMARKET = + T.let( + :polymarket, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + REDDIT = + T.let( + :reddit, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + TRUSTMRR = + T.let( + :trustmrr, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + WIKIPEDIA = + T.let( + :wikipedia, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbi b/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbi index 4907d27..f64fe41 100644 --- a/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbi +++ b/rbi/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbi @@ -11,13 +11,7 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[ - XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item - ] - ) - end + sig { returns(T::Array[XTwitterScraper::RadarItem]) } attr_accessor :items sig { returns(Integer) } @@ -25,10 +19,7 @@ module XTwitterScraper sig do params( - items: - T::Array[ - XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item::OrHash - ], + items: T::Array[XTwitterScraper::RadarItem::OrHash], total: Integer ).returns(T.attached_class) end @@ -37,107 +28,11 @@ module XTwitterScraper sig do override.returns( - { - items: - T::Array[ - XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item - ], - total: Integer - } + { items: T::Array[XTwitterScraper::RadarItem], total: Integer } ) end def to_hash end - - class Item < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :category - - sig { returns(Time) } - attr_accessor :published_at - - sig { returns(String) } - attr_accessor :region - - sig { returns(Float) } - attr_accessor :score - - sig { returns(String) } - attr_accessor :source - - sig { returns(String) } - attr_accessor :title - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(String)) } - attr_reader :image_url - - sig { params(image_url: String).void } - attr_writer :image_url - - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - sig do - params( - category: String, - published_at: Time, - region: String, - score: Float, - source: String, - title: String, - description: String, - image_url: String, - url: String - ).returns(T.attached_class) - end - def self.new( - category:, - published_at:, - region:, - score:, - source:, - title:, - description: nil, - image_url: nil, - url: nil - ) - end - - sig do - override.returns( - { - category: String, - published_at: Time, - region: String, - score: Float, - source: String, - title: String, - description: String, - image_url: String, - url: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/style_analyze_response.rbi b/rbi/x_twitter_scraper/models/style_analyze_response.rbi deleted file mode 100644 index 75bf88c..0000000 --- a/rbi/x_twitter_scraper/models/style_analyze_response.rbi +++ /dev/null @@ -1,120 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class StyleAnalyzeResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleAnalyzeResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig do - returns(T::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet]) - end - attr_accessor :tweets - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleAnalyzeResponse::Tweet::OrHash - ], - x_username: String - ).returns(T.attached_class) - end - def self.new( - fetched_at:, - is_own_account:, - tweet_count:, - tweets:, - x_username: - ) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet], - x_username: String - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleAnalyzeResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :author_username - - sig { params(author_username: String).void } - attr_writer :author_username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - text: String, - author_username: String, - created_at: String - ).returns(T.attached_class) - end - def self.new(id:, text:, author_username: nil, created_at: nil) - end - - sig do - override.returns( - { - id: String, - text: String, - author_username: String, - created_at: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/style_compare_response.rbi b/rbi/x_twitter_scraper/models/style_compare_response.rbi index 64a337b..7e69c82 100644 --- a/rbi/x_twitter_scraper/models/style_compare_response.rbi +++ b/rbi/x_twitter_scraper/models/style_compare_response.rbi @@ -11,287 +11,44 @@ module XTwitterScraper ) end - sig { returns(XTwitterScraper::Models::StyleCompareResponse::Style1) } + # Full style profile with sampled tweets used for tone analysis. + sig { returns(XTwitterScraper::StyleProfile) } attr_reader :style1 - sig do - params( - style1: XTwitterScraper::Models::StyleCompareResponse::Style1::OrHash - ).void - end + sig { params(style1: XTwitterScraper::StyleProfile::OrHash).void } attr_writer :style1 - sig { returns(XTwitterScraper::Models::StyleCompareResponse::Style2) } + # Full style profile with sampled tweets used for tone analysis. + sig { returns(XTwitterScraper::StyleProfile) } attr_reader :style2 - sig do - params( - style2: XTwitterScraper::Models::StyleCompareResponse::Style2::OrHash - ).void - end + sig { params(style2: XTwitterScraper::StyleProfile::OrHash).void } attr_writer :style2 sig do params( - style1: XTwitterScraper::Models::StyleCompareResponse::Style1::OrHash, - style2: XTwitterScraper::Models::StyleCompareResponse::Style2::OrHash + style1: XTwitterScraper::StyleProfile::OrHash, + style2: XTwitterScraper::StyleProfile::OrHash ).returns(T.attached_class) end - def self.new(style1:, style2:) + def self.new( + # Full style profile with sampled tweets used for tone analysis. + style1:, + # Full style profile with sampled tweets used for tone analysis. + style2: + ) end sig do override.returns( { - style1: XTwitterScraper::Models::StyleCompareResponse::Style1, - style2: XTwitterScraper::Models::StyleCompareResponse::Style2 + style1: XTwitterScraper::StyleProfile, + style2: XTwitterScraper::StyleProfile } ) end def to_hash end - - class Style1 < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleCompareResponse::Style1, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig do - returns( - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet - ] - ) - end - attr_accessor :tweets - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet::OrHash - ], - x_username: String - ).returns(T.attached_class) - end - def self.new( - fetched_at:, - is_own_account:, - tweet_count:, - tweets:, - x_username: - ) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet - ], - x_username: String - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :author_username - - sig { params(author_username: String).void } - attr_writer :author_username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - text: String, - author_username: String, - created_at: String - ).returns(T.attached_class) - end - def self.new(id:, text:, author_username: nil, created_at: nil) - end - - sig do - override.returns( - { - id: String, - text: String, - author_username: String, - created_at: String - } - ) - end - def to_hash - end - end - end - - class Style2 < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleCompareResponse::Style2, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig do - returns( - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet - ] - ) - end - attr_accessor :tweets - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet::OrHash - ], - x_username: String - ).returns(T.attached_class) - end - def self.new( - fetched_at:, - is_own_account:, - tweet_count:, - tweets:, - x_username: - ) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet - ], - x_username: String - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :author_username - - sig { params(author_username: String).void } - attr_writer :author_username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - text: String, - author_username: String, - created_at: String - ).returns(T.attached_class) - end - def self.new(id:, text:, author_username: nil, created_at: nil) - end - - sig do - override.returns( - { - id: String, - text: String, - author_username: String, - created_at: String - } - ) - end - def to_hash - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/style_delete_params.rbi b/rbi/x_twitter_scraper/models/style_delete_params.rbi index f7255d8..99e5adc 100644 --- a/rbi/x_twitter_scraper/models/style_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/style_delete_params.rbi @@ -15,20 +15,20 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :username + attr_accessor :id sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(username:, request_options: {}) + def self.new(id:, request_options: {}) end sig do override.returns( - { username: String, request_options: XTwitterScraper::RequestOptions } + { id: String, request_options: XTwitterScraper::RequestOptions } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/style_get_performance_params.rbi b/rbi/x_twitter_scraper/models/style_get_performance_params.rbi index 1c05692..0e3339d 100644 --- a/rbi/x_twitter_scraper/models/style_get_performance_params.rbi +++ b/rbi/x_twitter_scraper/models/style_get_performance_params.rbi @@ -15,20 +15,20 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :username + attr_accessor :id sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(username:, request_options: {}) + def self.new(id:, request_options: {}) end sig do override.returns( - { username: String, request_options: XTwitterScraper::RequestOptions } + { id: String, request_options: XTwitterScraper::RequestOptions } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/style_list_response.rbi b/rbi/x_twitter_scraper/models/style_list_response.rbi index feff76d..10005ba 100644 --- a/rbi/x_twitter_scraper/models/style_list_response.rbi +++ b/rbi/x_twitter_scraper/models/style_list_response.rbi @@ -11,15 +11,12 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::StyleListResponse::Style]) - end + sig { returns(T::Array[XTwitterScraper::StyleProfileSummary]) } attr_accessor :styles sig do params( - styles: - T::Array[XTwitterScraper::Models::StyleListResponse::Style::OrHash] + styles: T::Array[XTwitterScraper::StyleProfileSummary::OrHash] ).returns(T.attached_class) end def self.new(styles:) @@ -27,59 +24,11 @@ module XTwitterScraper sig do override.returns( - { - styles: T::Array[XTwitterScraper::Models::StyleListResponse::Style] - } + { styles: T::Array[XTwitterScraper::StyleProfileSummary] } ) end def to_hash end - - class Style < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleListResponse::Style, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - x_username: String - ).returns(T.attached_class) - end - def self.new(fetched_at:, is_own_account:, tweet_count:, x_username:) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - x_username: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/style_profile.rbi b/rbi/x_twitter_scraper/models/style_profile.rbi index 82dfa61..9088f19 100644 --- a/rbi/x_twitter_scraper/models/style_profile.rbi +++ b/rbi/x_twitter_scraper/models/style_profile.rbi @@ -26,6 +26,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username + # Full style profile with sampled tweets used for tone analysis. sig do params( fetched_at: Time, diff --git a/rbi/x_twitter_scraper/models/style_profile_summary.rbi b/rbi/x_twitter_scraper/models/style_profile_summary.rbi index e06950c..d36acad 100644 --- a/rbi/x_twitter_scraper/models/style_profile_summary.rbi +++ b/rbi/x_twitter_scraper/models/style_profile_summary.rbi @@ -23,6 +23,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username + # Style profile summary with tweet count and ownership flag. sig do params( fetched_at: Time, diff --git a/rbi/x_twitter_scraper/models/style_retrieve_params.rbi b/rbi/x_twitter_scraper/models/style_retrieve_params.rbi index a3eab0a..9d5f256 100644 --- a/rbi/x_twitter_scraper/models/style_retrieve_params.rbi +++ b/rbi/x_twitter_scraper/models/style_retrieve_params.rbi @@ -15,20 +15,20 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :username + attr_accessor :id sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(username:, request_options: {}) + def self.new(id:, request_options: {}) end sig do override.returns( - { username: String, request_options: XTwitterScraper::RequestOptions } + { id: String, request_options: XTwitterScraper::RequestOptions } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/style_retrieve_response.rbi b/rbi/x_twitter_scraper/models/style_retrieve_response.rbi deleted file mode 100644 index ffc566f..0000000 --- a/rbi/x_twitter_scraper/models/style_retrieve_response.rbi +++ /dev/null @@ -1,120 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class StyleRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig do - returns(T::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet]) - end - attr_accessor :tweets - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleRetrieveResponse::Tweet::OrHash - ], - x_username: String - ).returns(T.attached_class) - end - def self.new( - fetched_at:, - is_own_account:, - tweet_count:, - tweets:, - x_username: - ) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet], - x_username: String - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleRetrieveResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :author_username - - sig { params(author_username: String).void } - attr_writer :author_username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - text: String, - author_username: String, - created_at: String - ).returns(T.attached_class) - end - def self.new(id:, text:, author_username: nil, created_at: nil) - end - - sig do - override.returns( - { - id: String, - text: String, - author_username: String, - created_at: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/style_update_params.rbi b/rbi/x_twitter_scraper/models/style_update_params.rbi index bb2c9c6..1db9365 100644 --- a/rbi/x_twitter_scraper/models/style_update_params.rbi +++ b/rbi/x_twitter_scraper/models/style_update_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :username + attr_accessor :id # Display label for the style sig { returns(String) } @@ -27,14 +27,14 @@ module XTwitterScraper sig do params( - username: String, + id: String, label: String, tweets: T::Array[XTwitterScraper::StyleUpdateParams::Tweet::OrHash], request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - username:, + id:, # Display label for the style label:, # Array of tweet objects @@ -46,7 +46,7 @@ module XTwitterScraper sig do override.returns( { - username: String, + id: String, label: String, tweets: T::Array[XTwitterScraper::StyleUpdateParams::Tweet], request_options: XTwitterScraper::RequestOptions diff --git a/rbi/x_twitter_scraper/models/style_update_response.rbi b/rbi/x_twitter_scraper/models/style_update_response.rbi deleted file mode 100644 index 02be40d..0000000 --- a/rbi/x_twitter_scraper/models/style_update_response.rbi +++ /dev/null @@ -1,120 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class StyleUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleUpdateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :fetched_at - - sig { returns(T::Boolean) } - attr_accessor :is_own_account - - sig { returns(Integer) } - attr_accessor :tweet_count - - sig do - returns(T::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet]) - end - attr_accessor :tweets - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[ - XTwitterScraper::Models::StyleUpdateResponse::Tweet::OrHash - ], - x_username: String - ).returns(T.attached_class) - end - def self.new( - fetched_at:, - is_own_account:, - tweet_count:, - tweets:, - x_username: - ) - end - - sig do - override.returns( - { - fetched_at: Time, - is_own_account: T::Boolean, - tweet_count: Integer, - tweets: - T::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet], - x_username: String - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::StyleUpdateResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(String)) } - attr_reader :author_username - - sig { params(author_username: String).void } - attr_writer :author_username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - text: String, - author_username: String, - created_at: String - ).returns(T.attached_class) - end - def self.new(id:, text:, author_username: nil, created_at: nil) - end - - sig do - override.returns( - { - id: String, - text: String, - author_username: String, - created_at: String - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/trend_list_params.rbi b/rbi/x_twitter_scraper/models/trend_list_params.rbi index ee2d17f..98b144c 100644 --- a/rbi/x_twitter_scraper/models/trend_list_params.rbi +++ b/rbi/x_twitter_scraper/models/trend_list_params.rbi @@ -14,6 +14,7 @@ module XTwitterScraper ) end + # Number of trending topics to return (1-50, default 30) sig { returns(T.nilable(Integer)) } attr_reader :count @@ -35,6 +36,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Number of trending topics to return (1-50, default 30) count: nil, # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) woeid: nil, diff --git a/rbi/x_twitter_scraper/models/webhook.rbi b/rbi/x_twitter_scraper/models/webhook.rbi index dabd02a..0108dec 100644 --- a/rbi/x_twitter_scraper/models/webhook.rbi +++ b/rbi/x_twitter_scraper/models/webhook.rbi @@ -14,7 +14,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig { returns(T::Array[XTwitterScraper::Webhook::EventType::OrSymbol]) } + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types sig { returns(T::Boolean) } @@ -23,16 +24,24 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + # Webhook endpoint registered to receive event deliveries. sig do params( id: String, created_at: Time, - event_types: T::Array[XTwitterScraper::Webhook::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, url: String ).returns(T.attached_class) end - def self.new(id:, created_at:, event_types:, is_active:, url:) + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + is_active:, + url: + ) end sig do @@ -40,8 +49,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: - T::Array[XTwitterScraper::Webhook::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], is_active: T::Boolean, url: String } @@ -49,50 +57,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::Webhook::EventType) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let(:"tweet.new", XTwitterScraper::Webhook::EventType::TaggedSymbol) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Webhook::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Webhook::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Webhook::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Webhook::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Webhook::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[XTwitterScraper::Webhook::EventType::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_create_params.rbi b/rbi/x_twitter_scraper/models/webhook_create_params.rbi index 0e7f498..2ce25a4 100644 --- a/rbi/x_twitter_scraper/models/webhook_create_params.rbi +++ b/rbi/x_twitter_scraper/models/webhook_create_params.rbi @@ -14,11 +14,8 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[XTwitterScraper::WebhookCreateParams::EventType::OrSymbol] - ) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::OrSymbol]) } attr_accessor :event_types # HTTPS URL @@ -27,13 +24,13 @@ module XTwitterScraper sig do params( - event_types: - T::Array[XTwitterScraper::WebhookCreateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Array of event types to subscribe to. event_types:, # HTTPS URL url:, @@ -44,10 +41,7 @@ module XTwitterScraper sig do override.returns( { - event_types: - T::Array[ - XTwitterScraper::WebhookCreateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], url: String, request_options: XTwitterScraper::RequestOptions } @@ -55,57 +49,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::WebhookCreateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::WebhookCreateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_create_response.rbi b/rbi/x_twitter_scraper/models/webhook_create_response.rbi index 7891bb4..d3827c9 100644 --- a/rbi/x_twitter_scraper/models/webhook_create_response.rbi +++ b/rbi/x_twitter_scraper/models/webhook_create_response.rbi @@ -17,13 +17,8 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - sig do - returns( - T::Array[ - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ] - ) - end + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types sig { returns(String) } @@ -36,15 +31,19 @@ module XTwitterScraper params( id: String, created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookCreateResponse::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], secret: String, url: String ).returns(T.attached_class) end - def self.new(id:, created_at:, event_types:, secret:, url:) + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + secret:, + url: + ) end sig do @@ -52,10 +51,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], secret: String, url: String } @@ -63,60 +59,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::WebhookCreateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::WebhookCreateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_list_deliveries_response.rbi b/rbi/x_twitter_scraper/models/webhook_list_deliveries_response.rbi index d27a030..aefe98d 100644 --- a/rbi/x_twitter_scraper/models/webhook_list_deliveries_response.rbi +++ b/rbi/x_twitter_scraper/models/webhook_list_deliveries_response.rbi @@ -11,122 +11,22 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[ - XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery - ] - ) - end + sig { returns(T::Array[XTwitterScraper::Delivery]) } attr_accessor :deliveries sig do - params( - deliveries: - T::Array[ - XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery::OrHash - ] - ).returns(T.attached_class) + params(deliveries: T::Array[XTwitterScraper::Delivery::OrHash]).returns( + T.attached_class + ) end def self.new(deliveries:) end sig do - override.returns( - { - deliveries: - T::Array[ - XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery - ] - } - ) + override.returns({ deliveries: T::Array[XTwitterScraper::Delivery] }) end def to_hash end - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Integer) } - attr_accessor :attempts - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :status - - sig { returns(String) } - attr_accessor :stream_event_id - - sig { returns(T.nilable(Time)) } - attr_reader :delivered_at - - sig { params(delivered_at: Time).void } - attr_writer :delivered_at - - sig { returns(T.nilable(String)) } - attr_reader :last_error - - sig { params(last_error: String).void } - attr_writer :last_error - - sig { returns(T.nilable(Integer)) } - attr_reader :last_status_code - - sig { params(last_status_code: Integer).void } - attr_writer :last_status_code - - sig do - params( - id: String, - attempts: Integer, - created_at: Time, - status: String, - stream_event_id: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - attempts:, - created_at:, - status:, - stream_event_id:, - delivered_at: nil, - last_error: nil, - last_status_code: nil - ) - end - - sig do - override.returns( - { - id: String, - attempts: Integer, - created_at: Time, - status: String, - stream_event_id: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_list_response.rbi b/rbi/x_twitter_scraper/models/webhook_list_response.rbi index cdd5972..8933627 100644 --- a/rbi/x_twitter_scraper/models/webhook_list_response.rbi +++ b/rbi/x_twitter_scraper/models/webhook_list_response.rbi @@ -11,149 +11,20 @@ module XTwitterScraper ) end - sig do - returns(T::Array[XTwitterScraper::Models::WebhookListResponse::Webhook]) - end + sig { returns(T::Array[XTwitterScraper::Webhook]) } attr_accessor :webhooks sig do - params( - webhooks: - T::Array[ - XTwitterScraper::Models::WebhookListResponse::Webhook::OrHash - ] - ).returns(T.attached_class) + params(webhooks: T::Array[XTwitterScraper::Webhook::OrHash]).returns( + T.attached_class + ) end def self.new(webhooks:) end - sig do - override.returns( - { - webhooks: - T::Array[XTwitterScraper::Models::WebhookListResponse::Webhook] - } - ) - end + sig { override.returns({ webhooks: T::Array[XTwitterScraper::Webhook] }) } def to_hash end - - class Webhook < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::WebhookListResponse::Webhook, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :url - - sig do - params( - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::OrSymbol - ], - is_active: T::Boolean, - url: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, event_types:, is_active:, url:) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ], - is_active: T::Boolean, - url: String - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::WebhookListResponse::Webhook::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_update_params.rbi b/rbi/x_twitter_scraper/models/webhook_update_params.rbi index 365e9b4..49251ea 100644 --- a/rbi/x_twitter_scraper/models/webhook_update_params.rbi +++ b/rbi/x_twitter_scraper/models/webhook_update_params.rbi @@ -17,20 +17,12 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - sig do - returns( - T.nilable( - T::Array[XTwitterScraper::WebhookUpdateParams::EventType::OrSymbol] - ) - ) - end + # Array of event types to subscribe to. + sig { returns(T.nilable(T::Array[XTwitterScraper::EventType::OrSymbol])) } attr_reader :event_types sig do - params( - event_types: - T::Array[XTwitterScraper::WebhookUpdateParams::EventType::OrSymbol] - ).void + params(event_types: T::Array[XTwitterScraper::EventType::OrSymbol]).void end attr_writer :event_types @@ -49,8 +41,7 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[XTwitterScraper::WebhookUpdateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, url: String, request_options: XTwitterScraper::RequestOptions::OrHash @@ -58,6 +49,7 @@ module XTwitterScraper end def self.new( id:, + # Array of event types to subscribe to. event_types: nil, is_active: nil, url: nil, @@ -69,10 +61,7 @@ module XTwitterScraper override.returns( { id: String, - event_types: - T::Array[ - XTwitterScraper::WebhookUpdateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, url: String, request_options: XTwitterScraper::RequestOptions @@ -81,57 +70,6 @@ module XTwitterScraper end def to_hash end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, XTwitterScraper::WebhookUpdateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::WebhookUpdateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/x_twitter_scraper/models/webhook_update_response.rbi b/rbi/x_twitter_scraper/models/webhook_update_response.rbi deleted file mode 100644 index 9a9a3b7..0000000 --- a/rbi/x_twitter_scraper/models/webhook_update_response.rbi +++ /dev/null @@ -1,122 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class WebhookUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::WebhookUpdateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig do - returns( - T::Array[ - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :url - - sig do - params( - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookUpdateResponse::EventType::OrSymbol - ], - is_active: T::Boolean, - url: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, event_types:, is_active:, url:) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - event_types: - T::Array[ - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ], - is_active: T::Boolean, - url: String - } - ) - end - def to_hash - end - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::WebhookUpdateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TWEET_NEW = - T.let( - :"tweet.new", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - TWEET_REPLY = - T.let( - :"tweet.reply", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - TWEET_RETWEET = - T.let( - :"tweet.retweet", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - TWEET_QUOTE = - T.let( - :"tweet.quote", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_GAINED = - T.let( - :"follower.gained", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - FOLLOWER_LOST = - T.let( - :"follower.lost", - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/winner.rbi b/rbi/x_twitter_scraper/models/winner.rbi index ca5f2ee..7d9c8a1 100644 --- a/rbi/x_twitter_scraper/models/winner.rbi +++ b/rbi/x_twitter_scraper/models/winner.rbi @@ -20,6 +20,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :tweet_id + # Giveaway draw winner with position and backup flag. sig do params( author_username: String, diff --git a/rbi/x_twitter_scraper/models/x/account_bulk_retry_params.rbi b/rbi/x_twitter_scraper/models/x/account_bulk_retry_params.rbi new file mode 100644 index 0000000..ed1b8b2 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/account_bulk_retry_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class AccountBulkRetryParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::AccountBulkRetryParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + params( + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig do + override.returns({ request_options: XTwitterScraper::RequestOptions }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/account_bulk_retry_response.rbi b/rbi/x_twitter_scraper/models/x/account_bulk_retry_response.rbi new file mode 100644 index 0000000..90301cf --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/account_bulk_retry_response.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class AccountBulkRetryResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountBulkRetryResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + # Number of accounts cleared + sig { returns(Integer) } + attr_accessor :cleared + + sig { params(cleared: Integer).returns(T.attached_class) } + def self.new( + # Number of accounts cleared + cleared: + ) + end + + sig { override.returns({ cleared: Integer }) } + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/account_list_response.rbi b/rbi/x_twitter_scraper/models/x/account_list_response.rbi index cab0930..aa53da0 100644 --- a/rbi/x_twitter_scraper/models/x/account_list_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_list_response.rbi @@ -12,87 +12,22 @@ module XTwitterScraper ) end - sig do - returns( - T::Array[XTwitterScraper::Models::X::AccountListResponse::Account] - ) - end + sig { returns(T::Array[XTwitterScraper::X::XAccount]) } attr_accessor :accounts sig do params( - accounts: - T::Array[ - XTwitterScraper::Models::X::AccountListResponse::Account::OrHash - ] + accounts: T::Array[XTwitterScraper::X::XAccount::OrHash] ).returns(T.attached_class) end def self.new(accounts:) end sig do - override.returns( - { - accounts: - T::Array[ - XTwitterScraper::Models::X::AccountListResponse::Account - ] - } - ) + override.returns({ accounts: T::Array[XTwitterScraper::X::XAccount] }) end def to_hash end - - class Account < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::AccountListResponse::Account, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :status - - sig { returns(String) } - attr_accessor :x_user_id - - sig { returns(String) } - attr_accessor :x_username - - sig do - params( - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, status:, x_user_id:, x_username:) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi b/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi index 0b1204f..c41ea44 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi @@ -18,11 +18,11 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Account password + # Updated account password sig { returns(String) } attr_accessor :password - # TOTP secret for 2FA + # TOTP secret for 2FA re-authentication sig { returns(T.nilable(String)) } attr_reader :totp_secret @@ -39,9 +39,9 @@ module XTwitterScraper end def self.new( id:, - # Account password + # Updated account password password:, - # TOTP secret for 2FA + # TOTP secret for 2FA re-authentication totp_secret: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/account_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/account_retrieve_response.rbi deleted file mode 100644 index f716db2..0000000 --- a/rbi/x_twitter_scraper/models/x/account_retrieve_response.rbi +++ /dev/null @@ -1,91 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::AccountRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :status - - sig { returns(String) } - attr_accessor :x_user_id - - sig { returns(String) } - attr_accessor :x_username - - sig { returns(T.nilable(Time)) } - attr_reader :cookies_obtained_at - - sig { params(cookies_obtained_at: Time).void } - attr_writer :cookies_obtained_at - - sig { returns(T.nilable(String)) } - attr_reader :proxy_country - - sig { params(proxy_country: String).void } - attr_writer :proxy_country - - sig { returns(T.nilable(Time)) } - attr_reader :updated_at - - sig { params(updated_at: Time).void } - attr_writer :updated_at - - sig do - params( - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String, - cookies_obtained_at: Time, - proxy_country: String, - updated_at: Time - ).returns(T.attached_class) - end - def self.new( - id:, - created_at:, - status:, - x_user_id:, - x_username:, - cookies_obtained_at: nil, - proxy_country: nil, - updated_at: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String, - cookies_obtained_at: Time, - proxy_country: String, - updated_at: Time - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/bookmark_list_params.rbi b/rbi/x_twitter_scraper/models/x/bookmark_list_params.rbi index d69f314..911e129 100644 --- a/rbi/x_twitter_scraper/models/x/bookmark_list_params.rbi +++ b/rbi/x_twitter_scraper/models/x/bookmark_list_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # Pagination cursor from previous response + # Pagination cursor for bookmarks sig { returns(T.nilable(String)) } attr_reader :cursor @@ -37,7 +37,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Pagination cursor from previous response + # Pagination cursor for bookmarks cursor: nil, # Optional bookmark folder ID folder_id: nil, diff --git a/rbi/x_twitter_scraper/models/x/bookmark_list_response.rbi b/rbi/x_twitter_scraper/models/x/bookmark_list_response.rbi deleted file mode 100644 index e34af4d..0000000 --- a/rbi/x_twitter_scraper/models/x/bookmark_list_response.rbi +++ /dev/null @@ -1,231 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class BookmarkListResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::BookmarkListResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::BookmarkListResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::BookmarkListResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi b/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi index 6ed94a9..b27db72 100644 --- a/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi @@ -19,7 +19,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account @@ -32,7 +32,7 @@ module XTwitterScraper end def self.new( id:, - # X account (@username or account ID) + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi b/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi deleted file mode 100644 index a743922..0000000 --- a/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi +++ /dev/null @@ -1,50 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - module Communities - class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::Communities::JoinCreateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :community_id - - sig { returns(String) } - attr_accessor :community_name - - sig { returns(T::Boolean) } - attr_accessor :success - - sig do - params( - community_id: String, - community_name: String, - success: T::Boolean - ).returns(T.attached_class) - end - def self.new(community_id:, community_name:, success: true) - end - - sig do - override.returns( - { - community_id: String, - community_name: String, - success: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi b/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi index e85492d..b43addd 100644 --- a/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi @@ -19,7 +19,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account @@ -32,7 +32,7 @@ module XTwitterScraper end def self.new( id:, - # X account (@username or account ID) + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi b/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi deleted file mode 100644 index 8e8f486..0000000 --- a/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi +++ /dev/null @@ -1,50 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - module Communities - class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :community_id - - sig { returns(String) } - attr_accessor :community_name - - sig { returns(T::Boolean) } - attr_accessor :success - - sig do - params( - community_id: String, - community_name: String, - success: T::Boolean - ).returns(T.attached_class) - end - def self.new(community_id:, community_name:, success: true) - end - - sig do - override.returns( - { - community_id: String, - community_name: String, - success: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi b/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi new file mode 100644 index 0000000..49b81e6 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + module Communities + class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::Communities::TweetListByCommunityParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Pagination cursor for community tweets + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig do + params( + id: String, + cursor: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Pagination cursor for community tweets + cursor: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + cursor: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi b/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi index 9ef52d9..7e7f7d2 100644 --- a/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi @@ -16,18 +16,18 @@ module XTwitterScraper ) end - # Search query + # Search query for cross-community tweets sig { returns(String) } attr_accessor :q - # Pagination cursor + # Pagination cursor for cross-community results sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Sort order (Latest or Top) + # Sort order for cross-community results (Latest or Top) sig { returns(T.nilable(String)) } attr_reader :query_type @@ -43,11 +43,11 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Search query + # Search query for cross-community tweets q:, - # Pagination cursor + # Pagination cursor for cross-community results cursor: nil, - # Sort order (Latest or Top) + # Sort order for cross-community results (Latest or Top) query_type: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/community_action_result.rbi b/rbi/x_twitter_scraper/models/x/community_action_result.rbi index b692c57..c9e818b 100644 --- a/rbi/x_twitter_scraper/models/x/community_action_result.rbi +++ b/rbi/x_twitter_scraper/models/x/community_action_result.rbi @@ -21,6 +21,7 @@ module XTwitterScraper sig { returns(T::Boolean) } attr_accessor :success + # Result of a community join or leave action. sig do params( community_id: String, diff --git a/rbi/x_twitter_scraper/models/x/community_create_params.rbi b/rbi/x_twitter_scraper/models/x/community_create_params.rbi index 19d7ece..9af899d 100644 --- a/rbi/x_twitter_scraper/models/x/community_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_create_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # X account (@username or account ID) + # X account (@username or ID) creating the community sig { returns(String) } attr_accessor :account @@ -39,7 +39,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # X account (@username or account ID) + # X account (@username or ID) creating the community account:, # Community name name:, diff --git a/rbi/x_twitter_scraper/models/x/community_delete_params.rbi b/rbi/x_twitter_scraper/models/x/community_delete_params.rbi index baf7909..8138efb 100644 --- a/rbi/x_twitter_scraper/models/x/community_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_delete_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # X account (@username or account ID) + # X account (@username or ID) deleting the community sig { returns(String) } attr_accessor :account @@ -36,7 +36,7 @@ module XTwitterScraper end def self.new( id:, - # X account (@username or account ID) + # X account (@username or ID) deleting the community account:, # Community name for confirmation community_name:, diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi index 7a520e2..d439ba8 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi @@ -60,7 +60,7 @@ module XTwitterScraper ) end - # Community ID + # Unique community identifier sig { returns(String) } attr_accessor :id @@ -78,7 +78,7 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at - # Community description + # About text for the community sig { returns(T.nilable(String)) } attr_reader :description @@ -106,7 +106,7 @@ module XTwitterScraper sig { params(moderator_count: Integer).void } attr_writer :moderator_count - # Community name + # Display name of the community sig { returns(T.nilable(String)) } attr_reader :name @@ -173,13 +173,13 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Community ID + # Unique community identifier id:, # Community banner image URL banner_url: nil, # Community creation timestamp created_at: nil, - # Community description + # About text for the community description: nil, # Join policy (open or restricted) join_policy: nil, @@ -187,7 +187,7 @@ module XTwitterScraper member_count: nil, # Total moderator count moderator_count: nil, - # Community name + # Display name of the community name: nil, # Primary topic primary_topic: nil, diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_moderators_params.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_moderators_params.rbi index 628b4ae..9e962d8 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_moderators_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_moderators_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for community moderators sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for community moderators cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi index f354f92..140bd60 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi @@ -19,7 +19,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :q - # Pagination cursor + # Pagination cursor for community search sig { returns(T.nilable(String)) } attr_reader :cursor @@ -44,7 +44,7 @@ module XTwitterScraper def self.new( # Search query q:, - # Pagination cursor + # Pagination cursor for community search cursor: nil, # Sort order (Latest or Top) query_type: nil, diff --git a/rbi/x_twitter_scraper/models/x/dm_retrieve_history_params.rbi b/rbi/x_twitter_scraper/models/x/dm_retrieve_history_params.rbi index 1ef8428..2bd7107 100644 --- a/rbi/x_twitter_scraper/models/x/dm_retrieve_history_params.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_retrieve_history_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :user_id - # Pagination cursor from previous response + # Pagination cursor for DM history sig { returns(T.nilable(String)) } attr_reader :cursor @@ -42,7 +42,7 @@ module XTwitterScraper end def self.new( user_id:, - # Pagination cursor from previous response + # Pagination cursor for DM history cursor: nil, # Legacy pagination cursor (backward compat) max_id: nil, diff --git a/rbi/x_twitter_scraper/models/x/dm_send_params.rbi b/rbi/x_twitter_scraper/models/x/dm_send_params.rbi index fbe5447..3433611 100644 --- a/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_send_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :user_id - # X account (@username or account ID) + # X account (@username or ID) sending the DM sig { returns(String) } attr_accessor :account @@ -49,7 +49,7 @@ module XTwitterScraper end def self.new( user_id:, - # X account (@username or account ID) + # X account (@username or ID) sending the DM account:, text:, media_ids: nil, diff --git a/rbi/x_twitter_scraper/models/x/list_retrieve_followers_params.rbi b/rbi/x_twitter_scraper/models/x/list_retrieve_followers_params.rbi index ee8d742..c40f9ea 100644 --- a/rbi/x_twitter_scraper/models/x/list_retrieve_followers_params.rbi +++ b/rbi/x_twitter_scraper/models/x/list_retrieve_followers_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for list followers sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for list followers cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/list_retrieve_members_params.rbi b/rbi/x_twitter_scraper/models/x/list_retrieve_members_params.rbi index bf50e12..4f1f01d 100644 --- a/rbi/x_twitter_scraper/models/x/list_retrieve_members_params.rbi +++ b/rbi/x_twitter_scraper/models/x/list_retrieve_members_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for list members sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for list members cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi b/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi index 28aa975..0c532b7 100644 --- a/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +++ b/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for list tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -58,7 +58,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for list tweets cursor: nil, # Include replies (default false) include_replies: nil, diff --git a/rbi/x_twitter_scraper/models/x/media_upload_params.rbi b/rbi/x_twitter_scraper/models/x/media_upload_params.rbi index 17c752d..262efb4 100644 --- a/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +++ b/rbi/x_twitter_scraper/models/x/media_upload_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # X account (@username or account ID) + # X account (@username or ID) uploading media sig { returns(String) } attr_accessor :account @@ -38,7 +38,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # X account (@username or account ID) + # X account (@username or ID) uploading media account:, # Media file to upload file:, diff --git a/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi b/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi index 173ec4c..f635d4b 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # X account (@username or account ID) + # X account (@username or ID) for avatar update sig { returns(String) } attr_accessor :account @@ -31,7 +31,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # X account (@username or account ID) + # X account (@username or ID) for avatar update account:, # Avatar image (max 716KB) file:, diff --git a/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi b/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi index ebb88ae..d9c3ec1 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # X account (@username or account ID) + # X account (@username or ID) for banner update sig { returns(String) } attr_accessor :account @@ -31,7 +31,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # X account (@username or account ID) + # X account (@username or ID) for banner update account:, # Banner image (max 2MB) file:, diff --git a/rbi/x_twitter_scraper/models/x/profile_update_params.rbi b/rbi/x_twitter_scraper/models/x/profile_update_params.rbi index 4eb9e3c..9a81885 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_params.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_params.rbi @@ -15,7 +15,7 @@ module XTwitterScraper ) end - # X account (@username or account ID) + # X account (@username or ID) to update profile sig { returns(String) } attr_accessor :account @@ -57,7 +57,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # X account (@username or account ID) + # X account (@username or ID) to update profile account:, # Bio description description: nil, diff --git a/rbi/x_twitter_scraper/models/x/search_tweet.rbi b/rbi/x_twitter_scraper/models/x/search_tweet.rbi index 88e4d43..437adf7 100644 --- a/rbi/x_twitter_scraper/models/x/search_tweet.rbi +++ b/rbi/x_twitter_scraper/models/x/search_tweet.rbi @@ -38,6 +38,13 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at + # True for Note Tweets (long-form content, up to 25,000 characters) + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_note_tweet + + sig { params(is_note_tweet: T::Boolean).void } + attr_writer :is_note_tweet + sig { returns(T.nilable(Integer)) } attr_reader :like_count @@ -68,6 +75,7 @@ module XTwitterScraper sig { params(view_count: Integer).void } attr_writer :view_count + # Tweet returned from search results with inline author info. sig do params( id: String, @@ -75,6 +83,7 @@ module XTwitterScraper author: XTwitterScraper::X::SearchTweet::Author::OrHash, bookmark_count: Integer, created_at: String, + is_note_tweet: T::Boolean, like_count: Integer, quote_count: Integer, reply_count: Integer, @@ -88,6 +97,8 @@ module XTwitterScraper author: nil, bookmark_count: nil, created_at: nil, + # True for Note Tweets (long-form content, up to 25,000 characters) + is_note_tweet: nil, like_count: nil, quote_count: nil, reply_count: nil, @@ -104,6 +115,7 @@ module XTwitterScraper author: XTwitterScraper::X::SearchTweet::Author, bookmark_count: Integer, created_at: String, + is_note_tweet: T::Boolean, like_count: Integer, quote_count: Integer, reply_count: Integer, diff --git a/rbi/x_twitter_scraper/models/x/tweet_author.rbi b/rbi/x_twitter_scraper/models/x/tweet_author.rbi index 18d0708..0c8c7f1 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_author.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_author.rbi @@ -30,6 +30,7 @@ module XTwitterScraper sig { params(profile_picture: String).void } attr_writer :profile_picture + # Author of a tweet with follower count and verification status. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi index 6fb74f8..ae02874 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi @@ -16,22 +16,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - tweet_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -40,7 +40,7 @@ module XTwitterScraper sig do override.returns( { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi index da80ae4..5e1e78d 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi @@ -36,12 +36,75 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :view_count + # ID of the root tweet in the conversation thread + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + sig { returns(T.nilable(String)) } attr_reader :created_at sig { params(created_at: String).void } attr_writer :created_at + # Parsed entities from the tweet text (URLs, mentions, hashtags, media) + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + # Whether this is a Note Tweet (long-form post, up to 25,000 characters) + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_note_tweet + + sig { params(is_note_tweet: T::Boolean).void } + attr_writer :is_note_tweet + + # Whether this tweet quotes another tweet + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_quote_status + + sig { params(is_quote_status: T::Boolean).void } + attr_writer :is_quote_status + + # Whether this tweet is a reply to another tweet + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_reply + + sig { params(is_reply: T::Boolean).void } + attr_writer :is_reply + + # Attached media items, omitted when the tweet has no media + sig do + returns(T.nilable(T::Array[XTwitterScraper::X::TweetDetail::Media])) + end + attr_reader :media + + sig do + params( + media: T::Array[XTwitterScraper::X::TweetDetail::Media::OrHash] + ).void + end + attr_writer :media + + # The quoted tweet object, present when isQuoteStatus is true + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :quoted_tweet + + sig { params(quoted_tweet: T::Hash[Symbol, T.anything]).void } + attr_writer :quoted_tweet + + # Client application used to post this tweet + sig { returns(T.nilable(String)) } + attr_reader :source + + sig { params(source: String).void } + attr_writer :source + + # Full tweet with text, engagement metrics, media, and metadata. sig do params( id: String, @@ -52,7 +115,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - created_at: String + conversation_id: String, + created_at: String, + entities: T::Hash[Symbol, T.anything], + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + media: T::Array[XTwitterScraper::X::TweetDetail::Media::OrHash], + quoted_tweet: T::Hash[Symbol, T.anything], + source: String ).returns(T.attached_class) end def self.new( @@ -64,7 +135,23 @@ module XTwitterScraper retweet_count:, text:, view_count:, - created_at: nil + # ID of the root tweet in the conversation thread + conversation_id: nil, + created_at: nil, + # Parsed entities from the tweet text (URLs, mentions, hashtags, media) + entities: nil, + # Whether this is a Note Tweet (long-form post, up to 25,000 characters) + is_note_tweet: nil, + # Whether this tweet quotes another tweet + is_quote_status: nil, + # Whether this tweet is a reply to another tweet + is_reply: nil, + # Attached media items, omitted when the tweet has no media + media: nil, + # The quoted tweet object, present when isQuoteStatus is true + quoted_tweet: nil, + # Client application used to post this tweet + source: nil ) end @@ -79,12 +166,117 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - created_at: String + conversation_id: String, + created_at: String, + entities: T::Hash[Symbol, T.anything], + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + media: T::Array[XTwitterScraper::X::TweetDetail::Media], + quoted_tweet: T::Hash[Symbol, T.anything], + source: String } ) end def to_hash end + + class Media < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::Media, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: XTwitterScraper::X::TweetDetail::Media::Type::OrSymbol + ).void + end + attr_writer :type + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + sig do + params( + media_url: String, + type: XTwitterScraper::X::TweetDetail::Media::Type::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new(media_url: nil, type: nil, url: nil) + end + + sig do + override.returns( + { + media_url: String, + type: + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetDetail::Media::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PHOTO = + T.let( + :photo, + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol + ) + VIDEO = + T.let( + :video, + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol + ) + ANIMATED_GIF = + T.let( + :animated_gif, + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetDetail::Media::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbi index 2c7ec89..d558120 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor from previous response + # Pagination cursor for favoriters sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor from previous response + # Pagination cursor for favoriters cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbi deleted file mode 100644 index 51c04b7..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbi +++ /dev/null @@ -1,177 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetGetFavoritersResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetFavoritersResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::TweetGetFavoritersResponse::User - ] - ) - end - attr_accessor :users - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::TweetGetFavoritersResponse::User::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, users:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::TweetGetFavoritersResponse::User - ] - } - ) - end - def to_hash - end - - class User < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetFavoritersResponse::User, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(Integer)) } - attr_reader :followers - - sig { params(followers: Integer).void } - attr_writer :followers - - sig { returns(T.nilable(Integer)) } - attr_reader :following - - sig { params(following: Integer).void } - attr_writer :following - - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig { returns(T.nilable(Integer)) } - attr_reader :statuses_count - - sig { params(statuses_count: Integer).void } - attr_writer :statuses_count - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - name:, - username:, - created_at: nil, - description: nil, - followers: nil, - following: nil, - location: nil, - profile_picture: nil, - statuses_count: nil, - verified: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi index be9cd13..1cba663 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi @@ -18,28 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for quote tweets sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Include replies (default false) + # Include reply quotes (default false) sig { returns(T.nilable(T::Boolean)) } attr_reader :include_replies sig { params(include_replies: T::Boolean).void } attr_writer :include_replies - # Unix timestamp - filter after + # Unix timestamp - return quotes posted after this time sig { returns(T.nilable(String)) } attr_reader :since_time sig { params(since_time: String).void } attr_writer :since_time - # Unix timestamp - filter before + # Unix timestamp - return quotes posted before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -58,13 +58,13 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for quote tweets cursor: nil, - # Include replies (default false) + # Include reply quotes (default false) include_replies: nil, - # Unix timestamp - filter after + # Unix timestamp - return quotes posted after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return quotes posted before this time until_time: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_quotes_response.rbi deleted file mode 100644 index 171dc79..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_response.rbi +++ /dev/null @@ -1,231 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetGetQuotesResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetQuotesResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi index 57b1790..0b843f9 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi @@ -18,21 +18,21 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for tweet replies sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Unix timestamp - filter after + # Unix timestamp - return replies posted after this time sig { returns(T.nilable(String)) } attr_reader :since_time sig { params(since_time: String).void } attr_writer :since_time - # Unix timestamp - filter before + # Unix timestamp - return replies posted before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -50,11 +50,11 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for tweet replies cursor: nil, - # Unix timestamp - filter after + # Unix timestamp - return replies posted after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return replies posted before this time until_time: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi deleted file mode 100644 index 943f062..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +++ /dev/null @@ -1,231 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetGetRepliesResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetRepliesResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbi index 2c9008a..bb917f0 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for retweeters sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for retweeters cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbi deleted file mode 100644 index 830006b..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbi +++ /dev/null @@ -1,177 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetGetRetweetersResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetRetweetersResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::TweetGetRetweetersResponse::User - ] - ) - end - attr_accessor :users - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::TweetGetRetweetersResponse::User::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, users:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::TweetGetRetweetersResponse::User - ] - } - ) - end - def to_hash - end - - class User < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetRetweetersResponse::User, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(Integer)) } - attr_reader :followers - - sig { params(followers: Integer).void } - attr_writer :followers - - sig { returns(T.nilable(Integer)) } - attr_reader :following - - sig { params(following: Integer).void } - attr_writer :following - - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig { returns(T.nilable(Integer)) } - attr_reader :statuses_count - - sig { params(statuses_count: Integer).void } - attr_writer :statuses_count - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - name:, - username:, - created_at: nil, - description: nil, - followers: nil, - following: nil, - location: nil, - profile_picture: nil, - statuses_count: nil, - verified: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi index 256b8f9..29ed811 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for thread tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for thread tweets cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_thread_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_thread_response.rbi deleted file mode 100644 index 8a4886b..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_get_thread_response.rbi +++ /dev/null @@ -1,231 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetGetThreadResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetThreadResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweet_retrieve_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_retrieve_params.rbi index ece1028..6db414d 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_retrieve_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_retrieve_params.rbi @@ -16,23 +16,20 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id sig do params( - tweet_id: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(tweet_id:, request_options: {}) + def self.new(id:, request_options: {}) end sig do override.returns( - { - tweet_id: String, - request_options: XTwitterScraper::RequestOptions - } + { id: String, request_options: XTwitterScraper::RequestOptions } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi index 2d2ff27..c906d98 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi @@ -12,199 +12,44 @@ module XTwitterScraper ) end - sig do - returns(XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet) - end + # Full tweet with text, engagement metrics, media, and metadata. + sig { returns(XTwitterScraper::X::TweetDetail) } attr_reader :tweet - sig do - params( - tweet: - XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet::OrHash - ).void - end + sig { params(tweet: XTwitterScraper::X::TweetDetail::OrHash).void } attr_writer :tweet - sig do - returns( - T.nilable(XTwitterScraper::Models::X::TweetRetrieveResponse::Author) - ) - end + # Author of a tweet with follower count and verification status. + sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } attr_reader :author - sig do - params( - author: - XTwitterScraper::Models::X::TweetRetrieveResponse::Author::OrHash - ).void - end + sig { params(author: XTwitterScraper::X::TweetAuthor::OrHash).void } attr_writer :author sig do params( - tweet: - XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet::OrHash, - author: - XTwitterScraper::Models::X::TweetRetrieveResponse::Author::OrHash + tweet: XTwitterScraper::X::TweetDetail::OrHash, + author: XTwitterScraper::X::TweetAuthor::OrHash ).returns(T.attached_class) end - def self.new(tweet:, author: nil) + def self.new( + # Full tweet with text, engagement metrics, media, and metadata. + tweet:, + # Author of a tweet with follower count and verification status. + author: nil + ) end sig do override.returns( { - tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author + tweet: XTwitterScraper::X::TweetDetail, + author: XTwitterScraper::X::TweetAuthor } ) end def to_hash end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Integer) } - attr_accessor :bookmark_count - - sig { returns(Integer) } - attr_accessor :like_count - - sig { returns(Integer) } - attr_accessor :quote_count - - sig { returns(Integer) } - attr_accessor :reply_count - - sig { returns(Integer) } - attr_accessor :retweet_count - - sig { returns(String) } - attr_accessor :text - - sig { returns(Integer) } - attr_accessor :view_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig do - params( - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - created_at: String - ).returns(T.attached_class) - end - def self.new( - id:, - bookmark_count:, - like_count:, - quote_count:, - reply_count:, - retweet_count:, - text:, - view_count:, - created_at: nil - ) - end - - sig do - override.returns( - { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - created_at: String - } - ) - end - def to_hash - end - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetRetrieveResponse::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Integer) } - attr_accessor :followers - - sig { returns(String) } - attr_accessor :username - - sig { returns(T::Boolean) } - attr_accessor :verified - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig do - params( - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - ).returns(T.attached_class) - end - def self.new( - id:, - followers:, - username:, - verified:, - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi index 798bae8..5cb9a13 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi @@ -26,7 +26,7 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Deprecated — use cursor-based pagination instead + # Max tweets to return (server paginates internally). Omit for single page (~20). sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -82,7 +82,7 @@ module XTwitterScraper q:, # Pagination cursor from previous response cursor: nil, - # Deprecated — use cursor-based pagination instead + # Max tweets to return (server paginates internally). Omit for single page (~20). limit: nil, # Sort order — Latest (chronological) or Top (engagement-ranked) query_type: nil, diff --git a/rbi/x_twitter_scraper/models/x/tweet_search_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_search_response.rbi deleted file mode 100644 index 07b505f..0000000 --- a/rbi/x_twitter_scraper/models/x/tweet_search_response.rbi +++ /dev/null @@ -1,229 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class TweetSearchResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetSearchResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetSearchResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi b/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi index f1bca9c..09fd369 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - tweet_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi b/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi index 715c364..393b775 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - tweet_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi b/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi index dbcf8ad..0e04b76 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - tweet_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi b/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi index 1999988..255a298 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - tweet_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/user_profile.rbi b/rbi/x_twitter_scraper/models/x/user_profile.rbi index 25745c8..555d9d3 100644 --- a/rbi/x_twitter_scraper/models/x/user_profile.rbi +++ b/rbi/x_twitter_scraper/models/x/user_profile.rbi @@ -69,6 +69,7 @@ module XTwitterScraper sig { params(verified: T::Boolean).void } attr_writer :verified + # X user profile with bio, follower counts, and verification status. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_followers_params.rbi index 47de00f..565020c 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_followers_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for followers list sig { returns(T.nilable(String)) } attr_reader :cursor @@ -42,7 +42,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for followers list cursor: nil, # Items per page (20-200, default 200) page_size: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbi index 310fd84..28b1f85 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor from previous response + # Pagination cursor for followers-you-know sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor from previous response + # Pagination cursor for followers-you-know cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbi deleted file mode 100644 index ca6d879..0000000 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbi +++ /dev/null @@ -1,177 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserRetrieveFollowersYouKnowResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User - ] - ) - end - attr_accessor :users - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, users:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - users: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User - ] - } - ) - end - def to_hash - end - - class User < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(Integer)) } - attr_reader :followers - - sig { params(followers: Integer).void } - attr_writer :followers - - sig { returns(T.nilable(Integer)) } - attr_reader :following - - sig { params(following: Integer).void } - attr_writer :following - - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig { returns(T.nilable(Integer)) } - attr_reader :statuses_count - - sig { params(statuses_count: Integer).void } - attr_writer :statuses_count - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - name:, - username:, - created_at: nil, - description: nil, - followers: nil, - following: nil, - location: nil, - profile_picture: nil, - statuses_count: nil, - verified: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi index 6c6e713..5d5ccfc 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi @@ -18,14 +18,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for following list sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Items per page (20-200, default 200) + # Results per page (20-200, default 200) sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -42,9 +42,9 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for following list cursor: nil, - # Items per page (20-200, default 200) + # Results per page (20-200, default 200) page_size: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi index 82dbbf3..264ebca 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor from previous response + # Pagination cursor for liked tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor from previous response + # Pagination cursor for liked tweets cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_likes_response.rbi deleted file mode 100644 index 291e6e5..0000000 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_response.rbi +++ /dev/null @@ -1,233 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserRetrieveLikesResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveLikesResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet - ] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi index d88e428..ea7d8f7 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor from previous response + # Pagination cursor for media tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor from previous response + # Pagination cursor for media tweets cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_media_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_media_response.rbi deleted file mode 100644 index a37c912..0000000 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_media_response.rbi +++ /dev/null @@ -1,233 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserRetrieveMediaResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveMediaResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet - ] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi index 2d046e7..adbb1a3 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi @@ -18,21 +18,21 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for mentions sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Unix timestamp - filter after + # Unix timestamp - return mentions after this time sig { returns(T.nilable(String)) } attr_reader :since_time sig { params(since_time: String).void } attr_writer :since_time - # Unix timestamp - filter before + # Unix timestamp - return mentions before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -50,11 +50,11 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for mentions cursor: nil, - # Unix timestamp - filter after + # Unix timestamp - return mentions after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return mentions before this time until_time: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_params.rbi index 3107dc6..38f3240 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_params.rbi @@ -16,23 +16,20 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :username + attr_accessor :id sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(username:, request_options: {}) + def self.new(id:, request_options: {}) end sig do override.returns( - { - username: String, - request_options: XTwitterScraper::RequestOptions - } + { id: String, request_options: XTwitterScraper::RequestOptions } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_response.rbi deleted file mode 100644 index 22cbac1..0000000 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_response.rbi +++ /dev/null @@ -1,124 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - sig { returns(T.nilable(Integer)) } - attr_reader :followers - - sig { params(followers: Integer).void } - attr_writer :followers - - sig { returns(T.nilable(Integer)) } - attr_reader :following - - sig { params(following: Integer).void } - attr_writer :following - - sig { returns(T.nilable(String)) } - attr_reader :location - - sig { params(location: String).void } - attr_writer :location - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig { returns(T.nilable(Integer)) } - attr_reader :statuses_count - - sig { params(statuses_count: Integer).void } - attr_writer :statuses_count - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new( - id:, - name:, - username:, - created_at: nil, - description: nil, - followers: nil, - following: nil, - location: nil, - profile_picture: nil, - statuses_count: nil, - verified: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_search_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_search_params.rbi index 9654a1e..65c94c4 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_search_params.rbi @@ -15,11 +15,11 @@ module XTwitterScraper ) end - # Search query + # User search query sig { returns(String) } attr_accessor :q - # Pagination cursor + # Pagination cursor for user search sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,9 +34,9 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Search query + # User search query q:, - # Pagination cursor + # Pagination cursor for user search cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi index 3901a9c..f24685f 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor from previous response + # Pagination cursor for user tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -50,7 +50,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor from previous response + # Pagination cursor for user tweets cursor: nil, # Include parent tweet for replies include_parent_tweet: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbi deleted file mode 100644 index 3de82ec..0000000 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbi +++ /dev/null @@ -1,233 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserRetrieveTweetsResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveTweetsResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[ - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet - ] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet - ] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbi index bd450f1..fd8c245 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbi @@ -18,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Pagination cursor + # Pagination cursor for verified followers sig { returns(T.nilable(String)) } attr_reader :cursor @@ -34,7 +34,7 @@ module XTwitterScraper end def self.new( id:, - # Pagination cursor + # Pagination cursor for verified followers cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi b/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi index df2d185..9afc6ae 100644 --- a/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :user_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - user_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi b/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi index 743e315..a68fc3f 100644 --- a/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi +++ b/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi @@ -17,22 +17,22 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :user_id + attr_accessor :id - # X account (@username or account ID) + # X account identifier (@username or account ID) sig { returns(String) } attr_accessor :account sig do params( - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - user_id:, - # X account (@username or account ID) + id:, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -41,7 +41,7 @@ module XTwitterScraper sig do override.returns( { - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/x_account.rbi b/rbi/x_twitter_scraper/models/x/x_account.rbi index 35e847b..2559fa2 100644 --- a/rbi/x_twitter_scraper/models/x/x_account.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account.rbi @@ -29,6 +29,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username + # Linked X account summary with username and connection status. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/x/x_account_detail.rbi b/rbi/x_twitter_scraper/models/x/x_account_detail.rbi index 4087eed..fc1500c 100644 --- a/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account_detail.rbi @@ -47,6 +47,7 @@ module XTwitterScraper sig { params(updated_at: Time).void } attr_writer :updated_at + # Full X account details including proxy, cookies, and update timestamp. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/models/x_get_article_response.rbi b/rbi/x_twitter_scraper/models/x_get_article_response.rbi index eda4d02..5601add 100644 --- a/rbi/x_twitter_scraper/models/x_get_article_response.rbi +++ b/rbi/x_twitter_scraper/models/x_get_article_response.rbi @@ -21,33 +21,32 @@ module XTwitterScraper end attr_writer :article - sig do - returns(T.nilable(XTwitterScraper::Models::XGetArticleResponse::Author)) - end + # Author of a tweet with follower count and verification status. + sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } attr_reader :author - sig do - params( - author: XTwitterScraper::Models::XGetArticleResponse::Author::OrHash - ).void - end + sig { params(author: XTwitterScraper::X::TweetAuthor::OrHash).void } attr_writer :author sig do params( article: XTwitterScraper::Models::XGetArticleResponse::Article::OrHash, - author: XTwitterScraper::Models::XGetArticleResponse::Author::OrHash + author: XTwitterScraper::X::TweetAuthor::OrHash ).returns(T.attached_class) end - def self.new(article:, author: nil) + def self.new( + article:, + # Author of a tweet with follower count and verification status. + author: nil + ) end sig do override.returns( { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::Models::XGetArticleResponse::Author + author: XTwitterScraper::X::TweetAuthor } ) end @@ -260,66 +259,6 @@ module XTwitterScraper end end end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::XGetArticleResponse::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Integer) } - attr_accessor :followers - - sig { returns(String) } - attr_accessor :username - - sig { returns(T::Boolean) } - attr_accessor :verified - - sig { returns(T.nilable(String)) } - attr_reader :profile_picture - - sig { params(profile_picture: String).void } - attr_writer :profile_picture - - sig do - params( - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - ).returns(T.attached_class) - end - def self.new( - id:, - followers:, - username:, - verified:, - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - } - ) - end - def to_hash - end - end end end end diff --git a/rbi/x_twitter_scraper/models/x_get_home_timeline_params.rbi b/rbi/x_twitter_scraper/models/x_get_home_timeline_params.rbi index 6bb3665..fedf3af 100644 --- a/rbi/x_twitter_scraper/models/x_get_home_timeline_params.rbi +++ b/rbi/x_twitter_scraper/models/x_get_home_timeline_params.rbi @@ -14,7 +14,7 @@ module XTwitterScraper ) end - # Pagination cursor from previous response + # Pagination cursor for timeline sig { returns(T.nilable(String)) } attr_reader :cursor @@ -36,7 +36,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Pagination cursor from previous response + # Pagination cursor for timeline cursor: nil, # Comma-separated tweet IDs to exclude from results seen_tweet_ids: nil, diff --git a/rbi/x_twitter_scraper/models/x_get_home_timeline_response.rbi b/rbi/x_twitter_scraper/models/x_get_home_timeline_response.rbi deleted file mode 100644 index 8d95a4e..0000000 --- a/rbi/x_twitter_scraper/models/x_get_home_timeline_response.rbi +++ /dev/null @@ -1,227 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class XGetHomeTimelineResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::XGetHomeTimelineResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(String) } - attr_accessor :next_cursor - - sig do - returns( - T::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - ) - end - attr_accessor :tweets - - sig do - params( - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[ - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::OrHash - ] - ).returns(T.attached_class) - end - def self.new(has_next_page:, next_cursor:, tweets:) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - next_cursor: String, - tweets: - T::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - } - ) - end - def to_hash - end - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig do - returns( - T.nilable( - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author::OrHash - ).void - end - attr_writer :author - - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count - - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count - - sig { returns(T.nilable(String)) } - attr_reader :created_at - - sig { params(created_at: String).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :like_count - - sig { params(like_count: Integer).void } - attr_writer :like_count - - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count - - sig { params(quote_count: Integer).void } - attr_writer :quote_count - - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count - - sig { params(reply_count: Integer).void } - attr_writer :reply_count - - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count - - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count - - sig { returns(T.nilable(Integer)) } - attr_reader :view_count - - sig { params(view_count: Integer).void } - attr_writer :view_count - - sig do - params( - id: String, - text: String, - author: - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author::OrHash, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - author: nil, - bookmark_count: nil, - created_at: nil, - like_count: nil, - quote_count: nil, - reply_count: nil, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - author: - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - ) - end - def to_hash - end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :username - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :verified - - sig { params(verified: T::Boolean).void } - attr_writer :verified - - sig do - params( - id: String, - name: String, - username: String, - verified: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, name:, username:, verified: nil) - end - - sig do - override.returns( - { - id: String, - name: String, - username: String, - verified: T::Boolean - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi b/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi index 1fed8f5..bf41d84 100644 --- a/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi +++ b/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi @@ -14,7 +14,7 @@ module XTwitterScraper ) end - # Pagination cursor from previous response + # Pagination cursor for notifications sig { returns(T.nilable(String)) } attr_reader :cursor @@ -44,7 +44,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Pagination cursor from previous response + # Pagination cursor for notifications cursor: nil, # Notification type filter type: nil, diff --git a/rbi/x_twitter_scraper/models/x_get_trends_response.rbi b/rbi/x_twitter_scraper/models/x_get_trends_response.rbi new file mode 100644 index 0000000..a989b69 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x_get_trends_response.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module XTwitterScraper + module Models + class XGetTrendsResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::XGetTrendsResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :count + + sig do + returns(T::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend]) + end + attr_accessor :trends + + sig { returns(Integer) } + attr_accessor :woeid + + sig do + params( + count: Integer, + trends: + T::Array[ + XTwitterScraper::Models::XGetTrendsResponse::Trend::OrHash + ], + woeid: Integer + ).returns(T.attached_class) + end + def self.new(count:, trends:, woeid:) + end + + sig do + override.returns( + { + count: Integer, + trends: + T::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend], + woeid: Integer + } + ) + end + def to_hash + end + + class Trend < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::XGetTrendsResponse::Trend, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + sig { returns(T.nilable(Integer)) } + attr_reader :rank + + sig { params(rank: Integer).void } + attr_writer :rank + + sig do + params( + name: String, + description: String, + query: String, + rank: Integer + ).returns(T.attached_class) + end + def self.new(name:, description: nil, query: nil, rank: nil) + end + + sig do + override.returns( + { name: String, description: String, query: String, rank: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/resources/drafts.rbi b/rbi/x_twitter_scraper/resources/drafts.rbi index 5a7d922..0f13656 100644 --- a/rbi/x_twitter_scraper/resources/drafts.rbi +++ b/rbi/x_twitter_scraper/resources/drafts.rbi @@ -11,7 +11,7 @@ module XTwitterScraper goal: XTwitterScraper::DraftCreateParams::Goal::OrSymbol, topic: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::DraftCreateResponse) + ).returns(XTwitterScraper::DraftDetail) end def create(text:, goal: nil, topic: nil, request_options: {}) end @@ -21,7 +21,7 @@ module XTwitterScraper params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::DraftRetrieveResponse) + ).returns(XTwitterScraper::DraftDetail) end def retrieve( # Resource ID (stringified bigint) @@ -41,6 +41,7 @@ module XTwitterScraper def list( # Cursor for pagination after_cursor: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/draws.rbi b/rbi/x_twitter_scraper/resources/draws.rbi index 1a9e4f0..419c84a 100644 --- a/rbi/x_twitter_scraper/resources/draws.rbi +++ b/rbi/x_twitter_scraper/resources/draws.rbi @@ -27,8 +27,9 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::DrawListResponse) end def list( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, request_options: {} ) @@ -46,6 +47,7 @@ module XTwitterScraper def export( # Resource ID (stringified bigint) id, + # Export output format format_: nil, # Export winners or all entries type: nil, diff --git a/rbi/x_twitter_scraper/resources/events.rbi b/rbi/x_twitter_scraper/resources/events.rbi index b4f3258..559e4fa 100644 --- a/rbi/x_twitter_scraper/resources/events.rbi +++ b/rbi/x_twitter_scraper/resources/events.rbi @@ -9,7 +9,7 @@ module XTwitterScraper params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::EventRetrieveResponse) + ).returns(XTwitterScraper::EventDetail) end def retrieve( # Resource ID (stringified bigint) @@ -22,17 +22,20 @@ module XTwitterScraper sig do params( after: String, - event_type: XTwitterScraper::EventListParams::EventType::OrSymbol, + event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::EventListResponse) end def list( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Filter events by type event_type: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, + # Filter events by monitor ID monitor_id: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/extractions.rbi b/rbi/x_twitter_scraper/resources/extractions.rbi index 8d6b85c..0ce3584 100644 --- a/rbi/x_twitter_scraper/resources/extractions.rbi +++ b/rbi/x_twitter_scraper/resources/extractions.rbi @@ -16,8 +16,9 @@ module XTwitterScraper def retrieve( # Extraction public ID (UUID) id, - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of results to return (1-1000, default 100) limit: nil, request_options: {} ) @@ -34,10 +35,13 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::ExtractionListResponse) end def list( - # Cursor for pagination + # Cursor for keyset pagination after: nil, + # Maximum number of items to return (1-100, default 50) limit: nil, + # Filter by job status status: nil, + # Filter by extraction tool type tool_type: nil, request_options: {} ) @@ -61,12 +65,13 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::ExtractionEstimateCostResponse) end def estimate_cost( + # Identifier for the extraction tool used to run a job. tool_type:, - # Raw advanced search query appended as-is (tweet_search_extractor) + # Raw advanced query string appended to the estimate (tweet_search_extractor) advanced_query: nil, - # Exact phrase to match (tweet_search_extractor) + # Exact phrase filter for search estimation exact_phrase: nil, - # Words to exclude from results (tweet_search_extractor) + # Words excluded from estimated search results exclude_words: nil, search_query: nil, target_community_id: nil, @@ -90,6 +95,7 @@ module XTwitterScraper def export_results( # Extraction public ID id, + # Export file format format_: nil, request_options: {} ) @@ -112,6 +118,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::ExtractionRunResponse) end def run( + # Identifier for the extraction tool used to run a job. tool_type:, # Raw advanced search query appended as-is (tweet_search_extractor) advanced_query: nil, diff --git a/rbi/x_twitter_scraper/resources/integrations.rbi b/rbi/x_twitter_scraper/resources/integrations.rbi index d655b4c..af12a30 100644 --- a/rbi/x_twitter_scraper/resources/integrations.rbi +++ b/rbi/x_twitter_scraper/resources/integrations.rbi @@ -8,21 +8,19 @@ module XTwitterScraper sig do params( config: XTwitterScraper::IntegrationCreateParams::Config::OrHash, - event_types: - T::Array[ - XTwitterScraper::IntegrationCreateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], name: String, - type: XTwitterScraper::IntegrationCreateParams::Type::OrSymbol, + type: Symbol, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationCreateResponse) + ).returns(XTwitterScraper::Integration) end def create( # Integration config (e.g. Telegram chatId) config:, + # Array of event types to subscribe to. event_types:, name:, - type:, + type: :telegram, request_options: {} ) end @@ -32,7 +30,7 @@ module XTwitterScraper params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationRetrieveResponse) + ).returns(XTwitterScraper::Integration) end def retrieve( # Resource ID (stringified bigint) @@ -45,10 +43,7 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[ - XTwitterScraper::IntegrationUpdateParams::EventType::OrSymbol - ], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], filters: T::Hash[Symbol, T.anything], is_active: T::Boolean, message_template: T::Hash[Symbol, T.anything], @@ -56,11 +51,12 @@ module XTwitterScraper scope_all_monitors: T::Boolean, silent_push: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationUpdateResponse) + ).returns(XTwitterScraper::Integration) end def update( # Resource ID (stringified bigint) id, + # Array of event types to subscribe to. event_types: nil, # Event filter rules (JSON) filters: nil, @@ -108,6 +104,7 @@ module XTwitterScraper def list_deliveries( # Resource ID (stringified bigint) id, + # Maximum number of items to return (1-100, default 50) limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/monitors.rbi b/rbi/x_twitter_scraper/resources/monitors.rbi index c83ac7b..2351361 100644 --- a/rbi/x_twitter_scraper/resources/monitors.rbi +++ b/rbi/x_twitter_scraper/resources/monitors.rbi @@ -7,13 +7,13 @@ module XTwitterScraper # Create monitor sig do params( - event_types: - T::Array[XTwitterScraper::MonitorCreateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], username: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::MonitorCreateResponse) end def create( + # Array of event types to subscribe to. event_types:, # X username (without @) username:, @@ -26,7 +26,7 @@ module XTwitterScraper params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::MonitorRetrieveResponse) + ).returns(XTwitterScraper::Monitor) end def retrieve( # Resource ID (stringified bigint) @@ -39,15 +39,15 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[XTwitterScraper::MonitorUpdateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::MonitorUpdateResponse) + ).returns(XTwitterScraper::Monitor) end def update( # Resource ID (stringified bigint) id, + # Array of event types to subscribe to. event_types: nil, is_active: nil, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/radar.rbi b/rbi/x_twitter_scraper/resources/radar.rbi index 6f890a3..3177d63 100644 --- a/rbi/x_twitter_scraper/resources/radar.rbi +++ b/rbi/x_twitter_scraper/resources/radar.rbi @@ -11,7 +11,8 @@ module XTwitterScraper count: Integer, hours: Integer, region: String, - source: String, + source: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse) end diff --git a/rbi/x_twitter_scraper/resources/styles.rbi b/rbi/x_twitter_scraper/resources/styles.rbi index 50d3a99..8767545 100644 --- a/rbi/x_twitter_scraper/resources/styles.rbi +++ b/rbi/x_twitter_scraper/resources/styles.rbi @@ -7,13 +7,13 @@ module XTwitterScraper # Get cached style profile sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::StyleRetrieveResponse) + ).returns(XTwitterScraper::StyleProfile) end def retrieve( - # X username of cached style - username, + # Style profile ID or X username + id, request_options: {} ) end @@ -21,15 +21,15 @@ module XTwitterScraper # Save style profile with custom tweets sig do params( - username: String, + id: String, label: String, tweets: T::Array[XTwitterScraper::StyleUpdateParams::Tweet::OrHash], request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::StyleUpdateResponse) + ).returns(XTwitterScraper::StyleProfile) end def update( - # X username of cached style - username, + # Style profile ID or X username + id, # Display label for the style label:, # Array of tweet objects @@ -50,13 +50,13 @@ module XTwitterScraper # Delete a style profile sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).void end def delete( - # X username of cached style - username, + # Style profile ID or X username + id, request_options: {} ) end @@ -66,7 +66,7 @@ module XTwitterScraper params( username: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::StyleAnalyzeResponse) + ).returns(XTwitterScraper::StyleProfile) end def analyze( # X username to analyze @@ -95,13 +95,13 @@ module XTwitterScraper # Get engagement metrics for style tweets sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::StyleGetPerformanceResponse) end def get_performance( - # X username of cached style - username, + # Style profile ID or X username + id, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/support/tickets.rbi b/rbi/x_twitter_scraper/resources/support/tickets.rbi index 267f936..619afea 100644 --- a/rbi/x_twitter_scraper/resources/support/tickets.rbi +++ b/rbi/x_twitter_scraper/resources/support/tickets.rbi @@ -23,7 +23,11 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::Support::TicketRetrieveResponse) end - def retrieve(id, request_options: {}) + def retrieve( + # Support ticket ID + id, + request_options: {} + ) end # Update ticket status @@ -35,7 +39,12 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::Support::TicketUpdateResponse) end - def update(id, status:, request_options: {}) + def update( + # Support ticket ID to update + id, + status:, + request_options: {} + ) end # List user's support tickets @@ -55,7 +64,12 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::Support::TicketReplyResponse) end - def reply(id, body:, request_options: {}) + def reply( + # Support ticket ID for the reply + id, + body:, + request_options: {} + ) end # @api private diff --git a/rbi/x_twitter_scraper/resources/trends.rbi b/rbi/x_twitter_scraper/resources/trends.rbi index 9e73673..2c5f1b2 100644 --- a/rbi/x_twitter_scraper/resources/trends.rbi +++ b/rbi/x_twitter_scraper/resources/trends.rbi @@ -4,7 +4,7 @@ module XTwitterScraper module Resources # Trending topics by region class Trends - # Get trending topics + # Get regional trending topics sig do params( count: Integer, @@ -13,6 +13,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::TrendListResponse) end def list( + # Number of trending topics to return (1-50, default 30) count: nil, # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) woeid: nil, diff --git a/rbi/x_twitter_scraper/resources/webhooks.rbi b/rbi/x_twitter_scraper/resources/webhooks.rbi index 24ccb7a..b3ef6e0 100644 --- a/rbi/x_twitter_scraper/resources/webhooks.rbi +++ b/rbi/x_twitter_scraper/resources/webhooks.rbi @@ -7,13 +7,13 @@ module XTwitterScraper # Create webhook sig do params( - event_types: - T::Array[XTwitterScraper::WebhookCreateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::WebhookCreateResponse) end def create( + # Array of event types to subscribe to. event_types:, # HTTPS URL url:, @@ -25,16 +25,16 @@ module XTwitterScraper sig do params( id: String, - event_types: - T::Array[XTwitterScraper::WebhookUpdateParams::EventType::OrSymbol], + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, url: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::WebhookUpdateResponse) + ).returns(XTwitterScraper::Webhook) end def update( # Resource ID (stringified bigint) id, + # Array of event types to subscribe to. event_types: nil, is_active: nil, url: nil, diff --git a/rbi/x_twitter_scraper/resources/x.rbi b/rbi/x_twitter_scraper/resources/x.rbi index 175dbbd..f1421af 100644 --- a/rbi/x_twitter_scraper/resources/x.rbi +++ b/rbi/x_twitter_scraper/resources/x.rbi @@ -48,7 +48,11 @@ module XTwitterScraper request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::XGetArticleResponse) end - def get_article(tweet_id, request_options: {}) + def get_article( + # Tweet ID of the article + tweet_id, + request_options: {} + ) end # Get home timeline @@ -57,10 +61,10 @@ module XTwitterScraper cursor: String, seen_tweet_ids: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::XGetHomeTimelineResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def get_home_timeline( - # Pagination cursor from previous response + # Pagination cursor for timeline cursor: nil, # Comma-separated tweet IDs to exclude from results seen_tweet_ids: nil, @@ -77,7 +81,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::XGetNotificationsResponse) end def get_notifications( - # Pagination cursor from previous response + # Pagination cursor for notifications cursor: nil, # Notification type filter type: nil, @@ -87,7 +91,9 @@ module XTwitterScraper # Get trending topics sig do - params(request_options: XTwitterScraper::RequestOptions::OrHash).void + params( + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::XGetTrendsResponse) end def get_trends(request_options: {}) end diff --git a/rbi/x_twitter_scraper/resources/x/accounts.rbi b/rbi/x_twitter_scraper/resources/x/accounts.rbi index a03c415..188ff21 100644 --- a/rbi/x_twitter_scraper/resources/x/accounts.rbi +++ b/rbi/x_twitter_scraper/resources/x/accounts.rbi @@ -36,7 +36,7 @@ module XTwitterScraper params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::AccountRetrieveResponse) + ).returns(XTwitterScraper::X::XAccountDetail) end def retrieve( # Resource ID (stringified bigint) @@ -68,6 +68,16 @@ module XTwitterScraper ) end + # Clears loginFailedAt and loginFailureReason for all accounts with transient or + # automated failure reasons, making them eligible for retry on next use. + sig do + params( + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::X::AccountBulkRetryResponse) + end + def bulk_retry(request_options: {}) + end + # Re-authenticate X account sig do params( @@ -80,9 +90,9 @@ module XTwitterScraper def reauth( # Resource ID (stringified bigint) id, - # Account password + # Updated account password password:, - # TOTP secret for 2FA + # TOTP secret for 2FA re-authentication totp_secret: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/bookmarks.rbi b/rbi/x_twitter_scraper/resources/x/bookmarks.rbi index 24393bf..3146b8e 100644 --- a/rbi/x_twitter_scraper/resources/x/bookmarks.rbi +++ b/rbi/x_twitter_scraper/resources/x/bookmarks.rbi @@ -11,10 +11,10 @@ module XTwitterScraper cursor: String, folder_id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::BookmarkListResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def list( - # Pagination cursor from previous response + # Pagination cursor for bookmarks cursor: nil, # Optional bookmark folder ID folder_id: nil, diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index 3e178c6..964279f 100644 --- a/rbi/x_twitter_scraper/resources/x/communities.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities.rbi @@ -22,7 +22,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::CommunityCreateResponse) end def create( - # X account (@username or account ID) + # X account (@username or ID) creating the community account:, # Community name name:, @@ -44,7 +44,7 @@ module XTwitterScraper def delete( # Resource ID (stringified bigint) id, - # X account (@username or account ID) + # X account (@username or ID) deleting the community account:, # Community name for confirmation community_name:, @@ -72,10 +72,10 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_members( - # Community ID + # Community ID for member lookup id, # Pagination cursor cursor: nil, @@ -89,12 +89,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_moderators( - # Community ID + # Community ID for moderator lookup id, - # Pagination cursor + # Pagination cursor for community moderators cursor: nil, request_options: {} ) @@ -107,12 +107,12 @@ module XTwitterScraper cursor: String, query_type: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_search( # Search query q:, - # Pagination cursor + # Pagination cursor for community search cursor: nil, # Sort order (Latest or Top) query_type: nil, diff --git a/rbi/x_twitter_scraper/resources/x/communities/join.rbi b/rbi/x_twitter_scraper/resources/x/communities/join.rbi index 10a28cf..b0a4137 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/join.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/join.rbi @@ -12,14 +12,12 @@ module XTwitterScraper id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns( - XTwitterScraper::Models::X::Communities::JoinCreateResponse - ) + ).returns(XTwitterScraper::X::CommunityActionResult) end def create( # Resource ID (stringified bigint) id, - # X account (@username or account ID) + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -31,14 +29,12 @@ module XTwitterScraper id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns( - XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse - ) + ).returns(XTwitterScraper::X::CommunityActionResult) end def delete_all( # Resource ID (stringified bigint) id, - # X account (@username or account ID) + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi index 394b9d7..6aa94f9 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi @@ -13,19 +13,36 @@ module XTwitterScraper cursor: String, query_type: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedTweets) end def list( - # Search query + # Search query for cross-community tweets q:, - # Pagination cursor + # Pagination cursor for cross-community results cursor: nil, - # Sort order (Latest or Top) + # Sort order for cross-community results (Latest or Top) query_type: nil, request_options: {} ) end + # Get community tweets + sig do + params( + id: String, + cursor: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::PaginatedTweets) + end + def list_by_community( + # Community ID for tweet lookup + id, + # Pagination cursor for community tweets + cursor: nil, + request_options: {} + ) + end + # @api private sig do params(client: XTwitterScraper::Client).returns(T.attached_class) diff --git a/rbi/x_twitter_scraper/resources/x/dm.rbi b/rbi/x_twitter_scraper/resources/x/dm.rbi index b716d8d..7a5b6b7 100644 --- a/rbi/x_twitter_scraper/resources/x/dm.rbi +++ b/rbi/x_twitter_scraper/resources/x/dm.rbi @@ -16,7 +16,7 @@ module XTwitterScraper def retrieve_history( # Target user ID user_id, - # Pagination cursor from previous response + # Pagination cursor for DM history cursor: nil, # Legacy pagination cursor (backward compat) max_id: nil, @@ -38,7 +38,7 @@ module XTwitterScraper def send_( # Recipient user ID user_id, - # X account (@username or account ID) + # X account (@username or ID) sending the DM account:, text:, media_ids: nil, diff --git a/rbi/x_twitter_scraper/resources/x/lists.rbi b/rbi/x_twitter_scraper/resources/x/lists.rbi index 80852b3..1d75770 100644 --- a/rbi/x_twitter_scraper/resources/x/lists.rbi +++ b/rbi/x_twitter_scraper/resources/x/lists.rbi @@ -11,12 +11,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_followers( # List ID id, - # Pagination cursor + # Pagination cursor for list followers cursor: nil, request_options: {} ) @@ -28,12 +28,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_members( - # List ID + # List ID for member lookup id, - # Pagination cursor + # Pagination cursor for list members cursor: nil, request_options: {} ) @@ -48,12 +48,12 @@ module XTwitterScraper since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_tweets( - # List ID + # List ID for tweet lookup id, - # Pagination cursor + # Pagination cursor for list tweets cursor: nil, # Include replies (default false) include_replies: nil, diff --git a/rbi/x_twitter_scraper/resources/x/media.rbi b/rbi/x_twitter_scraper/resources/x/media.rbi index 3df10f1..1b9faeb 100644 --- a/rbi/x_twitter_scraper/resources/x/media.rbi +++ b/rbi/x_twitter_scraper/resources/x/media.rbi @@ -32,7 +32,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::MediaUploadResponse) end def upload( - # X account (@username or account ID) + # X account (@username or ID) uploading media account:, # Media file to upload file:, diff --git a/rbi/x_twitter_scraper/resources/x/profile.rbi b/rbi/x_twitter_scraper/resources/x/profile.rbi index a69eec6..35c688f 100644 --- a/rbi/x_twitter_scraper/resources/x/profile.rbi +++ b/rbi/x_twitter_scraper/resources/x/profile.rbi @@ -17,7 +17,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::ProfileUpdateResponse) end def update( - # X account (@username or account ID) + # X account (@username or ID) to update profile account:, # Bio description description: nil, @@ -39,7 +39,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::ProfileUpdateAvatarResponse) end def update_avatar( - # X account (@username or account ID) + # X account (@username or ID) for avatar update account:, # Avatar image (max 716KB) file:, @@ -56,7 +56,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::ProfileUpdateBannerResponse) end def update_banner( - # X account (@username or account ID) + # X account (@username or ID) for banner update account:, # Banner image (max 2MB) file:, diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index 0113bf4..916265c 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -41,11 +41,15 @@ module XTwitterScraper # Look up tweet sig do params( - tweet_id: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::TweetRetrieveResponse) end - def retrieve(tweet_id, request_options: {}) + def retrieve( + # Tweet ID + id, + request_options: {} + ) end # Get multiple tweets by IDs @@ -53,7 +57,7 @@ module XTwitterScraper params( ids: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedTweets) end def list( # Comma-separated tweet IDs (max 100) @@ -65,14 +69,15 @@ module XTwitterScraper # Delete tweet sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::TweetDeleteResponse) end def delete( - tweet_id, - # X account (@username or account ID) + # Tweet ID to delete + id, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -84,12 +89,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetGetFavoritersResponse) + ).returns(XTwitterScraper::PaginatedUsers) end def get_favoriters( - # Tweet ID + # Tweet ID to get favoriters id, - # Pagination cursor from previous response + # Pagination cursor for favoriters cursor: nil, request_options: {} ) @@ -104,18 +109,18 @@ module XTwitterScraper since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetGetQuotesResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def get_quotes( - # Tweet ID + # Tweet ID to get quotes id, - # Pagination cursor + # Pagination cursor for quote tweets cursor: nil, - # Include replies (default false) + # Include reply quotes (default false) include_replies: nil, - # Unix timestamp - filter after + # Unix timestamp - return quotes posted after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return quotes posted before this time until_time: nil, request_options: {} ) @@ -129,16 +134,16 @@ module XTwitterScraper since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetGetRepliesResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def get_replies( - # Tweet ID + # Tweet ID to get replies id, - # Pagination cursor + # Pagination cursor for tweet replies cursor: nil, - # Unix timestamp - filter after + # Unix timestamp - return replies posted after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return replies posted before this time until_time: nil, request_options: {} ) @@ -150,12 +155,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetGetRetweetersResponse) + ).returns(XTwitterScraper::PaginatedUsers) end def get_retweeters( - # Tweet ID + # Tweet ID to get retweeters id, - # Pagination cursor + # Pagination cursor for retweeters cursor: nil, request_options: {} ) @@ -167,12 +172,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetGetThreadResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def get_thread( - # Tweet ID + # Tweet ID to get thread context id, - # Pagination cursor + # Pagination cursor for thread tweets cursor: nil, request_options: {} ) @@ -189,14 +194,14 @@ module XTwitterScraper since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::TweetSearchResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def search( # Search query (keywords, q:, # Pagination cursor from previous response cursor: nil, - # Deprecated — use cursor-based pagination instead + # Max tweets to return (server paginates internally). Omit for single page (~20). limit: nil, # Sort order — Latest (chronological) or Top (engagement-ranked) query_type: nil, diff --git a/rbi/x_twitter_scraper/resources/x/tweets/like.rbi b/rbi/x_twitter_scraper/resources/x/tweets/like.rbi index 0df8f46..3f59156 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets/like.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets/like.rbi @@ -9,14 +9,15 @@ module XTwitterScraper # Like tweet sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::LikeCreateResponse) end def create( - tweet_id, - # X account (@username or account ID) + # Tweet ID to like + id, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -25,14 +26,15 @@ module XTwitterScraper # Unlike tweet sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::LikeDeleteResponse) end def delete( - tweet_id, - # X account (@username or account ID) + # Tweet ID to unlike + id, + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi b/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi index 1ae7005..a828256 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi @@ -9,14 +9,15 @@ module XTwitterScraper # Retweet sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::RetweetCreateResponse) end def create( - tweet_id, - # X account (@username or account ID) + # Tweet ID to retweet + id, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -25,14 +26,15 @@ module XTwitterScraper # Unretweet sig do params( - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse) end def delete( - tweet_id, - # X account (@username or account ID) + # Tweet ID to unretweet + id, + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index 90e1a2e..b87ad0b 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -12,13 +12,13 @@ module XTwitterScraper # Look up X user sig do params( - username: String, + id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::UserRetrieveResponse) + ).returns(XTwitterScraper::X::UserProfile) end def retrieve( - # X username (without @) - username, + # X username (without @) or user ID + id, request_options: {} ) end @@ -28,7 +28,7 @@ module XTwitterScraper params( ids: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_batch( # Comma-separated user IDs (max 100) @@ -44,12 +44,12 @@ module XTwitterScraper cursor: String, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_followers( # User ID or username id, - # Pagination cursor + # Pagination cursor for followers list cursor: nil, # Items per page (20-200, default 200) page_size: nil, @@ -63,14 +63,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns( - XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse - ) + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_followers_you_know( - # User ID + # User ID for followers-you-know lookup id, - # Pagination cursor from previous response + # Pagination cursor for followers-you-know cursor: nil, request_options: {} ) @@ -83,14 +81,14 @@ module XTwitterScraper cursor: String, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_following( - # User ID or username + # User ID or username for following lookup id, - # Pagination cursor + # Pagination cursor for following list cursor: nil, - # Items per page (20-200, default 200) + # Results per page (20-200, default 200) page_size: nil, request_options: {} ) @@ -102,12 +100,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::UserRetrieveLikesResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_likes( # User ID id, - # Pagination cursor from previous response + # Pagination cursor for liked tweets cursor: nil, request_options: {} ) @@ -119,12 +117,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::UserRetrieveMediaResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_media( - # User ID + # User ID for media lookup id, - # Pagination cursor from previous response + # Pagination cursor for media tweets cursor: nil, request_options: {} ) @@ -138,16 +136,16 @@ module XTwitterScraper since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_mentions( - # User ID or username + # User ID or username for mentions lookup id, - # Pagination cursor + # Pagination cursor for mentions cursor: nil, - # Unix timestamp - filter after + # Unix timestamp - return mentions after this time since_time: nil, - # Unix timestamp - filter before + # Unix timestamp - return mentions before this time until_time: nil, request_options: {} ) @@ -159,12 +157,12 @@ module XTwitterScraper q: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_search( - # Search query + # User search query q:, - # Pagination cursor + # Pagination cursor for user search cursor: nil, request_options: {} ) @@ -178,11 +176,12 @@ module XTwitterScraper include_parent_tweet: T::Boolean, include_replies: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::X::UserRetrieveTweetsResponse) + ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_tweets( + # X user ID or username id, - # Pagination cursor from previous response + # Pagination cursor for user tweets cursor: nil, # Include parent tweet for replies include_parent_tweet: nil, @@ -198,12 +197,12 @@ module XTwitterScraper id: String, cursor: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).void + ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_verified_followers( - # User ID or username + # User ID or username for verified followers id, - # Pagination cursor + # Pagination cursor for verified followers cursor: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/users/follow.rbi b/rbi/x_twitter_scraper/resources/x/users/follow.rbi index 837b9bb..35626ff 100644 --- a/rbi/x_twitter_scraper/resources/x/users/follow.rbi +++ b/rbi/x_twitter_scraper/resources/x/users/follow.rbi @@ -9,15 +9,15 @@ module XTwitterScraper # Follow user sig do params( - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Users::FollowCreateResponse) end def create( # User ID to follow - user_id, - # X account (@username or account ID) + id, + # X account identifier (@username or account ID) account:, request_options: {} ) @@ -26,7 +26,7 @@ module XTwitterScraper # Unfollow user sig do params( - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns( @@ -35,8 +35,8 @@ module XTwitterScraper end def delete_all( # User ID to unfollow - user_id, - # X account (@username or account ID) + id, + # X account identifier (@username or account ID) account:, request_options: {} ) diff --git a/sig/x_twitter_scraper/models/api_key_list_response.rbs b/sig/x_twitter_scraper/models/api_key_list_response.rbs index 96ac9be..106f4ec 100644 --- a/sig/x_twitter_scraper/models/api_key_list_response.rbs +++ b/sig/x_twitter_scraper/models/api_key_list_response.rbs @@ -1,62 +1,13 @@ module XTwitterScraper module Models - type api_key_list_response = - { keys: ::Array[XTwitterScraper::Models::APIKeyListResponse::Key] } + type api_key_list_response = { keys: ::Array[XTwitterScraper::APIKey] } class APIKeyListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor keys: ::Array[XTwitterScraper::Models::APIKeyListResponse::Key] + attr_accessor keys: ::Array[XTwitterScraper::APIKey] - def initialize: ( - keys: ::Array[XTwitterScraper::Models::APIKeyListResponse::Key] - ) -> void + def initialize: (keys: ::Array[XTwitterScraper::APIKey]) -> void - def to_hash: -> { - keys: ::Array[XTwitterScraper::Models::APIKeyListResponse::Key] - } - - type key = - { - id: String, - created_at: Time, - is_active: bool, - name: String, - prefix: String, - last_used_at: Time - } - - class Key < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor prefix: String - - attr_reader last_used_at: Time? - - def last_used_at=: (Time) -> Time - - def initialize: ( - id: String, - created_at: Time, - is_active: bool, - name: String, - prefix: String, - ?last_used_at: Time - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - is_active: bool, - name: String, - prefix: String, - last_used_at: Time - } - end + def to_hash: -> { keys: ::Array[XTwitterScraper::APIKey] } end end end diff --git a/sig/x_twitter_scraper/models/draft_create_response.rbs b/sig/x_twitter_scraper/models/draft_create_response.rbs deleted file mode 100644 index 98ad6b5..0000000 --- a/sig/x_twitter_scraper/models/draft_create_response.rbs +++ /dev/null @@ -1,49 +0,0 @@ -module XTwitterScraper - module Models - type draft_create_response = - { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - - class DraftCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor text: String - - attr_accessor updated_at: Time - - attr_reader goal: String? - - def goal=: (String) -> String - - attr_reader topic: String? - - def topic=: (String) -> String - - def initialize: ( - id: String, - created_at: Time, - text: String, - updated_at: Time, - ?goal: String, - ?topic: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - end - end -end diff --git a/sig/x_twitter_scraper/models/draft_list_response.rbs b/sig/x_twitter_scraper/models/draft_list_response.rbs index 8d6e43b..1a91595 100644 --- a/sig/x_twitter_scraper/models/draft_list_response.rbs +++ b/sig/x_twitter_scraper/models/draft_list_response.rbs @@ -2,13 +2,13 @@ module XTwitterScraper module Models type draft_list_response = { - drafts: ::Array[XTwitterScraper::Models::DraftListResponse::Draft], + drafts: ::Array[XTwitterScraper::Draft], has_more: bool, next_cursor: String } class DraftListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor drafts: ::Array[XTwitterScraper::Models::DraftListResponse::Draft] + attr_accessor drafts: ::Array[XTwitterScraper::Draft] attr_accessor has_more: bool @@ -17,57 +17,16 @@ module XTwitterScraper def next_cursor=: (String) -> String def initialize: ( - drafts: ::Array[XTwitterScraper::Models::DraftListResponse::Draft], + drafts: ::Array[XTwitterScraper::Draft], has_more: bool, ?next_cursor: String ) -> void def to_hash: -> { - drafts: ::Array[XTwitterScraper::Models::DraftListResponse::Draft], + drafts: ::Array[XTwitterScraper::Draft], has_more: bool, next_cursor: String } - - type draft = - { - id: String, - created_at: Time, - text: String, - goal: String, - topic: String - } - - class Draft < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor text: String - - attr_reader goal: String? - - def goal=: (String) -> String - - attr_reader topic: String? - - def topic=: (String) -> String - - def initialize: ( - id: String, - created_at: Time, - text: String, - ?goal: String, - ?topic: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - text: String, - goal: String, - topic: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/draft_retrieve_response.rbs b/sig/x_twitter_scraper/models/draft_retrieve_response.rbs deleted file mode 100644 index c181aa7..0000000 --- a/sig/x_twitter_scraper/models/draft_retrieve_response.rbs +++ /dev/null @@ -1,49 +0,0 @@ -module XTwitterScraper - module Models - type draft_retrieve_response = - { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - - class DraftRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor text: String - - attr_accessor updated_at: Time - - attr_reader goal: String? - - def goal=: (String) -> String - - attr_reader topic: String? - - def topic=: (String) -> String - - def initialize: ( - id: String, - created_at: Time, - text: String, - updated_at: Time, - ?goal: String, - ?topic: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - text: String, - updated_at: Time, - goal: String, - topic: String - } - end - end -end diff --git a/sig/x_twitter_scraper/models/draw_list_response.rbs b/sig/x_twitter_scraper/models/draw_list_response.rbs index 9a05123..61dc58e 100644 --- a/sig/x_twitter_scraper/models/draw_list_response.rbs +++ b/sig/x_twitter_scraper/models/draw_list_response.rbs @@ -2,13 +2,13 @@ module XTwitterScraper module Models type draw_list_response = { - draws: ::Array[XTwitterScraper::Models::DrawListResponse::Draw], + draws: ::Array[XTwitterScraper::DrawListItem], has_more: bool, next_cursor: String } class DrawListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor draws: ::Array[XTwitterScraper::Models::DrawListResponse::Draw] + attr_accessor draws: ::Array[XTwitterScraper::DrawListItem] attr_accessor has_more: bool @@ -17,65 +17,16 @@ module XTwitterScraper def next_cursor=: (String) -> String def initialize: ( - draws: ::Array[XTwitterScraper::Models::DrawListResponse::Draw], + draws: ::Array[XTwitterScraper::DrawListItem], has_more: bool, ?next_cursor: String ) -> void def to_hash: -> { - draws: ::Array[XTwitterScraper::Models::DrawListResponse::Draw], + draws: ::Array[XTwitterScraper::DrawListItem], has_more: bool, next_cursor: String } - - type draw = - { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - - class Draw < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor status: String - - attr_accessor total_entries: Integer - - attr_accessor tweet_url: String - - attr_accessor valid_entries: Integer - - attr_reader drawn_at: Time? - - def drawn_at=: (Time) -> Time - - def initialize: ( - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_url: String, - valid_entries: Integer, - ?drawn_at: Time - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - end end end end diff --git a/sig/x_twitter_scraper/models/draw_retrieve_response.rbs b/sig/x_twitter_scraper/models/draw_retrieve_response.rbs index 96cf540..9c61f8c 100644 --- a/sig/x_twitter_scraper/models/draw_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/draw_retrieve_response.rbs @@ -2,140 +2,24 @@ module XTwitterScraper module Models type draw_retrieve_response = { - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw, - winners: ::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner] + draw: XTwitterScraper::DrawDetail, + winners: ::Array[XTwitterScraper::Winner] } class DrawRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw + attr_accessor draw: XTwitterScraper::DrawDetail - attr_accessor winners: ::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner] + attr_accessor winners: ::Array[XTwitterScraper::Winner] def initialize: ( - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw, - winners: ::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner] + draw: XTwitterScraper::DrawDetail, + winners: ::Array[XTwitterScraper::Winner] ) -> void def to_hash: -> { - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw, - winners: ::Array[XTwitterScraper::Models::DrawRetrieveResponse::Winner] + draw: XTwitterScraper::DrawDetail, + winners: ::Array[XTwitterScraper::Winner] } - - type draw = - { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_author_username: String, - tweet_id: String, - tweet_like_count: Integer, - tweet_quote_count: Integer, - tweet_reply_count: Integer, - tweet_retweet_count: Integer, - tweet_text: String, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - - class Draw < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor status: String - - attr_accessor total_entries: Integer - - attr_accessor tweet_author_username: String - - attr_accessor tweet_id: String - - attr_accessor tweet_like_count: Integer - - attr_accessor tweet_quote_count: Integer - - attr_accessor tweet_reply_count: Integer - - attr_accessor tweet_retweet_count: Integer - - attr_accessor tweet_text: String - - attr_accessor tweet_url: String - - attr_accessor valid_entries: Integer - - attr_reader drawn_at: Time? - - def drawn_at=: (Time) -> Time - - def initialize: ( - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_author_username: String, - tweet_id: String, - tweet_like_count: Integer, - tweet_quote_count: Integer, - tweet_reply_count: Integer, - tweet_retweet_count: Integer, - tweet_text: String, - tweet_url: String, - valid_entries: Integer, - ?drawn_at: Time - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - status: String, - total_entries: Integer, - tweet_author_username: String, - tweet_id: String, - tweet_like_count: Integer, - tweet_quote_count: Integer, - tweet_reply_count: Integer, - tweet_retweet_count: Integer, - tweet_text: String, - tweet_url: String, - valid_entries: Integer, - drawn_at: Time - } - end - - type winner = - { - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - } - - class Winner < XTwitterScraper::Internal::Type::BaseModel - attr_accessor author_username: String - - attr_accessor is_backup: bool - - attr_accessor position: Integer - - attr_accessor tweet_id: String - - def initialize: ( - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - ) -> void - - def to_hash: -> { - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/draw_run_response.rbs b/sig/x_twitter_scraper/models/draw_run_response.rbs index 4637404..a3d20a9 100644 --- a/sig/x_twitter_scraper/models/draw_run_response.rbs +++ b/sig/x_twitter_scraper/models/draw_run_response.rbs @@ -6,7 +6,7 @@ module XTwitterScraper total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: ::Array[XTwitterScraper::Models::DrawRunResponse::Winner] + winners: ::Array[XTwitterScraper::Winner] } class DrawRunResponse < XTwitterScraper::Internal::Type::BaseModel @@ -18,14 +18,14 @@ module XTwitterScraper attr_accessor valid_entries: Integer - attr_accessor winners: ::Array[XTwitterScraper::Models::DrawRunResponse::Winner] + attr_accessor winners: ::Array[XTwitterScraper::Winner] def initialize: ( id: String, total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: ::Array[XTwitterScraper::Models::DrawRunResponse::Winner] + winners: ::Array[XTwitterScraper::Winner] ) -> void def to_hash: -> { @@ -33,40 +33,8 @@ module XTwitterScraper total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: ::Array[XTwitterScraper::Models::DrawRunResponse::Winner] + winners: ::Array[XTwitterScraper::Winner] } - - type winner = - { - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - } - - class Winner < XTwitterScraper::Internal::Type::BaseModel - attr_accessor author_username: String - - attr_accessor is_backup: bool - - attr_accessor position: Integer - - attr_accessor tweet_id: String - - def initialize: ( - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - ) -> void - - def to_hash: -> { - author_username: String, - is_backup: bool, - position: Integer, - tweet_id: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/event.rbs b/sig/x_twitter_scraper/models/event.rbs index b3f4b79..846a758 100644 --- a/sig/x_twitter_scraper/models/event.rbs +++ b/sig/x_twitter_scraper/models/event.rbs @@ -6,7 +6,7 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::Event::type_, + type: XTwitterScraper::Models::event_type, username: String } @@ -19,7 +19,7 @@ module XTwitterScraper attr_accessor occurred_at: Time - attr_accessor type: XTwitterScraper::Models::Event::type_ + attr_accessor type: XTwitterScraper::Models::event_type attr_accessor username: String @@ -28,7 +28,7 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::Event::type_, + type: XTwitterScraper::Models::event_type, username: String ) -> void @@ -37,30 +37,9 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::Event::type_, + type: XTwitterScraper::Models::event_type, username: String } - - type type_ = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::Event::type_] - end end end end diff --git a/sig/x_twitter_scraper/models/event_detail.rbs b/sig/x_twitter_scraper/models/event_detail.rbs index c67a1a7..fd7a97a 100644 --- a/sig/x_twitter_scraper/models/event_detail.rbs +++ b/sig/x_twitter_scraper/models/event_detail.rbs @@ -6,7 +6,7 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::EventDetail::type_, + type: XTwitterScraper::Models::event_type, username: String, x_event_id: String } @@ -20,7 +20,7 @@ module XTwitterScraper attr_accessor occurred_at: Time - attr_accessor type: XTwitterScraper::Models::EventDetail::type_ + attr_accessor type: XTwitterScraper::Models::event_type attr_accessor username: String @@ -33,7 +33,7 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::EventDetail::type_, + type: XTwitterScraper::Models::event_type, username: String, ?x_event_id: String ) -> void @@ -43,31 +43,10 @@ module XTwitterScraper data: ::Hash[Symbol, top], monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::EventDetail::type_, + type: XTwitterScraper::Models::event_type, username: String, x_event_id: String } - - type type_ = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::EventDetail::type_] - end end end end diff --git a/sig/x_twitter_scraper/models/event_list_params.rbs b/sig/x_twitter_scraper/models/event_list_params.rbs index bc319d9..af33e9d 100644 --- a/sig/x_twitter_scraper/models/event_list_params.rbs +++ b/sig/x_twitter_scraper/models/event_list_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper type event_list_params = { after: String, - event_type: XTwitterScraper::Models::EventListParams::event_type, + event_type: XTwitterScraper::Models::event_type, limit: Integer, monitor_id: String } @@ -17,11 +17,11 @@ module XTwitterScraper def after=: (String) -> String - attr_reader event_type: XTwitterScraper::Models::EventListParams::event_type? + attr_reader event_type: XTwitterScraper::Models::event_type? def event_type=: ( - XTwitterScraper::Models::EventListParams::event_type - ) -> XTwitterScraper::Models::EventListParams::event_type + XTwitterScraper::Models::event_type + ) -> XTwitterScraper::Models::event_type attr_reader limit: Integer? @@ -33,7 +33,7 @@ module XTwitterScraper def initialize: ( ?after: String, - ?event_type: XTwitterScraper::Models::EventListParams::event_type, + ?event_type: XTwitterScraper::Models::event_type, ?limit: Integer, ?monitor_id: String, ?request_options: XTwitterScraper::request_opts @@ -41,32 +41,11 @@ module XTwitterScraper def to_hash: -> { after: String, - event_type: XTwitterScraper::Models::EventListParams::event_type, + event_type: XTwitterScraper::Models::event_type, limit: Integer, monitor_id: String, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::EventListParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/event_list_response.rbs b/sig/x_twitter_scraper/models/event_list_response.rbs index 4677f38..d21c287 100644 --- a/sig/x_twitter_scraper/models/event_list_response.rbs +++ b/sig/x_twitter_scraper/models/event_list_response.rbs @@ -2,13 +2,13 @@ module XTwitterScraper module Models type event_list_response = { - events: ::Array[XTwitterScraper::Models::EventListResponse::Event], + events: ::Array[XTwitterScraper::Event], has_more: bool, next_cursor: String } class EventListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor events: ::Array[XTwitterScraper::Models::EventListResponse::Event] + attr_accessor events: ::Array[XTwitterScraper::Event] attr_accessor has_more: bool @@ -17,79 +17,16 @@ module XTwitterScraper def next_cursor=: (String) -> String def initialize: ( - events: ::Array[XTwitterScraper::Models::EventListResponse::Event], + events: ::Array[XTwitterScraper::Event], has_more: bool, ?next_cursor: String ) -> void def to_hash: -> { - events: ::Array[XTwitterScraper::Models::EventListResponse::Event], + events: ::Array[XTwitterScraper::Event], has_more: bool, next_cursor: String } - - type event = - { - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventListResponse::Event::type_, - username: String - } - - class Event < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor data: ::Hash[Symbol, top] - - attr_accessor monitor_id: String - - attr_accessor occurred_at: Time - - attr_accessor type: XTwitterScraper::Models::EventListResponse::Event::type_ - - attr_accessor username: String - - def initialize: ( - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventListResponse::Event::type_, - username: String - ) -> void - - def to_hash: -> { - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventListResponse::Event::type_, - username: String - } - - type type_ = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::EventListResponse::Event::type_] - end - end end end end diff --git a/sig/x_twitter_scraper/models/event_retrieve_response.rbs b/sig/x_twitter_scraper/models/event_retrieve_response.rbs deleted file mode 100644 index 5d41b7b..0000000 --- a/sig/x_twitter_scraper/models/event_retrieve_response.rbs +++ /dev/null @@ -1,73 +0,0 @@ -module XTwitterScraper - module Models - type event_retrieve_response = - { - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventRetrieveResponse::type_, - username: String, - x_event_id: String - } - - class EventRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor data: ::Hash[Symbol, top] - - attr_accessor monitor_id: String - - attr_accessor occurred_at: Time - - attr_accessor type: XTwitterScraper::Models::EventRetrieveResponse::type_ - - attr_accessor username: String - - attr_reader x_event_id: String? - - def x_event_id=: (String) -> String - - def initialize: ( - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventRetrieveResponse::type_, - username: String, - ?x_event_id: String - ) -> void - - def to_hash: -> { - id: String, - data: ::Hash[Symbol, top], - monitor_id: String, - occurred_at: Time, - type: XTwitterScraper::Models::EventRetrieveResponse::type_, - username: String, - x_event_id: String - } - - type type_ = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::EventRetrieveResponse::type_] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/extraction_list_response.rbs b/sig/x_twitter_scraper/models/extraction_list_response.rbs index 76ced3e..3a7bf61 100644 --- a/sig/x_twitter_scraper/models/extraction_list_response.rbs +++ b/sig/x_twitter_scraper/models/extraction_list_response.rbs @@ -2,13 +2,13 @@ module XTwitterScraper module Models type extraction_list_response = { - extractions: ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction], + extractions: ::Array[XTwitterScraper::ExtractionJob], has_more: bool, next_cursor: String } class ExtractionListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor extractions: ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction] + attr_accessor extractions: ::Array[XTwitterScraper::ExtractionJob] attr_accessor has_more: bool @@ -17,121 +17,16 @@ module XTwitterScraper def next_cursor=: (String) -> String def initialize: ( - extractions: ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction], + extractions: ::Array[XTwitterScraper::ExtractionJob], has_more: bool, ?next_cursor: String ) -> void def to_hash: -> { - extractions: ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction], + extractions: ::Array[XTwitterScraper::ExtractionJob], has_more: bool, next_cursor: String } - - type extraction = - { - id: String, - created_at: Time, - status: XTwitterScraper::Models::ExtractionListResponse::Extraction::status, - tool_type: XTwitterScraper::Models::ExtractionListResponse::Extraction::tool_type, - total_results: Integer, - completed_at: Time - } - - class Extraction < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor status: XTwitterScraper::Models::ExtractionListResponse::Extraction::status - - attr_accessor tool_type: XTwitterScraper::Models::ExtractionListResponse::Extraction::tool_type - - attr_accessor total_results: Integer - - attr_reader completed_at: Time? - - def completed_at=: (Time) -> Time - - def initialize: ( - id: String, - created_at: Time, - status: XTwitterScraper::Models::ExtractionListResponse::Extraction::status, - tool_type: XTwitterScraper::Models::ExtractionListResponse::Extraction::tool_type, - total_results: Integer, - ?completed_at: Time - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - status: XTwitterScraper::Models::ExtractionListResponse::Extraction::status, - tool_type: XTwitterScraper::Models::ExtractionListResponse::Extraction::tool_type, - total_results: Integer, - completed_at: Time - } - - type status = :running | :completed | :failed - - module Status - extend XTwitterScraper::Internal::Type::Enum - - RUNNING: :running - COMPLETED: :completed - FAILED: :failed - - def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction::status] - end - - type tool_type = - :article_extractor - | :community_extractor - | :community_moderator_explorer - | :community_post_extractor - | :community_search - | :follower_explorer - | :following_explorer - | :list_follower_explorer - | :list_member_extractor - | :list_post_extractor - | :mention_extractor - | :people_search - | :post_extractor - | :quote_extractor - | :reply_extractor - | :repost_extractor - | :space_explorer - | :thread_extractor - | :tweet_search_extractor - | :verified_follower_explorer - - module ToolType - extend XTwitterScraper::Internal::Type::Enum - - ARTICLE_EXTRACTOR: :article_extractor - COMMUNITY_EXTRACTOR: :community_extractor - COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer - COMMUNITY_POST_EXTRACTOR: :community_post_extractor - COMMUNITY_SEARCH: :community_search - FOLLOWER_EXPLORER: :follower_explorer - FOLLOWING_EXPLORER: :following_explorer - LIST_FOLLOWER_EXPLORER: :list_follower_explorer - LIST_MEMBER_EXTRACTOR: :list_member_extractor - LIST_POST_EXTRACTOR: :list_post_extractor - MENTION_EXTRACTOR: :mention_extractor - PEOPLE_SEARCH: :people_search - POST_EXTRACTOR: :post_extractor - QUOTE_EXTRACTOR: :quote_extractor - REPLY_EXTRACTOR: :reply_extractor - REPOST_EXTRACTOR: :repost_extractor - SPACE_EXPLORER: :space_explorer - THREAD_EXTRACTOR: :thread_extractor - TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor - VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer - - def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionListResponse::Extraction::tool_type] - end - end end end end diff --git a/sig/x_twitter_scraper/models/extraction_run_response.rbs b/sig/x_twitter_scraper/models/extraction_run_response.rbs index 77d45e0..e2dd402 100644 --- a/sig/x_twitter_scraper/models/extraction_run_response.rbs +++ b/sig/x_twitter_scraper/models/extraction_run_response.rbs @@ -3,39 +3,29 @@ module XTwitterScraper type extraction_run_response = { id: String, - status: XTwitterScraper::Models::ExtractionRunResponse::status, + status: :running, tool_type: XTwitterScraper::Models::ExtractionRunResponse::tool_type } class ExtractionRunResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String - attr_accessor status: XTwitterScraper::Models::ExtractionRunResponse::status + attr_accessor status: :running attr_accessor tool_type: XTwitterScraper::Models::ExtractionRunResponse::tool_type def initialize: ( id: String, - status: XTwitterScraper::Models::ExtractionRunResponse::status, - tool_type: XTwitterScraper::Models::ExtractionRunResponse::tool_type + tool_type: XTwitterScraper::Models::ExtractionRunResponse::tool_type, + ?status: :running ) -> void def to_hash: -> { id: String, - status: XTwitterScraper::Models::ExtractionRunResponse::status, + status: :running, tool_type: XTwitterScraper::Models::ExtractionRunResponse::tool_type } - type status = :running - - module Status - extend XTwitterScraper::Internal::Type::Enum - - RUNNING: :running - - def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunResponse::status] - end - type tool_type = :article_extractor | :community_extractor diff --git a/sig/x_twitter_scraper/models/integration.rbs b/sig/x_twitter_scraper/models/integration.rbs index b9315f1..56f2546 100644 --- a/sig/x_twitter_scraper/models/integration.rbs +++ b/sig/x_twitter_scraper/models/integration.rbs @@ -5,10 +5,10 @@ module XTwitterScraper id: String, config: ::Hash[Symbol, top], created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Integration::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, name: String, - type: XTwitterScraper::Models::Integration::type_, + type: :telegram, filters: ::Hash[Symbol, top], message_template: String, scope_all_monitors: bool, @@ -22,13 +22,13 @@ module XTwitterScraper attr_accessor created_at: Time - attr_accessor event_types: ::Array[XTwitterScraper::Models::Integration::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor is_active: bool attr_accessor name: String - attr_accessor type: XTwitterScraper::Models::Integration::type_ + attr_accessor type: :telegram attr_reader filters: ::Hash[Symbol, top]? @@ -50,60 +50,29 @@ module XTwitterScraper id: String, config: ::Hash[Symbol, top], created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Integration::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, name: String, - type: XTwitterScraper::Models::Integration::type_, ?filters: ::Hash[Symbol, top], ?message_template: String, ?scope_all_monitors: bool, - ?silent_push: bool + ?silent_push: bool, + ?type: :telegram ) -> void def to_hash: -> { id: String, config: ::Hash[Symbol, top], created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Integration::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, name: String, - type: XTwitterScraper::Models::Integration::type_, + type: :telegram, filters: ::Hash[Symbol, top], message_template: String, scope_all_monitors: bool, silent_push: bool } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::Integration::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::Integration::type_] - end end end end diff --git a/sig/x_twitter_scraper/models/integration_create_params.rbs b/sig/x_twitter_scraper/models/integration_create_params.rbs index fc80c05..9384dc9 100644 --- a/sig/x_twitter_scraper/models/integration_create_params.rbs +++ b/sig/x_twitter_scraper/models/integration_create_params.rbs @@ -3,9 +3,9 @@ module XTwitterScraper type integration_create_params = { config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], name: String, - type: XTwitterScraper::Models::IntegrationCreateParams::type_ + type: :telegram } & XTwitterScraper::Internal::Type::request_parameters @@ -15,25 +15,25 @@ module XTwitterScraper attr_accessor config: XTwitterScraper::IntegrationCreateParams::Config - attr_accessor event_types: ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor name: String - attr_accessor type: XTwitterScraper::Models::IntegrationCreateParams::type_ + attr_accessor type: :telegram def initialize: ( config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], name: String, - type: XTwitterScraper::Models::IntegrationCreateParams::type_, + ?type: :telegram, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], name: String, - type: XTwitterScraper::Models::IntegrationCreateParams::type_, + type: :telegram, request_options: XTwitterScraper::RequestOptions } @@ -46,37 +46,6 @@ module XTwitterScraper def to_hash: -> { chat_id: String } end - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationCreateParams::type_] - end end end end diff --git a/sig/x_twitter_scraper/models/integration_create_response.rbs b/sig/x_twitter_scraper/models/integration_create_response.rbs deleted file mode 100644 index 7dcdd8e..0000000 --- a/sig/x_twitter_scraper/models/integration_create_response.rbs +++ /dev/null @@ -1,109 +0,0 @@ -module XTwitterScraper - module Models - type integration_create_response = - { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationCreateResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor config: ::Hash[Symbol, top] - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::IntegrationCreateResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor type: XTwitterScraper::Models::IntegrationCreateResponse::type_ - - attr_reader filters: ::Hash[Symbol, top]? - - def filters=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader message_template: String? - - def message_template=: (String) -> String - - attr_reader scope_all_monitors: bool? - - def scope_all_monitors=: (bool) -> bool - - attr_reader silent_push: bool? - - def silent_push=: (bool) -> bool - - def initialize: ( - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationCreateResponse::type_, - ?filters: ::Hash[Symbol, top], - ?message_template: String, - ?scope_all_monitors: bool, - ?silent_push: bool - ) -> void - - def to_hash: -> { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationCreateResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationCreateResponse::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationCreateResponse::type_] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs b/sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs index b78648b..4582d45 100644 --- a/sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs +++ b/sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs @@ -1,92 +1,18 @@ module XTwitterScraper module Models type integration_list_deliveries_response = - { - deliveries: ::Array[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery] - } + { deliveries: ::Array[XTwitterScraper::IntegrationDelivery] } class IntegrationListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor deliveries: ::Array[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery] + attr_accessor deliveries: ::Array[XTwitterScraper::IntegrationDelivery] def initialize: ( - deliveries: ::Array[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery] + deliveries: ::Array[XTwitterScraper::IntegrationDelivery] ) -> void def to_hash: -> { - deliveries: ::Array[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery] + deliveries: ::Array[XTwitterScraper::IntegrationDelivery] } - - type delivery = - { - id: String, - attempts: Integer, - created_at: Time, - event_type: String, - status: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer, - source_id: String, - source_type: String - } - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor attempts: Integer - - attr_accessor created_at: Time - - attr_accessor event_type: String - - attr_accessor status: String - - attr_reader delivered_at: Time? - - def delivered_at=: (Time) -> Time - - attr_reader last_error: String? - - def last_error=: (String) -> String - - attr_reader last_status_code: Integer? - - def last_status_code=: (Integer) -> Integer - - attr_reader source_id: String? - - def source_id=: (String) -> String - - attr_reader source_type: String? - - def source_type=: (String) -> String - - def initialize: ( - id: String, - attempts: Integer, - created_at: Time, - event_type: String, - status: String, - ?delivered_at: Time, - ?last_error: String, - ?last_status_code: Integer, - ?source_id: String, - ?source_type: String - ) -> void - - def to_hash: -> { - id: String, - attempts: Integer, - created_at: Time, - event_type: String, - status: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer, - source_id: String, - source_type: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/integration_list_response.rbs b/sig/x_twitter_scraper/models/integration_list_response.rbs index a58f8c8..2d64d13 100644 --- a/sig/x_twitter_scraper/models/integration_list_response.rbs +++ b/sig/x_twitter_scraper/models/integration_list_response.rbs @@ -1,126 +1,16 @@ module XTwitterScraper module Models type integration_list_response = - { - integrations: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration] - } + { integrations: ::Array[XTwitterScraper::Integration] } class IntegrationListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor integrations: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration] + attr_accessor integrations: ::Array[XTwitterScraper::Integration] def initialize: ( - integrations: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration] + integrations: ::Array[XTwitterScraper::Integration] ) -> void - def to_hash: -> { - integrations: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration] - } - - type integration = - { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationListResponse::Integration::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - class Integration < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor config: ::Hash[Symbol, top] - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::event_type] - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor type: XTwitterScraper::Models::IntegrationListResponse::Integration::type_ - - attr_reader filters: ::Hash[Symbol, top]? - - def filters=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader message_template: String? - - def message_template=: (String) -> String - - attr_reader scope_all_monitors: bool? - - def scope_all_monitors=: (bool) -> bool - - attr_reader silent_push: bool? - - def silent_push=: (bool) -> bool - - def initialize: ( - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationListResponse::Integration::type_, - ?filters: ::Hash[Symbol, top], - ?message_template: String, - ?scope_all_monitors: bool, - ?silent_push: bool - ) -> void - - def to_hash: -> { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationListResponse::Integration::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationListResponse::Integration::type_] - end - end + def to_hash: -> { integrations: ::Array[XTwitterScraper::Integration] } end end end diff --git a/sig/x_twitter_scraper/models/integration_retrieve_response.rbs b/sig/x_twitter_scraper/models/integration_retrieve_response.rbs deleted file mode 100644 index e9f804b..0000000 --- a/sig/x_twitter_scraper/models/integration_retrieve_response.rbs +++ /dev/null @@ -1,109 +0,0 @@ -module XTwitterScraper - module Models - type integration_retrieve_response = - { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationRetrieveResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor config: ::Hash[Symbol, top] - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor type: XTwitterScraper::Models::IntegrationRetrieveResponse::type_ - - attr_reader filters: ::Hash[Symbol, top]? - - def filters=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader message_template: String? - - def message_template=: (String) -> String - - attr_reader scope_all_monitors: bool? - - def scope_all_monitors=: (bool) -> bool - - attr_reader silent_push: bool? - - def silent_push=: (bool) -> bool - - def initialize: ( - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationRetrieveResponse::type_, - ?filters: ::Hash[Symbol, top], - ?message_template: String, - ?scope_all_monitors: bool, - ?silent_push: bool - ) -> void - - def to_hash: -> { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationRetrieveResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationRetrieveResponse::type_] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_update_params.rbs b/sig/x_twitter_scraper/models/integration_update_params.rbs index ebbf94d..ad04555 100644 --- a/sig/x_twitter_scraper/models/integration_update_params.rbs +++ b/sig/x_twitter_scraper/models/integration_update_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper type integration_update_params = { id: String, - event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], filters: ::Hash[Symbol, top], is_active: bool, message_template: ::Hash[Symbol, top], @@ -19,11 +19,11 @@ module XTwitterScraper attr_accessor id: String - attr_reader event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type]? + attr_reader event_types: ::Array[XTwitterScraper::Models::event_type]? def event_types=: ( - ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type] - ) -> ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type] + ::Array[XTwitterScraper::Models::event_type] + ) -> ::Array[XTwitterScraper::Models::event_type] attr_reader filters: ::Hash[Symbol, top]? @@ -51,7 +51,7 @@ module XTwitterScraper def initialize: ( id: String, - ?event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?filters: ::Hash[Symbol, top], ?is_active: bool, ?message_template: ::Hash[Symbol, top], @@ -63,7 +63,7 @@ module XTwitterScraper def to_hash: -> { id: String, - event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], filters: ::Hash[Symbol, top], is_active: bool, message_template: ::Hash[Symbol, top], @@ -72,27 +72,6 @@ module XTwitterScraper silent_push: bool, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/integration_update_response.rbs b/sig/x_twitter_scraper/models/integration_update_response.rbs deleted file mode 100644 index 3e6a191..0000000 --- a/sig/x_twitter_scraper/models/integration_update_response.rbs +++ /dev/null @@ -1,109 +0,0 @@ -module XTwitterScraper - module Models - type integration_update_response = - { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationUpdateResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor config: ::Hash[Symbol, top] - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor type: XTwitterScraper::Models::IntegrationUpdateResponse::type_ - - attr_reader filters: ::Hash[Symbol, top]? - - def filters=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader message_template: String? - - def message_template=: (String) -> String - - attr_reader scope_all_monitors: bool? - - def scope_all_monitors=: (bool) -> bool - - attr_reader silent_push: bool? - - def silent_push=: (bool) -> bool - - def initialize: ( - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationUpdateResponse::type_, - ?filters: ::Hash[Symbol, top], - ?message_template: String, - ?scope_all_monitors: bool, - ?silent_push: bool - ) -> void - - def to_hash: -> { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::event_type], - is_active: bool, - name: String, - type: XTwitterScraper::Models::IntegrationUpdateResponse::type_, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::event_type] - end - - type type_ = :telegram - - module Type - extend XTwitterScraper::Internal::Type::Enum - - TELEGRAM: :telegram - - def self?.values: -> ::Array[XTwitterScraper::Models::IntegrationUpdateResponse::type_] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/monitor.rbs b/sig/x_twitter_scraper/models/monitor.rbs index bc05dae..630bad5 100644 --- a/sig/x_twitter_scraper/models/monitor.rbs +++ b/sig/x_twitter_scraper/models/monitor.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Monitor::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, username: String, x_user_id: String @@ -15,7 +15,7 @@ module XTwitterScraper attr_accessor created_at: Time - attr_accessor event_types: ::Array[XTwitterScraper::Models::Monitor::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor is_active: bool @@ -26,7 +26,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Monitor::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, username: String, x_user_id: String @@ -35,32 +35,11 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Monitor::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, username: String, x_user_id: String } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::Monitor::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/monitor_create_params.rbs b/sig/x_twitter_scraper/models/monitor_create_params.rbs index 285814d..ad27098 100644 --- a/sig/x_twitter_scraper/models/monitor_create_params.rbs +++ b/sig/x_twitter_scraper/models/monitor_create_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models type monitor_create_params = { - event_types: ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String } & XTwitterScraper::Internal::Type::request_parameters @@ -11,42 +11,21 @@ module XTwitterScraper extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor event_types: ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor username: String def initialize: ( - event_types: ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - event_types: ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/monitor_create_response.rbs b/sig/x_twitter_scraper/models/monitor_create_response.rbs index f715e38..c6a9155 100644 --- a/sig/x_twitter_scraper/models/monitor_create_response.rbs +++ b/sig/x_twitter_scraper/models/monitor_create_response.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, x_user_id: String } @@ -14,7 +14,7 @@ module XTwitterScraper attr_accessor created_at: Time - attr_accessor event_types: ::Array[XTwitterScraper::Models::MonitorCreateResponse::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor username: String @@ -23,7 +23,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, x_user_id: String ) -> void @@ -31,31 +31,10 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, x_user_id: String } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorCreateResponse::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/monitor_list_response.rbs b/sig/x_twitter_scraper/models/monitor_list_response.rbs index 05c86cd..171240a 100644 --- a/sig/x_twitter_scraper/models/monitor_list_response.rbs +++ b/sig/x_twitter_scraper/models/monitor_list_response.rbs @@ -1,88 +1,22 @@ module XTwitterScraper module Models type monitor_list_response = - { - monitors: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor], - total: Integer - } + { monitors: ::Array[XTwitterScraper::Monitor], total: Integer } class MonitorListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor monitors: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor] + attr_accessor monitors: ::Array[XTwitterScraper::Monitor] attr_accessor total: Integer def initialize: ( - monitors: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor], + monitors: ::Array[XTwitterScraper::Monitor], total: Integer ) -> void def to_hash: -> { - monitors: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor], + monitors: ::Array[XTwitterScraper::Monitor], total: Integer } - - type monitor = - { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - class Monitor < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor::event_type] - - attr_accessor is_active: bool - - attr_accessor username: String - - attr_accessor x_user_id: String - - def initialize: ( - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor::event_type], - is_active: bool, - username: String, - x_user_id: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorListResponse::Monitor::event_type] - end - end end end end diff --git a/sig/x_twitter_scraper/models/monitor_retrieve_response.rbs b/sig/x_twitter_scraper/models/monitor_retrieve_response.rbs deleted file mode 100644 index 0372384..0000000 --- a/sig/x_twitter_scraper/models/monitor_retrieve_response.rbs +++ /dev/null @@ -1,66 +0,0 @@ -module XTwitterScraper - module Models - type monitor_retrieve_response = - { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorRetrieveResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - class MonitorRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::MonitorRetrieveResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor username: String - - attr_accessor x_user_id: String - - def initialize: ( - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorRetrieveResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorRetrieveResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorRetrieveResponse::event_type] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/monitor_update_params.rbs b/sig/x_twitter_scraper/models/monitor_update_params.rbs index 2db66d7..1a2beb7 100644 --- a/sig/x_twitter_scraper/models/monitor_update_params.rbs +++ b/sig/x_twitter_scraper/models/monitor_update_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper type monitor_update_params = { id: String, - event_types: ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -14,11 +14,11 @@ module XTwitterScraper attr_accessor id: String - attr_reader event_types: ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type]? + attr_reader event_types: ::Array[XTwitterScraper::Models::event_type]? def event_types=: ( - ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type] - ) -> ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type] + ::Array[XTwitterScraper::Models::event_type] + ) -> ::Array[XTwitterScraper::Models::event_type] attr_reader is_active: bool? @@ -26,38 +26,17 @@ module XTwitterScraper def initialize: ( id: String, - ?event_types: ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?is_active: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, - event_types: ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/monitor_update_response.rbs b/sig/x_twitter_scraper/models/monitor_update_response.rbs deleted file mode 100644 index dbd8927..0000000 --- a/sig/x_twitter_scraper/models/monitor_update_response.rbs +++ /dev/null @@ -1,66 +0,0 @@ -module XTwitterScraper - module Models - type monitor_update_response = - { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorUpdateResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - class MonitorUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::MonitorUpdateResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor username: String - - attr_accessor x_user_id: String - - def initialize: ( - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorUpdateResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::MonitorUpdateResponse::event_type], - is_active: bool, - username: String, - x_user_id: String - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::MonitorUpdateResponse::event_type] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/paginated_tweets.rbs b/sig/x_twitter_scraper/models/paginated_tweets.rbs index bfb7cf2..65af5e0 100644 --- a/sig/x_twitter_scraper/models/paginated_tweets.rbs +++ b/sig/x_twitter_scraper/models/paginated_tweets.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { has_next_page: bool, next_cursor: String, - tweets: ::Array[XTwitterScraper::PaginatedTweets::Tweet] + tweets: ::Array[XTwitterScraper::X::SearchTweet] } class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel @@ -12,128 +12,19 @@ module XTwitterScraper attr_accessor next_cursor: String - attr_accessor tweets: ::Array[XTwitterScraper::PaginatedTweets::Tweet] + attr_accessor tweets: ::Array[XTwitterScraper::X::SearchTweet] def initialize: ( has_next_page: bool, next_cursor: String, - tweets: ::Array[XTwitterScraper::PaginatedTweets::Tweet] + tweets: ::Array[XTwitterScraper::X::SearchTweet] ) -> void def to_hash: -> { has_next_page: bool, next_cursor: String, - tweets: ::Array[XTwitterScraper::PaginatedTweets::Tweet] + tweets: ::Array[XTwitterScraper::X::SearchTweet] } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::PaginatedTweets::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::PaginatedTweets::Tweet::Author? - - def author=: ( - XTwitterScraper::PaginatedTweets::Tweet::Author - ) -> XTwitterScraper::PaginatedTweets::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::PaginatedTweets::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::PaginatedTweets::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end end end end diff --git a/sig/x_twitter_scraper/models/paginated_users.rbs b/sig/x_twitter_scraper/models/paginated_users.rbs index 10688a6..f139b41 100644 --- a/sig/x_twitter_scraper/models/paginated_users.rbs +++ b/sig/x_twitter_scraper/models/paginated_users.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { has_next_page: bool, next_cursor: String, - users: ::Array[XTwitterScraper::PaginatedUsers::User] + users: ::Array[XTwitterScraper::X::UserProfile] } class PaginatedUsers < XTwitterScraper::Internal::Type::BaseModel @@ -12,102 +12,19 @@ module XTwitterScraper attr_accessor next_cursor: String - attr_accessor users: ::Array[XTwitterScraper::PaginatedUsers::User] + attr_accessor users: ::Array[XTwitterScraper::X::UserProfile] def initialize: ( has_next_page: bool, next_cursor: String, - users: ::Array[XTwitterScraper::PaginatedUsers::User] + users: ::Array[XTwitterScraper::X::UserProfile] ) -> void def to_hash: -> { has_next_page: bool, next_cursor: String, - users: ::Array[XTwitterScraper::PaginatedUsers::User] + users: ::Array[XTwitterScraper::X::UserProfile] } - - type user = - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - - class User < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader followers: Integer? - - def followers=: (Integer) -> Integer - - attr_reader following: Integer? - - def following=: (Integer) -> Integer - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - attr_reader statuses_count: Integer? - - def statuses_count=: (Integer) -> Integer - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?created_at: String, - ?description: String, - ?followers: Integer, - ?following: Integer, - ?location: String, - ?profile_picture: String, - ?statuses_count: Integer, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - end end end end diff --git a/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbs b/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbs index a61baf7..2670f94 100644 --- a/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbs +++ b/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rbs @@ -6,7 +6,7 @@ module XTwitterScraper count: Integer, hours: Integer, region: String, - source: String + source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source } & XTwitterScraper::Internal::Type::request_parameters @@ -30,16 +30,18 @@ module XTwitterScraper def region=: (String) -> String - attr_reader source: String? + attr_reader source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source? - def source=: (String) -> String + def source=: ( + XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source + ) -> XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source def initialize: ( ?category: String, ?count: Integer, ?hours: Integer, ?region: String, - ?source: String, + ?source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, ?request_options: XTwitterScraper::request_opts ) -> void @@ -48,9 +50,32 @@ module XTwitterScraper count: Integer, hours: Integer, region: String, - source: String, + source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, request_options: XTwitterScraper::RequestOptions } + + type source = + :github + | :google_trends + | :hacker_news + | :polymarket + | :reddit + | :trustmrr + | :wikipedia + + module Source + extend XTwitterScraper::Internal::Type::Enum + + GITHUB: :github + GOOGLE_TRENDS: :google_trends + HACKER_NEWS: :hacker_news + POLYMARKET: :polymarket + REDDIT: :reddit + TRUSTMRR: :trustmrr + WIKIPEDIA: :wikipedia + + def self?.values: -> ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source] + end end end end diff --git a/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbs b/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbs index 9d524d4..5348b2c 100644 --- a/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbs +++ b/sig/x_twitter_scraper/models/radar_retrieve_trending_topics_response.rbs @@ -1,88 +1,22 @@ module XTwitterScraper module Models type radar_retrieve_trending_topics_response = - { - items: ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item], - total: Integer - } + { items: ::Array[XTwitterScraper::RadarItem], total: Integer } class RadarRetrieveTrendingTopicsResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor items: ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item] + attr_accessor items: ::Array[XTwitterScraper::RadarItem] attr_accessor total: Integer def initialize: ( - items: ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item], + items: ::Array[XTwitterScraper::RadarItem], total: Integer ) -> void def to_hash: -> { - items: ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item], + items: ::Array[XTwitterScraper::RadarItem], total: Integer } - - type item = - { - category: String, - published_at: Time, - region: String, - score: Float, - source: String, - title: String, - description: String, - image_url: String, - url: String - } - - class Item < XTwitterScraper::Internal::Type::BaseModel - attr_accessor category: String - - attr_accessor published_at: Time - - attr_accessor region: String - - attr_accessor score: Float - - attr_accessor source: String - - attr_accessor title: String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader image_url: String? - - def image_url=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - category: String, - published_at: Time, - region: String, - score: Float, - source: String, - title: String, - ?description: String, - ?image_url: String, - ?url: String - ) -> void - - def to_hash: -> { - category: String, - published_at: Time, - region: String, - score: Float, - source: String, - title: String, - description: String, - image_url: String, - url: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/style_analyze_response.rbs b/sig/x_twitter_scraper/models/style_analyze_response.rbs deleted file mode 100644 index 7b05848..0000000 --- a/sig/x_twitter_scraper/models/style_analyze_response.rbs +++ /dev/null @@ -1,76 +0,0 @@ -module XTwitterScraper - module Models - type style_analyze_response = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet], - x_username: String - } - - class StyleAnalyzeResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor tweets: ::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet] - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet], - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet], - x_username: String - } - - type tweet = - { - id: String, - text: String, - author_username: String, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author_username: String? - - def author_username=: (String) -> String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - text: String, - ?author_username: String, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - text: String, - author_username: String, - created_at: String - } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/style_compare_response.rbs b/sig/x_twitter_scraper/models/style_compare_response.rbs index d4d312c..e755343 100644 --- a/sig/x_twitter_scraper/models/style_compare_response.rbs +++ b/sig/x_twitter_scraper/models/style_compare_response.rbs @@ -2,170 +2,24 @@ module XTwitterScraper module Models type style_compare_response = { - :style1 => XTwitterScraper::Models::StyleCompareResponse::Style1, - :style2 => XTwitterScraper::Models::StyleCompareResponse::Style2 + :style1 => XTwitterScraper::StyleProfile, + :style2 => XTwitterScraper::StyleProfile } class StyleCompareResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor style1: XTwitterScraper::Models::StyleCompareResponse::Style1 + attr_accessor style1: XTwitterScraper::StyleProfile - attr_accessor style2: XTwitterScraper::Models::StyleCompareResponse::Style2 + attr_accessor style2: XTwitterScraper::StyleProfile def initialize: ( - style1: XTwitterScraper::Models::StyleCompareResponse::Style1, - style2: XTwitterScraper::Models::StyleCompareResponse::Style2 + style1: XTwitterScraper::StyleProfile, + style2: XTwitterScraper::StyleProfile ) -> void def to_hash: -> { - :style1 => XTwitterScraper::Models::StyleCompareResponse::Style1, - :style2 => XTwitterScraper::Models::StyleCompareResponse::Style2 + :style1 => XTwitterScraper::StyleProfile, + :style2 => XTwitterScraper::StyleProfile } - - type style1 = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet], - x_username: String - } - - class Style1 < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet] - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet], - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style1::Tweet], - x_username: String - } - - type tweet = - { - id: String, - text: String, - author_username: String, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author_username: String? - - def author_username=: (String) -> String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - text: String, - ?author_username: String, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - text: String, - author_username: String, - created_at: String - } - end - end - - type style2 = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet], - x_username: String - } - - class Style2 < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet] - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet], - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleCompareResponse::Style2::Tweet], - x_username: String - } - - type tweet = - { - id: String, - text: String, - author_username: String, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author_username: String? - - def author_username=: (String) -> String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - text: String, - ?author_username: String, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - text: String, - author_username: String, - created_at: String - } - end - end end end end diff --git a/sig/x_twitter_scraper/models/style_delete_params.rbs b/sig/x_twitter_scraper/models/style_delete_params.rbs index f95c60d..dd439a4 100644 --- a/sig/x_twitter_scraper/models/style_delete_params.rbs +++ b/sig/x_twitter_scraper/models/style_delete_params.rbs @@ -1,21 +1,21 @@ module XTwitterScraper module Models type style_delete_params = - { username: String } & XTwitterScraper::Internal::Type::request_parameters + { id: String } & XTwitterScraper::Internal::Type::request_parameters class StyleDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor username: String + attr_accessor id: String def initialize: ( - username: String, + id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - username: String, + id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/style_get_performance_params.rbs b/sig/x_twitter_scraper/models/style_get_performance_params.rbs index 66f09f7..a8c78db 100644 --- a/sig/x_twitter_scraper/models/style_get_performance_params.rbs +++ b/sig/x_twitter_scraper/models/style_get_performance_params.rbs @@ -1,21 +1,21 @@ module XTwitterScraper module Models type style_get_performance_params = - { username: String } & XTwitterScraper::Internal::Type::request_parameters + { id: String } & XTwitterScraper::Internal::Type::request_parameters class StyleGetPerformanceParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor username: String + attr_accessor id: String def initialize: ( - username: String, + id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - username: String, + id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/style_list_response.rbs b/sig/x_twitter_scraper/models/style_list_response.rbs index 8fa461a..1fb1595 100644 --- a/sig/x_twitter_scraper/models/style_list_response.rbs +++ b/sig/x_twitter_scraper/models/style_list_response.rbs @@ -1,50 +1,16 @@ module XTwitterScraper module Models type style_list_response = - { styles: ::Array[XTwitterScraper::Models::StyleListResponse::Style] } + { styles: ::Array[XTwitterScraper::StyleProfileSummary] } class StyleListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor styles: ::Array[XTwitterScraper::Models::StyleListResponse::Style] + attr_accessor styles: ::Array[XTwitterScraper::StyleProfileSummary] def initialize: ( - styles: ::Array[XTwitterScraper::Models::StyleListResponse::Style] + styles: ::Array[XTwitterScraper::StyleProfileSummary] ) -> void - def to_hash: -> { - styles: ::Array[XTwitterScraper::Models::StyleListResponse::Style] - } - - type style = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - x_username: String - } - - class Style < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - x_username: String - } - end + def to_hash: -> { styles: ::Array[XTwitterScraper::StyleProfileSummary] } end end end diff --git a/sig/x_twitter_scraper/models/style_retrieve_params.rbs b/sig/x_twitter_scraper/models/style_retrieve_params.rbs index 9619399..54bdc28 100644 --- a/sig/x_twitter_scraper/models/style_retrieve_params.rbs +++ b/sig/x_twitter_scraper/models/style_retrieve_params.rbs @@ -1,21 +1,21 @@ module XTwitterScraper module Models type style_retrieve_params = - { username: String } & XTwitterScraper::Internal::Type::request_parameters + { id: String } & XTwitterScraper::Internal::Type::request_parameters class StyleRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor username: String + attr_accessor id: String def initialize: ( - username: String, + id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - username: String, + id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/style_retrieve_response.rbs b/sig/x_twitter_scraper/models/style_retrieve_response.rbs deleted file mode 100644 index a1cd7fd..0000000 --- a/sig/x_twitter_scraper/models/style_retrieve_response.rbs +++ /dev/null @@ -1,76 +0,0 @@ -module XTwitterScraper - module Models - type style_retrieve_response = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet], - x_username: String - } - - class StyleRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor tweets: ::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet] - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet], - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleRetrieveResponse::Tweet], - x_username: String - } - - type tweet = - { - id: String, - text: String, - author_username: String, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author_username: String? - - def author_username=: (String) -> String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - text: String, - ?author_username: String, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - text: String, - author_username: String, - created_at: String - } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/style_update_params.rbs b/sig/x_twitter_scraper/models/style_update_params.rbs index 9151ed5..a3115cb 100644 --- a/sig/x_twitter_scraper/models/style_update_params.rbs +++ b/sig/x_twitter_scraper/models/style_update_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models type style_update_params = { - username: String, + id: String, label: String, tweets: ::Array[XTwitterScraper::StyleUpdateParams::Tweet] } @@ -12,21 +12,21 @@ module XTwitterScraper extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor username: String + attr_accessor id: String attr_accessor label: String attr_accessor tweets: ::Array[XTwitterScraper::StyleUpdateParams::Tweet] def initialize: ( - username: String, + id: String, label: String, tweets: ::Array[XTwitterScraper::StyleUpdateParams::Tweet], ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - username: String, + id: String, label: String, tweets: ::Array[XTwitterScraper::StyleUpdateParams::Tweet], request_options: XTwitterScraper::RequestOptions diff --git a/sig/x_twitter_scraper/models/style_update_response.rbs b/sig/x_twitter_scraper/models/style_update_response.rbs deleted file mode 100644 index 3ebb59b..0000000 --- a/sig/x_twitter_scraper/models/style_update_response.rbs +++ /dev/null @@ -1,76 +0,0 @@ -module XTwitterScraper - module Models - type style_update_response = - { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet], - x_username: String - } - - class StyleUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor fetched_at: Time - - attr_accessor is_own_account: bool - - attr_accessor tweet_count: Integer - - attr_accessor tweets: ::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet] - - attr_accessor x_username: String - - def initialize: ( - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet], - x_username: String - ) -> void - - def to_hash: -> { - fetched_at: Time, - is_own_account: bool, - tweet_count: Integer, - tweets: ::Array[XTwitterScraper::Models::StyleUpdateResponse::Tweet], - x_username: String - } - - type tweet = - { - id: String, - text: String, - author_username: String, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author_username: String? - - def author_username=: (String) -> String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - text: String, - ?author_username: String, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - text: String, - author_username: String, - created_at: String - } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/webhook.rbs b/sig/x_twitter_scraper/models/webhook.rbs index 8b688e0..fa648e5 100644 --- a/sig/x_twitter_scraper/models/webhook.rbs +++ b/sig/x_twitter_scraper/models/webhook.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Webhook::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, url: String } @@ -14,7 +14,7 @@ module XTwitterScraper attr_accessor created_at: Time - attr_accessor event_types: ::Array[XTwitterScraper::Models::Webhook::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor is_active: bool @@ -23,7 +23,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Webhook::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, url: String ) -> void @@ -31,31 +31,10 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::Webhook::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, url: String } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::Webhook::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/webhook_create_params.rbs b/sig/x_twitter_scraper/models/webhook_create_params.rbs index 9aa80d4..847d05e 100644 --- a/sig/x_twitter_scraper/models/webhook_create_params.rbs +++ b/sig/x_twitter_scraper/models/webhook_create_params.rbs @@ -1,52 +1,28 @@ module XTwitterScraper module Models type webhook_create_params = - { - event_types: ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type], - url: String - } + { event_types: ::Array[XTwitterScraper::Models::event_type], url: String } & XTwitterScraper::Internal::Type::request_parameters class WebhookCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor event_types: ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor url: String def initialize: ( - event_types: ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], url: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - event_types: ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], url: String, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/webhook_create_response.rbs b/sig/x_twitter_scraper/models/webhook_create_response.rbs index 2bb74c6..0dc610b 100644 --- a/sig/x_twitter_scraper/models/webhook_create_response.rbs +++ b/sig/x_twitter_scraper/models/webhook_create_response.rbs @@ -4,7 +4,7 @@ module XTwitterScraper { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], secret: String, url: String } @@ -14,7 +14,7 @@ module XTwitterScraper attr_accessor created_at: Time - attr_accessor event_types: ::Array[XTwitterScraper::Models::WebhookCreateResponse::event_type] + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] attr_accessor secret: String @@ -23,7 +23,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], secret: String, url: String ) -> void @@ -31,31 +31,10 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookCreateResponse::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], secret: String, url: String } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::WebhookCreateResponse::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/webhook_list_deliveries_response.rbs b/sig/x_twitter_scraper/models/webhook_list_deliveries_response.rbs index 213923f..f0ffde0 100644 --- a/sig/x_twitter_scraper/models/webhook_list_deliveries_response.rbs +++ b/sig/x_twitter_scraper/models/webhook_list_deliveries_response.rbs @@ -1,78 +1,14 @@ module XTwitterScraper module Models type webhook_list_deliveries_response = - { - deliveries: ::Array[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery] - } + { deliveries: ::Array[XTwitterScraper::Delivery] } class WebhookListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor deliveries: ::Array[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery] + attr_accessor deliveries: ::Array[XTwitterScraper::Delivery] - def initialize: ( - deliveries: ::Array[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery] - ) -> void + def initialize: (deliveries: ::Array[XTwitterScraper::Delivery]) -> void - def to_hash: -> { - deliveries: ::Array[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery] - } - - type delivery = - { - id: String, - attempts: Integer, - created_at: Time, - status: String, - stream_event_id: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer - } - - class Delivery < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor attempts: Integer - - attr_accessor created_at: Time - - attr_accessor status: String - - attr_accessor stream_event_id: String - - attr_reader delivered_at: Time? - - def delivered_at=: (Time) -> Time - - attr_reader last_error: String? - - def last_error=: (String) -> String - - attr_reader last_status_code: Integer? - - def last_status_code=: (Integer) -> Integer - - def initialize: ( - id: String, - attempts: Integer, - created_at: Time, - status: String, - stream_event_id: String, - ?delivered_at: Time, - ?last_error: String, - ?last_status_code: Integer - ) -> void - - def to_hash: -> { - id: String, - attempts: Integer, - created_at: Time, - status: String, - stream_event_id: String, - delivered_at: Time, - last_error: String, - last_status_code: Integer - } - end + def to_hash: -> { deliveries: ::Array[XTwitterScraper::Delivery] } end end end diff --git a/sig/x_twitter_scraper/models/webhook_list_response.rbs b/sig/x_twitter_scraper/models/webhook_list_response.rbs index 9fc55f8..62fba30 100644 --- a/sig/x_twitter_scraper/models/webhook_list_response.rbs +++ b/sig/x_twitter_scraper/models/webhook_list_response.rbs @@ -1,78 +1,13 @@ module XTwitterScraper module Models - type webhook_list_response = - { - webhooks: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook] - } + type webhook_list_response = { webhooks: ::Array[XTwitterScraper::Webhook] } class WebhookListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor webhooks: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook] + attr_accessor webhooks: ::Array[XTwitterScraper::Webhook] - def initialize: ( - webhooks: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook] - ) -> void + def initialize: (webhooks: ::Array[XTwitterScraper::Webhook]) -> void - def to_hash: -> { - webhooks: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook] - } - - type webhook = - { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook::event_type], - is_active: bool, - url: String - } - - class Webhook < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook::event_type] - - attr_accessor is_active: bool - - attr_accessor url: String - - def initialize: ( - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook::event_type], - is_active: bool, - url: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook::event_type], - is_active: bool, - url: String - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::WebhookListResponse::Webhook::event_type] - end - end + def to_hash: -> { webhooks: ::Array[XTwitterScraper::Webhook] } end end end diff --git a/sig/x_twitter_scraper/models/webhook_update_params.rbs b/sig/x_twitter_scraper/models/webhook_update_params.rbs index ac87d80..90d4dd7 100644 --- a/sig/x_twitter_scraper/models/webhook_update_params.rbs +++ b/sig/x_twitter_scraper/models/webhook_update_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper type webhook_update_params = { id: String, - event_types: ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, url: String } @@ -15,11 +15,11 @@ module XTwitterScraper attr_accessor id: String - attr_reader event_types: ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type]? + attr_reader event_types: ::Array[XTwitterScraper::Models::event_type]? def event_types=: ( - ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type] - ) -> ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type] + ::Array[XTwitterScraper::Models::event_type] + ) -> ::Array[XTwitterScraper::Models::event_type] attr_reader is_active: bool? @@ -31,7 +31,7 @@ module XTwitterScraper def initialize: ( id: String, - ?event_types: ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?is_active: bool, ?url: String, ?request_options: XTwitterScraper::request_opts @@ -39,32 +39,11 @@ module XTwitterScraper def to_hash: -> { id: String, - event_types: ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, url: String, request_options: XTwitterScraper::RequestOptions } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type] - end end end end diff --git a/sig/x_twitter_scraper/models/webhook_update_response.rbs b/sig/x_twitter_scraper/models/webhook_update_response.rbs deleted file mode 100644 index 8cae585..0000000 --- a/sig/x_twitter_scraper/models/webhook_update_response.rbs +++ /dev/null @@ -1,61 +0,0 @@ -module XTwitterScraper - module Models - type webhook_update_response = - { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookUpdateResponse::event_type], - is_active: bool, - url: String - } - - class WebhookUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor event_types: ::Array[XTwitterScraper::Models::WebhookUpdateResponse::event_type] - - attr_accessor is_active: bool - - attr_accessor url: String - - def initialize: ( - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookUpdateResponse::event_type], - is_active: bool, - url: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::WebhookUpdateResponse::event_type], - is_active: bool, - url: String - } - - type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" - - module EventType - extend XTwitterScraper::Internal::Type::Enum - - TWEET_NEW: :"tweet.new" - TWEET_REPLY: :"tweet.reply" - TWEET_RETWEET: :"tweet.retweet" - TWEET_QUOTE: :"tweet.quote" - FOLLOWER_GAINED: :"follower.gained" - FOLLOWER_LOST: :"follower.lost" - - def self?.values: -> ::Array[XTwitterScraper::Models::WebhookUpdateResponse::event_type] - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/account_bulk_retry_params.rbs b/sig/x_twitter_scraper/models/x/account_bulk_retry_params.rbs new file mode 100644 index 0000000..b90bcff --- /dev/null +++ b/sig/x_twitter_scraper/models/x/account_bulk_retry_params.rbs @@ -0,0 +1,19 @@ +module XTwitterScraper + module Models + module X + type account_bulk_retry_params = + { } & XTwitterScraper::Internal::Type::request_parameters + + class AccountBulkRetryParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + def initialize: ( + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { request_options: XTwitterScraper::RequestOptions } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/account_bulk_retry_response.rbs b/sig/x_twitter_scraper/models/x/account_bulk_retry_response.rbs new file mode 100644 index 0000000..b51e79f --- /dev/null +++ b/sig/x_twitter_scraper/models/x/account_bulk_retry_response.rbs @@ -0,0 +1,15 @@ +module XTwitterScraper + module Models + module X + type account_bulk_retry_response = { cleared: Integer } + + class AccountBulkRetryResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor cleared: Integer + + def initialize: (cleared: Integer) -> void + + def to_hash: -> { cleared: Integer } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/account_list_response.rbs b/sig/x_twitter_scraper/models/x/account_list_response.rbs index 1de25e5..a42b0a1 100644 --- a/sig/x_twitter_scraper/models/x/account_list_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_list_response.rbs @@ -2,57 +2,16 @@ module XTwitterScraper module Models module X type account_list_response = - { - accounts: ::Array[XTwitterScraper::Models::X::AccountListResponse::Account] - } + { accounts: ::Array[XTwitterScraper::X::XAccount] } class AccountListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor accounts: ::Array[XTwitterScraper::Models::X::AccountListResponse::Account] + attr_accessor accounts: ::Array[XTwitterScraper::X::XAccount] def initialize: ( - accounts: ::Array[XTwitterScraper::Models::X::AccountListResponse::Account] + accounts: ::Array[XTwitterScraper::X::XAccount] ) -> void - def to_hash: -> { - accounts: ::Array[XTwitterScraper::Models::X::AccountListResponse::Account] - } - - type account = - { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String - } - - class Account < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor status: String - - attr_accessor x_user_id: String - - attr_accessor x_username: String - - def initialize: ( - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String - } - end + def to_hash: -> { accounts: ::Array[XTwitterScraper::X::XAccount] } end end end diff --git a/sig/x_twitter_scraper/models/x/account_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/account_retrieve_response.rbs deleted file mode 100644 index bad4ab9..0000000 --- a/sig/x_twitter_scraper/models/x/account_retrieve_response.rbs +++ /dev/null @@ -1,63 +0,0 @@ -module XTwitterScraper - module Models - module X - type account_retrieve_response = - { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String, - cookies_obtained_at: Time, - proxy_country: String, - updated_at: Time - } - - class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor status: String - - attr_accessor x_user_id: String - - attr_accessor x_username: String - - attr_reader cookies_obtained_at: Time? - - def cookies_obtained_at=: (Time) -> Time - - attr_reader proxy_country: String? - - def proxy_country=: (String) -> String - - attr_reader updated_at: Time? - - def updated_at=: (Time) -> Time - - def initialize: ( - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String, - ?cookies_obtained_at: Time, - ?proxy_country: String, - ?updated_at: Time - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - status: String, - x_user_id: String, - x_username: String, - cookies_obtained_at: Time, - proxy_country: String, - updated_at: Time - } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/bookmark_list_response.rbs b/sig/x_twitter_scraper/models/x/bookmark_list_response.rbs deleted file mode 100644 index 3a53e97..0000000 --- a/sig/x_twitter_scraper/models/x/bookmark_list_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type bookmark_list_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] - } - - class BookmarkListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::BookmarkListResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::BookmarkListResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs b/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs deleted file mode 100644 index c07e63d..0000000 --- a/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module XTwitterScraper - module Models - module X - module Communities - type join_create_response = - { community_id: String, community_name: String, success: true } - - class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor community_id: String - - attr_accessor community_name: String - - attr_accessor success: true - - def initialize: ( - community_id: String, - community_name: String, - ?success: true - ) -> void - - def to_hash: -> { - community_id: String, - community_name: String, - success: true - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs b/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs deleted file mode 100644 index c3cf4df..0000000 --- a/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module XTwitterScraper - module Models - module X - module Communities - type join_delete_all_response = - { community_id: String, community_name: String, success: true } - - class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor community_id: String - - attr_accessor community_name: String - - attr_accessor success: true - - def initialize: ( - community_id: String, - community_name: String, - ?success: true - ) -> void - - def to_hash: -> { - community_id: String, - community_name: String, - success: true - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbs b/sig/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbs new file mode 100644 index 0000000..5bab1eb --- /dev/null +++ b/sig/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbs @@ -0,0 +1,34 @@ +module XTwitterScraper + module Models + module X + module Communities + type tweet_list_by_community_params = + { id: String, cursor: String } + & XTwitterScraper::Internal::Type::request_parameters + + class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader cursor: String? + + def cursor=: (String) -> String + + def initialize: ( + id: String, + ?cursor: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + cursor: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/search_tweet.rbs b/sig/x_twitter_scraper/models/x/search_tweet.rbs index bd4470b..9256302 100644 --- a/sig/x_twitter_scraper/models/x/search_tweet.rbs +++ b/sig/x_twitter_scraper/models/x/search_tweet.rbs @@ -8,6 +8,7 @@ module XTwitterScraper author: XTwitterScraper::X::SearchTweet::Author, bookmark_count: Integer, created_at: String, + is_note_tweet: bool, like_count: Integer, quote_count: Integer, reply_count: Integer, @@ -34,6 +35,10 @@ module XTwitterScraper def created_at=: (String) -> String + attr_reader is_note_tweet: bool? + + def is_note_tweet=: (bool) -> bool + attr_reader like_count: Integer? def like_count=: (Integer) -> Integer @@ -60,6 +65,7 @@ module XTwitterScraper ?author: XTwitterScraper::X::SearchTweet::Author, ?bookmark_count: Integer, ?created_at: String, + ?is_note_tweet: bool, ?like_count: Integer, ?quote_count: Integer, ?reply_count: Integer, @@ -73,6 +79,7 @@ module XTwitterScraper author: XTwitterScraper::X::SearchTweet::Author, bookmark_count: Integer, created_at: String, + is_note_tweet: bool, like_count: Integer, quote_count: Integer, reply_count: Integer, diff --git a/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs b/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs index abfeb16..a554ba3 100644 --- a/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs @@ -2,25 +2,25 @@ module XTwitterScraper module Models module X type tweet_delete_params = - { tweet_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class TweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - tweet_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/tweet_detail.rbs b/sig/x_twitter_scraper/models/x/tweet_detail.rbs index b59029a..88ce009 100644 --- a/sig/x_twitter_scraper/models/x/tweet_detail.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_detail.rbs @@ -11,7 +11,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - created_at: String + conversation_id: String, + created_at: String, + entities: ::Hash[Symbol, top], + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + media: ::Array[XTwitterScraper::X::TweetDetail::Media], + quoted_tweet: ::Hash[Symbol, top], + source: String } class TweetDetail < XTwitterScraper::Internal::Type::BaseModel @@ -31,10 +39,44 @@ module XTwitterScraper attr_accessor view_count: Integer + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader created_at: String? def created_at=: (String) -> String + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader is_note_tweet: bool? + + def is_note_tweet=: (bool) -> bool + + attr_reader is_quote_status: bool? + + def is_quote_status=: (bool) -> bool + + attr_reader is_reply: bool? + + def is_reply=: (bool) -> bool + + attr_reader media: ::Array[XTwitterScraper::X::TweetDetail::Media]? + + def media=: ( + ::Array[XTwitterScraper::X::TweetDetail::Media] + ) -> ::Array[XTwitterScraper::X::TweetDetail::Media] + + attr_reader quoted_tweet: ::Hash[Symbol, top]? + + def quoted_tweet=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader source: String? + + def source=: (String) -> String + def initialize: ( id: String, bookmark_count: Integer, @@ -44,7 +86,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - ?created_at: String + ?conversation_id: String, + ?created_at: String, + ?entities: ::Hash[Symbol, top], + ?is_note_tweet: bool, + ?is_quote_status: bool, + ?is_reply: bool, + ?media: ::Array[XTwitterScraper::X::TweetDetail::Media], + ?quoted_tweet: ::Hash[Symbol, top], + ?source: String ) -> void def to_hash: -> { @@ -56,8 +106,63 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - created_at: String + conversation_id: String, + created_at: String, + entities: ::Hash[Symbol, top], + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + media: ::Array[XTwitterScraper::X::TweetDetail::Media], + quoted_tweet: ::Hash[Symbol, top], + source: String } + + type media = + { + media_url: String, + type: XTwitterScraper::Models::X::TweetDetail::Media::type_, + url: String + } + + class Media < XTwitterScraper::Internal::Type::BaseModel + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::TweetDetail::Media::type_? + + def type=: ( + XTwitterScraper::Models::X::TweetDetail::Media::type_ + ) -> XTwitterScraper::Models::X::TweetDetail::Media::type_ + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?media_url: String, + ?type: XTwitterScraper::Models::X::TweetDetail::Media::type_, + ?url: String + ) -> void + + def to_hash: -> { + media_url: String, + type: XTwitterScraper::Models::X::TweetDetail::Media::type_, + url: String + } + + type type_ = :photo | :video | :animated_gif + + module Type + extend XTwitterScraper::Internal::Type::Enum + + PHOTO: :photo + VIDEO: :video + ANIMATED_GIF: :animated_gif + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDetail::Media::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbs deleted file mode 100644 index 2c33db9..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_get_favoriters_response.rbs +++ /dev/null @@ -1,115 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_get_favoriters_response = - { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User] - } - - class TweetGetFavoritersResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor users: ::Array[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User] - } - - type user = - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - - class User < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader followers: Integer? - - def followers=: (Integer) -> Integer - - attr_reader following: Integer? - - def following=: (Integer) -> Integer - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - attr_reader statuses_count: Integer? - - def statuses_count=: (Integer) -> Integer - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?created_at: String, - ?description: String, - ?followers: Integer, - ?following: Integer, - ?location: String, - ?profile_picture: String, - ?statuses_count: Integer, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_quotes_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_quotes_response.rbs deleted file mode 100644 index 66b2750..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_get_quotes_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_get_quotes_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] - } - - class TweetGetQuotesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs deleted file mode 100644 index 26fdd53..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_get_replies_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] - } - - class TweetGetRepliesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbs deleted file mode 100644 index 5c01f9a..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_get_retweeters_response.rbs +++ /dev/null @@ -1,115 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_get_retweeters_response = - { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User] - } - - class TweetGetRetweetersResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor users: ::Array[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User] - } - - type user = - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - - class User < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader followers: Integer? - - def followers=: (Integer) -> Integer - - attr_reader following: Integer? - - def following=: (Integer) -> Integer - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - attr_reader statuses_count: Integer? - - def statuses_count=: (Integer) -> Integer - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?created_at: String, - ?description: String, - ?followers: Integer, - ?following: Integer, - ?location: String, - ?profile_picture: String, - ?statuses_count: Integer, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_thread_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_thread_response.rbs deleted file mode 100644 index 9d843da..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_get_thread_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_get_thread_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] - } - - class TweetGetThreadResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweet_retrieve_params.rbs b/sig/x_twitter_scraper/models/x/tweet_retrieve_params.rbs index f388d88..1e4972e 100644 --- a/sig/x_twitter_scraper/models/x/tweet_retrieve_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_retrieve_params.rbs @@ -2,22 +2,21 @@ module XTwitterScraper module Models module X type tweet_retrieve_params = - { tweet_id: String } - & XTwitterScraper::Internal::Type::request_parameters + { id: String } & XTwitterScraper::Internal::Type::request_parameters class TweetRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String def initialize: ( - tweet_id: String, + id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/tweet_retrieve_response.rbs index 74fd439..78fd37b 100644 --- a/sig/x_twitter_scraper/models/x/tweet_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_retrieve_response.rbs @@ -3,126 +3,28 @@ module XTwitterScraper module X type tweet_retrieve_response = { - tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author + tweet: XTwitterScraper::X::TweetDetail, + author: XTwitterScraper::X::TweetAuthor } class TweetRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet + attr_accessor tweet: XTwitterScraper::X::TweetDetail - attr_reader author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author? + attr_reader author: XTwitterScraper::X::TweetAuthor? def author=: ( - XTwitterScraper::Models::X::TweetRetrieveResponse::Author - ) -> XTwitterScraper::Models::X::TweetRetrieveResponse::Author + XTwitterScraper::X::TweetAuthor + ) -> XTwitterScraper::X::TweetAuthor def initialize: ( - tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - ?author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author + tweet: XTwitterScraper::X::TweetDetail, + ?author: XTwitterScraper::X::TweetAuthor ) -> void def to_hash: -> { - tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author + tweet: XTwitterScraper::X::TweetDetail, + author: XTwitterScraper::X::TweetAuthor } - - type tweet = - { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - created_at: String - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor bookmark_count: Integer - - attr_accessor like_count: Integer - - attr_accessor quote_count: Integer - - attr_accessor reply_count: Integer - - attr_accessor retweet_count: Integer - - attr_accessor text: String - - attr_accessor view_count: Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - def initialize: ( - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - ?created_at: String - ) -> void - - def to_hash: -> { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - created_at: String - } - end - - type author = - { - id: String, - followers: Integer, - username: String, - verified: bool, - profile_picture: String - } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor followers: Integer - - attr_accessor username: String - - attr_accessor verified: bool - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - def initialize: ( - id: String, - followers: Integer, - username: String, - verified: bool, - ?profile_picture: String - ) -> void - - def to_hash: -> { - id: String, - followers: Integer, - username: String, - verified: bool, - profile_picture: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_search_response.rbs b/sig/x_twitter_scraper/models/x/tweet_search_response.rbs deleted file mode 100644 index de40294..0000000 --- a/sig/x_twitter_scraper/models/x/tweet_search_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type tweet_search_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - } - - class TweetSearchResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::TweetSearchResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::TweetSearchResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs b/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs index 8193de1..dcc4656 100644 --- a/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Tweets type like_create_params = - { tweet_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class LikeCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - tweet_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs b/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs index 2107203..cb8e849 100644 --- a/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Tweets type like_delete_params = - { tweet_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class LikeDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - tweet_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs b/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs index 3a39ea4..b3f1a82 100644 --- a/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Tweets type retweet_create_params = - { tweet_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class RetweetCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - tweet_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs b/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs index 7680525..6a5ff4e 100644 --- a/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Tweets type retweet_delete_params = - { tweet_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class RetweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor tweet_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - tweet_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - tweet_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbs deleted file mode 100644 index 44624c2..0000000 --- a/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_response.rbs +++ /dev/null @@ -1,115 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_retrieve_followers_you_know_response = - { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User] - } - - class UserRetrieveFollowersYouKnowResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor users: ::Array[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - users: ::Array[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User] - } - - type user = - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - - class User < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader followers: Integer? - - def followers=: (Integer) -> Integer - - attr_reader following: Integer? - - def following=: (Integer) -> Integer - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - attr_reader statuses_count: Integer? - - def statuses_count=: (Integer) -> Integer - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?created_at: String, - ?description: String, - ?followers: Integer, - ?following: Integer, - ?location: String, - ?profile_picture: String, - ?statuses_count: Integer, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_likes_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_likes_response.rbs deleted file mode 100644 index 0e92f90..0000000 --- a/sig/x_twitter_scraper/models/x/user_retrieve_likes_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_retrieve_likes_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet] - } - - class UserRetrieveLikesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_media_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_media_response.rbs deleted file mode 100644 index 0836f8a..0000000 --- a/sig/x_twitter_scraper/models/x/user_retrieve_media_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_retrieve_media_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet] - } - - class UserRetrieveMediaResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_params.rbs index 382fa97..744f86f 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_params.rbs @@ -2,22 +2,21 @@ module XTwitterScraper module Models module X type user_retrieve_params = - { username: String } - & XTwitterScraper::Internal::Type::request_parameters + { id: String } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor username: String + attr_accessor id: String def initialize: ( - username: String, + id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - username: String, + id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_response.rbs deleted file mode 100644 index f8e97cb..0000000 --- a/sig/x_twitter_scraper/models/x/user_retrieve_response.rbs +++ /dev/null @@ -1,88 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_retrieve_response = - { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - - class UserRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader followers: Integer? - - def followers=: (Integer) -> Integer - - attr_reader following: Integer? - - def following=: (Integer) -> Integer - - attr_reader location: String? - - def location=: (String) -> String - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - attr_reader statuses_count: Integer? - - def statuses_count=: (Integer) -> Integer - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?created_at: String, - ?description: String, - ?followers: Integer, - ?following: Integer, - ?location: String, - ?profile_picture: String, - ?statuses_count: Integer, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - created_at: String, - description: String, - followers: Integer, - following: Integer, - location: String, - profile_picture: String, - statuses_count: Integer, - verified: bool - } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbs deleted file mode 100644 index 117b557..0000000 --- a/sig/x_twitter_scraper/models/x/user_retrieve_tweets_response.rbs +++ /dev/null @@ -1,141 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_retrieve_tweets_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet] - } - - class UserRetrieveTweetsResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author - ) -> XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs b/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs index 982f18c..433972b 100644 --- a/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Users type follow_create_params = - { user_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class FollowCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor user_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - user_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs b/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs index 0780f63..4b479c7 100644 --- a/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs +++ b/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs @@ -3,25 +3,25 @@ module XTwitterScraper module X module Users type follow_delete_all_params = - { user_id: String, account: String } + { id: String, account: String } & XTwitterScraper::Internal::Type::request_parameters class FollowDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor user_id: String + attr_accessor id: String attr_accessor account: String def initialize: ( - user_id: String, + id: String, account: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - user_id: String, + id: String, account: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x_get_article_response.rbs b/sig/x_twitter_scraper/models/x_get_article_response.rbs index 3f2d0d8..7114e4d 100644 --- a/sig/x_twitter_scraper/models/x_get_article_response.rbs +++ b/sig/x_twitter_scraper/models/x_get_article_response.rbs @@ -3,26 +3,26 @@ module XTwitterScraper type x_get_article_response = { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::Models::XGetArticleResponse::Author + author: XTwitterScraper::X::TweetAuthor } class XGetArticleResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor article: XTwitterScraper::Models::XGetArticleResponse::Article - attr_reader author: XTwitterScraper::Models::XGetArticleResponse::Author? + attr_reader author: XTwitterScraper::X::TweetAuthor? def author=: ( - XTwitterScraper::Models::XGetArticleResponse::Author - ) -> XTwitterScraper::Models::XGetArticleResponse::Author + XTwitterScraper::X::TweetAuthor + ) -> XTwitterScraper::X::TweetAuthor def initialize: ( article: XTwitterScraper::Models::XGetArticleResponse::Article, - ?author: XTwitterScraper::Models::XGetArticleResponse::Author + ?author: XTwitterScraper::X::TweetAuthor ) -> void def to_hash: -> { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::Models::XGetArticleResponse::Author + author: XTwitterScraper::X::TweetAuthor } type article = @@ -148,45 +148,6 @@ module XTwitterScraper } end end - - type author = - { - id: String, - followers: Integer, - username: String, - verified: bool, - profile_picture: String - } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor followers: Integer - - attr_accessor username: String - - attr_accessor verified: bool - - attr_reader profile_picture: String? - - def profile_picture=: (String) -> String - - def initialize: ( - id: String, - followers: Integer, - username: String, - verified: bool, - ?profile_picture: String - ) -> void - - def to_hash: -> { - id: String, - followers: Integer, - username: String, - verified: bool, - profile_picture: String - } - end end end end diff --git a/sig/x_twitter_scraper/models/x_get_home_timeline_response.rbs b/sig/x_twitter_scraper/models/x_get_home_timeline_response.rbs deleted file mode 100644 index 14e3eb6..0000000 --- a/sig/x_twitter_scraper/models/x_get_home_timeline_response.rbs +++ /dev/null @@ -1,139 +0,0 @@ -module XTwitterScraper - module Models - type x_get_home_timeline_response = - { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - } - - class XGetHomeTimelineResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor next_cursor: String - - attr_accessor tweets: ::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - - def initialize: ( - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - ) -> void - - def to_hash: -> { - has_next_page: bool, - next_cursor: String, - tweets: ::Array[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet] - } - - type tweet = - { - id: String, - text: String, - author: XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class Tweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author? - - def author=: ( - XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author - ) -> XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - def created_at=: (String) -> String - - attr_reader like_count: Integer? - - def like_count=: (Integer) -> Integer - - attr_reader quote_count: Integer? - - def quote_count=: (Integer) -> Integer - - attr_reader reply_count: Integer? - - def reply_count=: (Integer) -> Integer - - attr_reader retweet_count: Integer? - - def retweet_count=: (Integer) -> Integer - - attr_reader view_count: Integer? - - def view_count=: (Integer) -> Integer - - def initialize: ( - id: String, - text: String, - ?author: XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer - ) -> void - - def to_hash: -> { - id: String, - text: String, - author: XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet::Author, - bookmark_count: Integer, - created_at: String, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - type author = - { id: String, name: String, username: String, verified: bool } - - class Author < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor username: String - - attr_reader verified: bool? - - def verified=: (bool) -> bool - - def initialize: ( - id: String, - name: String, - username: String, - ?verified: bool - ) -> void - - def to_hash: -> { - id: String, - name: String, - username: String, - verified: bool - } - end - end - end - end -end diff --git a/sig/x_twitter_scraper/models/x_get_trends_response.rbs b/sig/x_twitter_scraper/models/x_get_trends_response.rbs new file mode 100644 index 0000000..81c4e3e --- /dev/null +++ b/sig/x_twitter_scraper/models/x_get_trends_response.rbs @@ -0,0 +1,63 @@ +module XTwitterScraper + module Models + type x_get_trends_response = + { + count: Integer, + trends: ::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend], + woeid: Integer + } + + class XGetTrendsResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor count: Integer + + attr_accessor trends: ::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend] + + attr_accessor woeid: Integer + + def initialize: ( + count: Integer, + trends: ::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend], + woeid: Integer + ) -> void + + def to_hash: -> { + count: Integer, + trends: ::Array[XTwitterScraper::Models::XGetTrendsResponse::Trend], + woeid: Integer + } + + type trend = + { name: String, description: String, query: String, rank: Integer } + + class Trend < XTwitterScraper::Internal::Type::BaseModel + attr_accessor name: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader rank: Integer? + + def rank=: (Integer) -> Integer + + def initialize: ( + name: String, + ?description: String, + ?query: String, + ?rank: Integer + ) -> void + + def to_hash: -> { + name: String, + description: String, + query: String, + rank: Integer + } + end + end + end +end diff --git a/sig/x_twitter_scraper/resources/drafts.rbs b/sig/x_twitter_scraper/resources/drafts.rbs index ef3613b..9ff337e 100644 --- a/sig/x_twitter_scraper/resources/drafts.rbs +++ b/sig/x_twitter_scraper/resources/drafts.rbs @@ -6,12 +6,12 @@ module XTwitterScraper ?goal: XTwitterScraper::Models::DraftCreateParams::goal, ?topic: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::DraftCreateResponse + ) -> XTwitterScraper::DraftDetail def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::DraftRetrieveResponse + ) -> XTwitterScraper::DraftDetail def list: ( ?after_cursor: String, diff --git a/sig/x_twitter_scraper/resources/events.rbs b/sig/x_twitter_scraper/resources/events.rbs index a0d0642..a9592c4 100644 --- a/sig/x_twitter_scraper/resources/events.rbs +++ b/sig/x_twitter_scraper/resources/events.rbs @@ -4,11 +4,11 @@ module XTwitterScraper def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::EventRetrieveResponse + ) -> XTwitterScraper::EventDetail def list: ( ?after: String, - ?event_type: XTwitterScraper::Models::EventListParams::event_type, + ?event_type: XTwitterScraper::Models::event_type, ?limit: Integer, ?monitor_id: String, ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/integrations.rbs b/sig/x_twitter_scraper/resources/integrations.rbs index f35733a..d2da60e 100644 --- a/sig/x_twitter_scraper/resources/integrations.rbs +++ b/sig/x_twitter_scraper/resources/integrations.rbs @@ -3,20 +3,20 @@ module XTwitterScraper class Integrations def create: ( config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::IntegrationCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], name: String, - type: XTwitterScraper::Models::IntegrationCreateParams::type_, + ?type: :telegram, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationCreateResponse + ) -> XTwitterScraper::Integration def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationRetrieveResponse + ) -> XTwitterScraper::Integration def update: ( String id, - ?event_types: ::Array[XTwitterScraper::Models::IntegrationUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?filters: ::Hash[Symbol, top], ?is_active: bool, ?message_template: ::Hash[Symbol, top], @@ -24,7 +24,7 @@ module XTwitterScraper ?scope_all_monitors: bool, ?silent_push: bool, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationUpdateResponse + ) -> XTwitterScraper::Integration def list: ( ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/monitors.rbs b/sig/x_twitter_scraper/resources/monitors.rbs index 3cbcac0..3a2abf5 100644 --- a/sig/x_twitter_scraper/resources/monitors.rbs +++ b/sig/x_twitter_scraper/resources/monitors.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Resources class Monitors def create: ( - event_types: ::Array[XTwitterScraper::Models::MonitorCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], username: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::MonitorCreateResponse @@ -10,14 +10,14 @@ module XTwitterScraper def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::MonitorRetrieveResponse + ) -> XTwitterScraper::Monitor def update: ( String id, - ?event_types: ::Array[XTwitterScraper::Models::MonitorUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?is_active: bool, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::MonitorUpdateResponse + ) -> XTwitterScraper::Monitor def list: ( ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/radar.rbs b/sig/x_twitter_scraper/resources/radar.rbs index 2e4521a..ecd4b00 100644 --- a/sig/x_twitter_scraper/resources/radar.rbs +++ b/sig/x_twitter_scraper/resources/radar.rbs @@ -6,7 +6,7 @@ module XTwitterScraper ?count: Integer, ?hours: Integer, ?region: String, - ?source: String, + ?source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse diff --git a/sig/x_twitter_scraper/resources/styles.rbs b/sig/x_twitter_scraper/resources/styles.rbs index 485c949..c36eb7d 100644 --- a/sig/x_twitter_scraper/resources/styles.rbs +++ b/sig/x_twitter_scraper/resources/styles.rbs @@ -2,30 +2,30 @@ module XTwitterScraper module Resources class Styles def retrieve: ( - String username, + String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::StyleRetrieveResponse + ) -> XTwitterScraper::StyleProfile def update: ( - String username, + String id, label: String, tweets: ::Array[XTwitterScraper::StyleUpdateParams::Tweet], ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::StyleUpdateResponse + ) -> XTwitterScraper::StyleProfile def list: ( ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::StyleListResponse def delete: ( - String username, + String id, ?request_options: XTwitterScraper::request_opts ) -> nil def analyze: ( username: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::StyleAnalyzeResponse + ) -> XTwitterScraper::StyleProfile def compare: ( username1: String, @@ -34,7 +34,7 @@ module XTwitterScraper ) -> XTwitterScraper::Models::StyleCompareResponse def get_performance: ( - String username, + String id, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::StyleGetPerformanceResponse diff --git a/sig/x_twitter_scraper/resources/webhooks.rbs b/sig/x_twitter_scraper/resources/webhooks.rbs index ca4f5af..d3fee34 100644 --- a/sig/x_twitter_scraper/resources/webhooks.rbs +++ b/sig/x_twitter_scraper/resources/webhooks.rbs @@ -2,18 +2,18 @@ module XTwitterScraper module Resources class Webhooks def create: ( - event_types: ::Array[XTwitterScraper::Models::WebhookCreateParams::event_type], + event_types: ::Array[XTwitterScraper::Models::event_type], url: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::WebhookCreateResponse def update: ( String id, - ?event_types: ::Array[XTwitterScraper::Models::WebhookUpdateParams::event_type], + ?event_types: ::Array[XTwitterScraper::Models::event_type], ?is_active: bool, ?url: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::WebhookUpdateResponse + ) -> XTwitterScraper::Webhook def list: ( ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/x.rbs b/sig/x_twitter_scraper/resources/x.rbs index 36f93bc..0051829 100644 --- a/sig/x_twitter_scraper/resources/x.rbs +++ b/sig/x_twitter_scraper/resources/x.rbs @@ -30,7 +30,7 @@ module XTwitterScraper ?cursor: String, ?seen_tweet_ids: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::XGetHomeTimelineResponse + ) -> XTwitterScraper::PaginatedTweets def get_notifications: ( ?cursor: String, @@ -38,7 +38,9 @@ module XTwitterScraper ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::XGetNotificationsResponse - def get_trends: (?request_options: XTwitterScraper::request_opts) -> nil + def get_trends: ( + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::XGetTrendsResponse def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/accounts.rbs b/sig/x_twitter_scraper/resources/x/accounts.rbs index 345aa03..715f3c1 100644 --- a/sig/x_twitter_scraper/resources/x/accounts.rbs +++ b/sig/x_twitter_scraper/resources/x/accounts.rbs @@ -14,7 +14,7 @@ module XTwitterScraper def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::AccountRetrieveResponse + ) -> XTwitterScraper::X::XAccountDetail def list: ( ?request_options: XTwitterScraper::request_opts @@ -25,6 +25,10 @@ module XTwitterScraper ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::AccountDeleteResponse + def bulk_retry: ( + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::X::AccountBulkRetryResponse + def reauth: ( String id, password: String, diff --git a/sig/x_twitter_scraper/resources/x/bookmarks.rbs b/sig/x_twitter_scraper/resources/x/bookmarks.rbs index 69439ff..c149e6b 100644 --- a/sig/x_twitter_scraper/resources/x/bookmarks.rbs +++ b/sig/x_twitter_scraper/resources/x/bookmarks.rbs @@ -6,7 +6,7 @@ module XTwitterScraper ?cursor: String, ?folder_id: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::BookmarkListResponse + ) -> XTwitterScraper::PaginatedTweets def retrieve_folders: ( ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/x/communities.rbs b/sig/x_twitter_scraper/resources/x/communities.rbs index f7026af..df450c4 100644 --- a/sig/x_twitter_scraper/resources/x/communities.rbs +++ b/sig/x_twitter_scraper/resources/x/communities.rbs @@ -29,20 +29,20 @@ module XTwitterScraper String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_moderators: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_search: ( q: String, ?cursor: String, ?query_type: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedTweets def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/communities/join.rbs b/sig/x_twitter_scraper/resources/x/communities/join.rbs index 924aea3..2d352fe 100644 --- a/sig/x_twitter_scraper/resources/x/communities/join.rbs +++ b/sig/x_twitter_scraper/resources/x/communities/join.rbs @@ -7,13 +7,13 @@ module XTwitterScraper String id, account: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::Communities::JoinCreateResponse + ) -> XTwitterScraper::X::CommunityActionResult def delete_all: ( String id, account: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse + ) -> XTwitterScraper::X::CommunityActionResult def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/communities/tweets.rbs b/sig/x_twitter_scraper/resources/x/communities/tweets.rbs index 1375db9..a733ccd 100644 --- a/sig/x_twitter_scraper/resources/x/communities/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/communities/tweets.rbs @@ -8,7 +8,13 @@ module XTwitterScraper ?cursor: String, ?query_type: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedTweets + + def list_by_community: ( + String id, + ?cursor: String, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::PaginatedTweets def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/lists.rbs b/sig/x_twitter_scraper/resources/x/lists.rbs index e69e37a..732d1ae 100644 --- a/sig/x_twitter_scraper/resources/x/lists.rbs +++ b/sig/x_twitter_scraper/resources/x/lists.rbs @@ -6,13 +6,13 @@ module XTwitterScraper String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_members: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_tweets: ( String id, @@ -21,7 +21,7 @@ module XTwitterScraper ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedTweets def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index 9cd68f8..c121db1 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -18,17 +18,17 @@ module XTwitterScraper ) -> XTwitterScraper::Models::X::TweetCreateResponse def retrieve: ( - String tweet_id, + String id, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::TweetRetrieveResponse def list: ( ids: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedTweets def delete: ( - String tweet_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::TweetDeleteResponse @@ -37,7 +37,7 @@ module XTwitterScraper String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetGetFavoritersResponse + ) -> XTwitterScraper::PaginatedUsers def get_quotes: ( String id, @@ -46,7 +46,7 @@ module XTwitterScraper ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetGetQuotesResponse + ) -> XTwitterScraper::PaginatedTweets def get_replies: ( String id, @@ -54,19 +54,19 @@ module XTwitterScraper ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetGetRepliesResponse + ) -> XTwitterScraper::PaginatedTweets def get_retweeters: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetGetRetweetersResponse + ) -> XTwitterScraper::PaginatedUsers def get_thread: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetGetThreadResponse + ) -> XTwitterScraper::PaginatedTweets def search: ( q: String, @@ -76,7 +76,7 @@ module XTwitterScraper ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::TweetSearchResponse + ) -> XTwitterScraper::PaginatedTweets def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/tweets/like.rbs b/sig/x_twitter_scraper/resources/x/tweets/like.rbs index 4b01300..386eba2 100644 --- a/sig/x_twitter_scraper/resources/x/tweets/like.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets/like.rbs @@ -4,13 +4,13 @@ module XTwitterScraper class Tweets class Like def create: ( - String tweet_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::LikeCreateResponse def delete: ( - String tweet_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::LikeDeleteResponse diff --git a/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs b/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs index ae70e7d..a6023e2 100644 --- a/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs @@ -4,13 +4,13 @@ module XTwitterScraper class Tweets class Retweet def create: ( - String tweet_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::RetweetCreateResponse def delete: ( - String tweet_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse diff --git a/sig/x_twitter_scraper/resources/x/users.rbs b/sig/x_twitter_scraper/resources/x/users.rbs index 53396fb..9598320 100644 --- a/sig/x_twitter_scraper/resources/x/users.rbs +++ b/sig/x_twitter_scraper/resources/x/users.rbs @@ -5,46 +5,46 @@ module XTwitterScraper attr_reader follow: XTwitterScraper::Resources::X::Users::Follow def retrieve: ( - String username, + String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::UserRetrieveResponse + ) -> XTwitterScraper::X::UserProfile def retrieve_batch: ( ids: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_followers: ( String id, ?cursor: String, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_followers_you_know: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse + ) -> XTwitterScraper::PaginatedUsers def retrieve_following: ( String id, ?cursor: String, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_likes: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::UserRetrieveLikesResponse + ) -> XTwitterScraper::PaginatedTweets def retrieve_media: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::UserRetrieveMediaResponse + ) -> XTwitterScraper::PaginatedTweets def retrieve_mentions: ( String id, @@ -52,13 +52,13 @@ module XTwitterScraper ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedTweets def retrieve_search: ( q: String, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def retrieve_tweets: ( String id, @@ -66,13 +66,13 @@ module XTwitterScraper ?include_parent_tweet: bool, ?include_replies: bool, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::X::UserRetrieveTweetsResponse + ) -> XTwitterScraper::PaginatedTweets def retrieve_verified_followers: ( String id, ?cursor: String, ?request_options: XTwitterScraper::request_opts - ) -> nil + ) -> XTwitterScraper::PaginatedUsers def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/sig/x_twitter_scraper/resources/x/users/follow.rbs b/sig/x_twitter_scraper/resources/x/users/follow.rbs index 97be5e3..02b26cf 100644 --- a/sig/x_twitter_scraper/resources/x/users/follow.rbs +++ b/sig/x_twitter_scraper/resources/x/users/follow.rbs @@ -4,13 +4,13 @@ module XTwitterScraper class Users class Follow def create: ( - String user_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Users::FollowCreateResponse def delete_all: ( - String user_id, + String id, account: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Users::FollowDeleteAllResponse diff --git a/test/x_twitter_scraper/resources/account_test.rb b/test/x_twitter_scraper/resources/account_test.rb index fdf8404..b0fda96 100644 --- a/test/x_twitter_scraper/resources/account_test.rb +++ b/test/x_twitter_scraper/resources/account_test.rb @@ -25,7 +25,7 @@ def test_retrieve def test_set_x_username_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.account.set_x_username(username: "username") + response = @x_twitter_scraper.account.set_x_username(username: "elonmusk") assert_pattern do response => XTwitterScraper::Models::AccountSetXUsernameResponse diff --git a/test/x_twitter_scraper/resources/api_keys_test.rb b/test/x_twitter_scraper/resources/api_keys_test.rb index 9dc2c42..c983ead 100644 --- a/test/x_twitter_scraper/resources/api_keys_test.rb +++ b/test/x_twitter_scraper/resources/api_keys_test.rb @@ -34,7 +34,7 @@ def test_list assert_pattern do response => { - keys: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::APIKeyListResponse::Key]) + keys: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::APIKey]) } end end diff --git a/test/x_twitter_scraper/resources/credits_test.rb b/test/x_twitter_scraper/resources/credits_test.rb index 14a755c..fc09e8f 100644 --- a/test/x_twitter_scraper/resources/credits_test.rb +++ b/test/x_twitter_scraper/resources/credits_test.rb @@ -25,7 +25,7 @@ def test_retrieve_balance def test_topup_balance_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.credits.topup_balance(amount: 0) + response = @x_twitter_scraper.credits.topup_balance(amount: 10_000) assert_pattern do response => XTwitterScraper::Models::CreditTopupBalanceResponse diff --git a/test/x_twitter_scraper/resources/drafts_test.rb b/test/x_twitter_scraper/resources/drafts_test.rb index 461dfd9..d6a6a75 100644 --- a/test/x_twitter_scraper/resources/drafts_test.rb +++ b/test/x_twitter_scraper/resources/drafts_test.rb @@ -6,10 +6,10 @@ class XTwitterScraper::Test::Resources::DraftsTest < XTwitterScraper::Test::Reso def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.drafts.create(text: "text") + response = @x_twitter_scraper.drafts.create(text: "AI is the future of productivity") assert_pattern do - response => XTwitterScraper::Models::DraftCreateResponse + response => XTwitterScraper::DraftDetail end assert_pattern do @@ -30,7 +30,7 @@ def test_retrieve response = @x_twitter_scraper.drafts.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::DraftRetrieveResponse + response => XTwitterScraper::DraftDetail end assert_pattern do @@ -56,7 +56,7 @@ def test_list assert_pattern do response => { - drafts: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DraftListResponse::Draft]), + drafts: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Draft]), has_more: XTwitterScraper::Internal::Type::Boolean, next_cursor: String | nil } diff --git a/test/x_twitter_scraper/resources/draws_test.rb b/test/x_twitter_scraper/resources/draws_test.rb index 4822508..8fa2c40 100644 --- a/test/x_twitter_scraper/resources/draws_test.rb +++ b/test/x_twitter_scraper/resources/draws_test.rb @@ -14,8 +14,8 @@ def test_retrieve assert_pattern do response => { - draw: XTwitterScraper::Models::DrawRetrieveResponse::Draw, - winners: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawRetrieveResponse::Winner]) + draw: XTwitterScraper::DrawDetail, + winners: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Winner]) } end end @@ -31,7 +31,7 @@ def test_list assert_pattern do response => { - draws: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawListResponse::Draw]), + draws: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::DrawListItem]), has_more: XTwitterScraper::Internal::Type::Boolean, next_cursor: String | nil } @@ -51,7 +51,7 @@ def test_export def test_run_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.draws.run(tweet_url: "https://example.com") + response = @x_twitter_scraper.draws.run(tweet_url: "https://x.com/elonmusk/status/1234567890") assert_pattern do response => XTwitterScraper::Models::DrawRunResponse @@ -63,7 +63,7 @@ def test_run_required_params total_entries: Integer, tweet_id: String, valid_entries: Integer, - winners: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::DrawRunResponse::Winner]) + winners: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Winner]) } end end diff --git a/test/x_twitter_scraper/resources/events_test.rb b/test/x_twitter_scraper/resources/events_test.rb index d12df52..34eebc8 100644 --- a/test/x_twitter_scraper/resources/events_test.rb +++ b/test/x_twitter_scraper/resources/events_test.rb @@ -9,7 +9,7 @@ def test_retrieve response = @x_twitter_scraper.events.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::EventRetrieveResponse + response => XTwitterScraper::EventDetail end assert_pattern do @@ -18,7 +18,7 @@ def test_retrieve data: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), monitor_id: String, occurred_at: Time, - type: XTwitterScraper::Models::EventRetrieveResponse::Type, + type: XTwitterScraper::EventType, username: String, x_event_id: String | nil } @@ -36,7 +36,7 @@ def test_list assert_pattern do response => { - events: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::EventListResponse::Event]), + events: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Event]), has_more: XTwitterScraper::Internal::Type::Boolean, next_cursor: String | nil } diff --git a/test/x_twitter_scraper/resources/extractions_test.rb b/test/x_twitter_scraper/resources/extractions_test.rb index 896568f..1d902d4 100644 --- a/test/x_twitter_scraper/resources/extractions_test.rb +++ b/test/x_twitter_scraper/resources/extractions_test.rb @@ -33,7 +33,7 @@ def test_list assert_pattern do response => { - extractions: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::ExtractionListResponse::Extraction]), + extractions: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::ExtractionJob]), has_more: XTwitterScraper::Internal::Type::Boolean, next_cursor: String | nil } @@ -43,7 +43,7 @@ def test_list def test_estimate_cost_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.extractions.estimate_cost(tool_type: :article_extractor) + response = @x_twitter_scraper.extractions.estimate_cost(tool_type: :follower_explorer) assert_pattern do response => XTwitterScraper::Models::ExtractionEstimateCostResponse @@ -73,7 +73,7 @@ def test_export_results def test_run_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.extractions.run(tool_type: :article_extractor) + response = @x_twitter_scraper.extractions.run(tool_type: :follower_explorer) assert_pattern do response => XTwitterScraper::Models::ExtractionRunResponse @@ -82,7 +82,7 @@ def test_run_required_params assert_pattern do response => { id: String, - status: XTwitterScraper::Models::ExtractionRunResponse::Status, + status: Symbol, tool_type: XTwitterScraper::Models::ExtractionRunResponse::ToolType } end diff --git a/test/x_twitter_scraper/resources/integrations_test.rb b/test/x_twitter_scraper/resources/integrations_test.rb index 500b4b6..537bf30 100644 --- a/test/x_twitter_scraper/resources/integrations_test.rb +++ b/test/x_twitter_scraper/resources/integrations_test.rb @@ -8,14 +8,14 @@ def test_create_required_params response = @x_twitter_scraper.integrations.create( - config: {chatId: "chatId"}, - event_types: [:"tweet.new"], - name: "name", + config: {chatId: "-1001234567890"}, + event_types: [:"tweet.new", :"follower.gained"], + name: "My Telegram Bot", type: :telegram ) assert_pattern do - response => XTwitterScraper::Models::IntegrationCreateResponse + response => XTwitterScraper::Integration end assert_pattern do @@ -23,10 +23,10 @@ def test_create_required_params id: String, config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationCreateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, name: String, - type: XTwitterScraper::Models::IntegrationCreateResponse::Type, + type: Symbol, filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, message_template: String | nil, scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, @@ -41,7 +41,7 @@ def test_retrieve response = @x_twitter_scraper.integrations.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::IntegrationRetrieveResponse + response => XTwitterScraper::Integration end assert_pattern do @@ -49,10 +49,10 @@ def test_retrieve id: String, config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationRetrieveResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, name: String, - type: XTwitterScraper::Models::IntegrationRetrieveResponse::Type, + type: Symbol, filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, message_template: String | nil, scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, @@ -67,7 +67,7 @@ def test_update response = @x_twitter_scraper.integrations.update("id") assert_pattern do - response => XTwitterScraper::Models::IntegrationUpdateResponse + response => XTwitterScraper::Integration end assert_pattern do @@ -75,10 +75,10 @@ def test_update id: String, config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::IntegrationUpdateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, name: String, - type: XTwitterScraper::Models::IntegrationUpdateResponse::Type, + type: Symbol, filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, message_template: String | nil, scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, @@ -98,7 +98,7 @@ def test_list assert_pattern do response => { - integrations: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::IntegrationListResponse::Integration]) + integrations: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Integration]) } end end @@ -130,7 +130,7 @@ def test_list_deliveries assert_pattern do response => { - deliveries: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::IntegrationListDeliveriesResponse::Delivery]) + deliveries: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::IntegrationDelivery]) } end end diff --git a/test/x_twitter_scraper/resources/monitors_test.rb b/test/x_twitter_scraper/resources/monitors_test.rb index 5f7ebde..1b1f0d4 100644 --- a/test/x_twitter_scraper/resources/monitors_test.rb +++ b/test/x_twitter_scraper/resources/monitors_test.rb @@ -6,7 +6,11 @@ class XTwitterScraper::Test::Resources::MonitorsTest < XTwitterScraper::Test::Re def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.monitors.create(event_types: [:"tweet.new"], username: "username") + response = + @x_twitter_scraper.monitors.create( + event_types: [:"tweet.new", :"follower.gained"], + username: "elonmusk" + ) assert_pattern do response => XTwitterScraper::Models::MonitorCreateResponse @@ -16,7 +20,7 @@ def test_create_required_params response => { id: String, created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorCreateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), username: String, x_user_id: String } @@ -29,14 +33,14 @@ def test_retrieve response = @x_twitter_scraper.monitors.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::MonitorRetrieveResponse + response => XTwitterScraper::Monitor end assert_pattern do response => { id: String, created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorRetrieveResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, username: String, x_user_id: String @@ -50,14 +54,14 @@ def test_update response = @x_twitter_scraper.monitors.update("id") assert_pattern do - response => XTwitterScraper::Models::MonitorUpdateResponse + response => XTwitterScraper::Monitor end assert_pattern do response => { id: String, created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::MonitorUpdateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, username: String, x_user_id: String @@ -76,7 +80,7 @@ def test_list assert_pattern do response => { - monitors: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::MonitorListResponse::Monitor]), + monitors: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Monitor]), total: Integer } end diff --git a/test/x_twitter_scraper/resources/radar_test.rb b/test/x_twitter_scraper/resources/radar_test.rb index de9811a..9de3944 100644 --- a/test/x_twitter_scraper/resources/radar_test.rb +++ b/test/x_twitter_scraper/resources/radar_test.rb @@ -14,7 +14,7 @@ def test_retrieve_trending_topics assert_pattern do response => { - items: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse::Item]), + items: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::RadarItem]), total: Integer } end diff --git a/test/x_twitter_scraper/resources/styles_test.rb b/test/x_twitter_scraper/resources/styles_test.rb index 1df6447..db12dfb 100644 --- a/test/x_twitter_scraper/resources/styles_test.rb +++ b/test/x_twitter_scraper/resources/styles_test.rb @@ -6,10 +6,10 @@ class XTwitterScraper::Test::Resources::StylesTest < XTwitterScraper::Test::Reso def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.styles.retrieve("username") + response = @x_twitter_scraper.styles.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::StyleRetrieveResponse + response => XTwitterScraper::StyleProfile end assert_pattern do @@ -17,7 +17,7 @@ def test_retrieve fetched_at: Time, is_own_account: XTwitterScraper::Internal::Type::Boolean, tweet_count: Integer, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleRetrieveResponse::Tweet]), + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleProfile::Tweet]), x_username: String } end @@ -26,10 +26,15 @@ def test_retrieve def test_update_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.styles.update("username", label: "label", tweets: [{text: "text"}]) + response = + @x_twitter_scraper.styles.update( + "id", + label: "Professional Voice", + tweets: [{text: "Excited to share our latest research findings."}] + ) assert_pattern do - response => XTwitterScraper::Models::StyleUpdateResponse + response => XTwitterScraper::StyleProfile end assert_pattern do @@ -37,7 +42,7 @@ def test_update_required_params fetched_at: Time, is_own_account: XTwitterScraper::Internal::Type::Boolean, tweet_count: Integer, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleUpdateResponse::Tweet]), + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleProfile::Tweet]), x_username: String } end @@ -54,7 +59,7 @@ def test_list assert_pattern do response => { - styles: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleListResponse::Style]) + styles: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleProfileSummary]) } end end @@ -62,7 +67,7 @@ def test_list def test_delete skip("Mock server tests are disabled") - response = @x_twitter_scraper.styles.delete("username") + response = @x_twitter_scraper.styles.delete("id") assert_pattern do response => nil @@ -72,10 +77,10 @@ def test_delete def test_analyze_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.styles.analyze(username: "username") + response = @x_twitter_scraper.styles.analyze(username: "elonmusk") assert_pattern do - response => XTwitterScraper::Models::StyleAnalyzeResponse + response => XTwitterScraper::StyleProfile end assert_pattern do @@ -83,7 +88,7 @@ def test_analyze_required_params fetched_at: Time, is_own_account: XTwitterScraper::Internal::Type::Boolean, tweet_count: Integer, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::StyleAnalyzeResponse::Tweet]), + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::StyleProfile::Tweet]), x_username: String } end @@ -100,8 +105,8 @@ def test_compare_required_params assert_pattern do response => { - style1: XTwitterScraper::Models::StyleCompareResponse::Style1, - style2: XTwitterScraper::Models::StyleCompareResponse::Style2 + style1: XTwitterScraper::StyleProfile, + style2: XTwitterScraper::StyleProfile } end end @@ -109,7 +114,7 @@ def test_compare_required_params def test_get_performance skip("Mock server tests are disabled") - response = @x_twitter_scraper.styles.get_performance("username") + response = @x_twitter_scraper.styles.get_performance("id") assert_pattern do response => XTwitterScraper::Models::StyleGetPerformanceResponse diff --git a/test/x_twitter_scraper/resources/support/tickets_test.rb b/test/x_twitter_scraper/resources/support/tickets_test.rb index 9eb4710..9b0eb70 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -6,7 +6,11 @@ class XTwitterScraper::Test::Resources::Support::TicketsTest < XTwitterScraper:: def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.create(body: "body", subject: "subject") + response = + @x_twitter_scraper.support.tickets.create( + body: "I am unable to connect my X account. Please help.", + subject: "Cannot connect X account" + ) assert_pattern do response => XTwitterScraper::Models::Support::TicketCreateResponse @@ -22,7 +26,7 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.retrieve("id") + response = @x_twitter_scraper.support.tickets.retrieve("messages_value") assert_pattern do response => XTwitterScraper::Models::Support::TicketRetrieveResponse @@ -43,7 +47,7 @@ def test_retrieve def test_update_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.update("id", status: :open) + response = @x_twitter_scraper.support.tickets.update("id", status: :resolved) assert_pattern do response => XTwitterScraper::Models::Support::TicketUpdateResponse @@ -76,7 +80,7 @@ def test_list def test_reply_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.reply("id", body: "body") + response = @x_twitter_scraper.support.tickets.reply("id", body: "Thank you for the update.") assert_pattern do response => XTwitterScraper::Models::Support::TicketReplyResponse diff --git a/test/x_twitter_scraper/resources/webhooks_test.rb b/test/x_twitter_scraper/resources/webhooks_test.rb index 60cff4b..9c9653a 100644 --- a/test/x_twitter_scraper/resources/webhooks_test.rb +++ b/test/x_twitter_scraper/resources/webhooks_test.rb @@ -6,7 +6,11 @@ class XTwitterScraper::Test::Resources::WebhooksTest < XTwitterScraper::Test::Re def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.webhooks.create(event_types: [:"tweet.new"], url: "https://example.com") + response = + @x_twitter_scraper.webhooks.create( + event_types: [:"tweet.new", :"follower.gained"], + url: "https://example.com/webhook" + ) assert_pattern do response => XTwitterScraper::Models::WebhookCreateResponse @@ -16,7 +20,7 @@ def test_create_required_params response => { id: String, created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::WebhookCreateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), secret: String, url: String } @@ -29,14 +33,14 @@ def test_update response = @x_twitter_scraper.webhooks.update("id") assert_pattern do - response => XTwitterScraper::Models::WebhookUpdateResponse + response => XTwitterScraper::Webhook end assert_pattern do response => { id: String, created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::Models::WebhookUpdateResponse::EventType]), + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, url: String } @@ -54,7 +58,7 @@ def test_list assert_pattern do response => { - webhooks: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::WebhookListResponse::Webhook]) + webhooks: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Webhook]) } end end @@ -86,7 +90,7 @@ def test_list_deliveries assert_pattern do response => { - deliveries: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::WebhookListDeliveriesResponse::Delivery]) + deliveries: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Delivery]) } end end diff --git a/test/x_twitter_scraper/resources/x/accounts_test.rb b/test/x_twitter_scraper/resources/x/accounts_test.rb index d23c75f..820e1b7 100644 --- a/test/x_twitter_scraper/resources/x/accounts_test.rb +++ b/test/x_twitter_scraper/resources/x/accounts_test.rb @@ -7,7 +7,11 @@ def test_create_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.accounts.create(email: "email", password: "password", username: "username") + @x_twitter_scraper.x.accounts.create( + email: "user@example.com", + password: "s3cur3Pa$$w0rd", + username: "elonmusk" + ) assert_pattern do response => XTwitterScraper::Models::X::AccountCreateResponse @@ -29,7 +33,7 @@ def test_retrieve response = @x_twitter_scraper.x.accounts.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::X::AccountRetrieveResponse + response => XTwitterScraper::X::XAccountDetail end assert_pattern do @@ -57,7 +61,7 @@ def test_list assert_pattern do response => { - accounts: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::AccountListResponse::Account]) + accounts: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::XAccount]) } end end @@ -78,10 +82,26 @@ def test_delete end end + def test_bulk_retry + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.accounts.bulk_retry + + assert_pattern do + response => XTwitterScraper::Models::X::AccountBulkRetryResponse + end + + assert_pattern do + response => { + cleared: Integer + } + end + end + def test_reauth_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.accounts.reauth("id", password: "password") + response = @x_twitter_scraper.x.accounts.reauth("id", password: "password_value") assert_pattern do response => XTwitterScraper::Models::X::AccountReauthResponse diff --git a/test/x_twitter_scraper/resources/x/bookmarks_test.rb b/test/x_twitter_scraper/resources/x/bookmarks_test.rb index 1d3f8fe..007889d 100644 --- a/test/x_twitter_scraper/resources/x/bookmarks_test.rb +++ b/test/x_twitter_scraper/resources/x/bookmarks_test.rb @@ -9,14 +9,14 @@ def test_list response = @x_twitter_scraper.x.bookmarks.list assert_pattern do - response => XTwitterScraper::Models::X::BookmarkListResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::BookmarkListResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/resources/x/communities/join_test.rb b/test/x_twitter_scraper/resources/x/communities/join_test.rb index d7a9701..9079ef1 100644 --- a/test/x_twitter_scraper/resources/x/communities/join_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/join_test.rb @@ -6,10 +6,10 @@ class XTwitterScraper::Test::Resources::X::Communities::JoinTest < XTwitterScrap def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.communities.join.create("id", account: "account") + response = @x_twitter_scraper.x.communities.join.create("id", account: "@elonmusk") assert_pattern do - response => XTwitterScraper::Models::X::Communities::JoinCreateResponse + response => XTwitterScraper::X::CommunityActionResult end assert_pattern do @@ -24,10 +24,10 @@ def test_create_required_params def test_delete_all_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.communities.join.delete_all("id", account: "account") + response = @x_twitter_scraper.x.communities.join.delete_all("id", account: "@elonmusk") assert_pattern do - response => XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse + response => XTwitterScraper::X::CommunityActionResult end assert_pattern do diff --git a/test/x_twitter_scraper/resources/x/communities/tweets_test.rb b/test/x_twitter_scraper/resources/x/communities/tweets_test.rb index 3e7d399..2f4119f 100644 --- a/test/x_twitter_scraper/resources/x/communities/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/tweets_test.rb @@ -9,7 +9,33 @@ def test_list_required_params response = @x_twitter_scraper.x.communities.tweets.list(q: "q") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } + end + end + + def test_list_by_community + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.communities.tweets.list_by_community("id") + + assert_pattern do + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } end end end diff --git a/test/x_twitter_scraper/resources/x/communities_test.rb b/test/x_twitter_scraper/resources/x/communities_test.rb index db23902..781deb5 100644 --- a/test/x_twitter_scraper/resources/x/communities_test.rb +++ b/test/x_twitter_scraper/resources/x/communities_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::CommunitiesTest < XTwitterScraper::Te def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.communities.create(account: "account", name: "name") + response = @x_twitter_scraper.x.communities.create(account: "@elonmusk", name: "Example Name") assert_pattern do response => XTwitterScraper::Models::X::CommunityCreateResponse @@ -25,7 +25,7 @@ def test_delete_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.communities.delete("id", account: "account", community_name: "community_name") + @x_twitter_scraper.x.communities.delete("id", account: "@elonmusk", community_name: "Tesla Fans") assert_pattern do response => XTwitterScraper::Models::X::CommunityDeleteResponse @@ -60,7 +60,15 @@ def test_retrieve_members response = @x_twitter_scraper.x.communities.retrieve_members("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -70,7 +78,15 @@ def test_retrieve_moderators response = @x_twitter_scraper.x.communities.retrieve_moderators("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -80,7 +96,15 @@ def test_retrieve_search_required_params response = @x_twitter_scraper.x.communities.retrieve_search(q: "q") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } end end end diff --git a/test/x_twitter_scraper/resources/x/dm_test.rb b/test/x_twitter_scraper/resources/x/dm_test.rb index f6c5abd..c96e80f 100644 --- a/test/x_twitter_scraper/resources/x/dm_test.rb +++ b/test/x_twitter_scraper/resources/x/dm_test.rb @@ -24,7 +24,7 @@ def test_retrieve_history def test_send__required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.dm.send_("userId", account: "account", text: "text") + response = @x_twitter_scraper.x.dm.send_("userId", account: "@elonmusk", text: "Example text content") assert_pattern do response => XTwitterScraper::Models::X::DmSendResponse diff --git a/test/x_twitter_scraper/resources/x/lists_test.rb b/test/x_twitter_scraper/resources/x/lists_test.rb index 242a9ce..d3fe4b2 100644 --- a/test/x_twitter_scraper/resources/x/lists_test.rb +++ b/test/x_twitter_scraper/resources/x/lists_test.rb @@ -9,7 +9,15 @@ def test_retrieve_followers response = @x_twitter_scraper.x.lists.retrieve_followers("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -19,7 +27,15 @@ def test_retrieve_members response = @x_twitter_scraper.x.lists.retrieve_members("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -29,7 +45,15 @@ def test_retrieve_tweets response = @x_twitter_scraper.x.lists.retrieve_tweets("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } end end end diff --git a/test/x_twitter_scraper/resources/x/media_test.rb b/test/x_twitter_scraper/resources/x/media_test.rb index 18a2b4e..3b869e0 100644 --- a/test/x_twitter_scraper/resources/x/media_test.rb +++ b/test/x_twitter_scraper/resources/x/media_test.rb @@ -26,7 +26,7 @@ def test_download def test_upload_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.media.upload(account: "account", file: StringIO.new("Example data")) + response = @x_twitter_scraper.x.media.upload(account: "@elonmusk", file: StringIO.new("Example data")) assert_pattern do response => XTwitterScraper::Models::X::MediaUploadResponse diff --git a/test/x_twitter_scraper/resources/x/profile_test.rb b/test/x_twitter_scraper/resources/x/profile_test.rb index b3d3189..8937827 100644 --- a/test/x_twitter_scraper/resources/x/profile_test.rb +++ b/test/x_twitter_scraper/resources/x/profile_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::ProfileTest < XTwitterScraper::Test:: def test_update_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.profile.update(account: "account") + response = @x_twitter_scraper.x.profile.update(account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateResponse @@ -23,7 +23,7 @@ def test_update_avatar_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.profile.update_avatar(account: "account", file: StringIO.new("Example data")) + @x_twitter_scraper.x.profile.update_avatar(account: "@elonmusk", file: StringIO.new("Example data")) assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateAvatarResponse @@ -40,7 +40,7 @@ def test_update_banner_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.profile.update_banner(account: "account", file: StringIO.new("Example data")) + @x_twitter_scraper.x.profile.update_banner(account: "@elonmusk", file: StringIO.new("Example data")) assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateBannerResponse diff --git a/test/x_twitter_scraper/resources/x/tweets/like_test.rb b/test/x_twitter_scraper/resources/x/tweets/like_test.rb index 57eca4c..4a72bb0 100644 --- a/test/x_twitter_scraper/resources/x/tweets/like_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets/like_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::Tweets::LikeTest < XTwitterScraper::T def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.like.create("tweetId", account: "account") + response = @x_twitter_scraper.x.tweets.like.create("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Tweets::LikeCreateResponse @@ -22,7 +22,7 @@ def test_create_required_params def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.like.delete("tweetId", account: "account") + response = @x_twitter_scraper.x.tweets.like.delete("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Tweets::LikeDeleteResponse diff --git a/test/x_twitter_scraper/resources/x/tweets/retweet_test.rb b/test/x_twitter_scraper/resources/x/tweets/retweet_test.rb index b235edb..a88e098 100644 --- a/test/x_twitter_scraper/resources/x/tweets/retweet_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets/retweet_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::Tweets::RetweetTest < XTwitterScraper def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.retweet.create("tweetId", account: "account") + response = @x_twitter_scraper.x.tweets.retweet.create("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Tweets::RetweetCreateResponse @@ -22,7 +22,7 @@ def test_create_required_params def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.retweet.delete("tweetId", account: "account") + response = @x_twitter_scraper.x.tweets.retweet.delete("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse diff --git a/test/x_twitter_scraper/resources/x/tweets_test.rb b/test/x_twitter_scraper/resources/x/tweets_test.rb index 276d134..ec69d9e 100644 --- a/test/x_twitter_scraper/resources/x/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets_test.rb @@ -6,7 +6,8 @@ class XTwitterScraper::Test::Resources::X::TweetsTest < XTwitterScraper::Test::R def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.create(account: "account", text: "text") + response = + @x_twitter_scraper.x.tweets.create(account: "@elonmusk", text: "Just launched our new feature!") assert_pattern do response => XTwitterScraper::Models::X::TweetCreateResponse @@ -23,7 +24,7 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.retrieve("tweetId") + response = @x_twitter_scraper.x.tweets.retrieve("id") assert_pattern do response => XTwitterScraper::Models::X::TweetRetrieveResponse @@ -31,8 +32,8 @@ def test_retrieve assert_pattern do response => { - tweet: XTwitterScraper::Models::X::TweetRetrieveResponse::Tweet, - author: XTwitterScraper::Models::X::TweetRetrieveResponse::Author | nil + tweet: XTwitterScraper::X::TweetDetail, + author: XTwitterScraper::X::TweetAuthor | nil } end end @@ -43,14 +44,22 @@ def test_list_required_params response = @x_twitter_scraper.x.tweets.list(ids: "ids") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } end end def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.delete("tweetId", account: "account") + response = @x_twitter_scraper.x.tweets.delete("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::TweetDeleteResponse @@ -69,14 +78,14 @@ def test_get_favoriters response = @x_twitter_scraper.x.tweets.get_favoriters("id") assert_pattern do - response => XTwitterScraper::Models::X::TweetGetFavoritersResponse + response => XTwitterScraper::PaginatedUsers end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetFavoritersResponse::User]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) } end end @@ -87,14 +96,14 @@ def test_get_quotes response = @x_twitter_scraper.x.tweets.get_quotes("id") assert_pattern do - response => XTwitterScraper::Models::X::TweetGetQuotesResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetQuotesResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -105,14 +114,14 @@ def test_get_replies response = @x_twitter_scraper.x.tweets.get_replies("id") assert_pattern do - response => XTwitterScraper::Models::X::TweetGetRepliesResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetRepliesResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -123,14 +132,14 @@ def test_get_retweeters response = @x_twitter_scraper.x.tweets.get_retweeters("id") assert_pattern do - response => XTwitterScraper::Models::X::TweetGetRetweetersResponse + response => XTwitterScraper::PaginatedUsers end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetRetweetersResponse::User]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) } end end @@ -141,14 +150,14 @@ def test_get_thread response = @x_twitter_scraper.x.tweets.get_thread("id") assert_pattern do - response => XTwitterScraper::Models::X::TweetGetThreadResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetThreadResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -159,14 +168,14 @@ def test_search_required_params response = @x_twitter_scraper.x.tweets.search(q: "q") assert_pattern do - response => XTwitterScraper::Models::X::TweetSearchResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetSearchResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/resources/x/users/follow_test.rb b/test/x_twitter_scraper/resources/x/users/follow_test.rb index 3ae9cb9..455457d 100644 --- a/test/x_twitter_scraper/resources/x/users/follow_test.rb +++ b/test/x_twitter_scraper/resources/x/users/follow_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::Users::FollowTest < XTwitterScraper:: def test_create_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.users.follow.create("userId", account: "account") + response = @x_twitter_scraper.x.users.follow.create("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Users::FollowCreateResponse @@ -22,7 +22,7 @@ def test_create_required_params def test_delete_all_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.users.follow.delete_all("userId", account: "account") + response = @x_twitter_scraper.x.users.follow.delete_all("id", account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::Users::FollowDeleteAllResponse diff --git a/test/x_twitter_scraper/resources/x/users_test.rb b/test/x_twitter_scraper/resources/x/users_test.rb index dbfb451..9dcf152 100644 --- a/test/x_twitter_scraper/resources/x/users_test.rb +++ b/test/x_twitter_scraper/resources/x/users_test.rb @@ -6,10 +6,10 @@ class XTwitterScraper::Test::Resources::X::UsersTest < XTwitterScraper::Test::Re def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.users.retrieve("username") + response = @x_twitter_scraper.x.users.retrieve("id") assert_pattern do - response => XTwitterScraper::Models::X::UserRetrieveResponse + response => XTwitterScraper::X::UserProfile end assert_pattern do @@ -35,7 +35,15 @@ def test_retrieve_batch_required_params response = @x_twitter_scraper.x.users.retrieve_batch(ids: "ids") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -45,7 +53,15 @@ def test_retrieve_followers response = @x_twitter_scraper.x.users.retrieve_followers("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -55,14 +71,14 @@ def test_retrieve_followers_you_know response = @x_twitter_scraper.x.users.retrieve_followers_you_know("id") assert_pattern do - response => XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse + response => XTwitterScraper::PaginatedUsers end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowResponse::User]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) } end end @@ -73,7 +89,15 @@ def test_retrieve_following response = @x_twitter_scraper.x.users.retrieve_following("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -83,14 +107,14 @@ def test_retrieve_likes response = @x_twitter_scraper.x.users.retrieve_likes("id") assert_pattern do - response => XTwitterScraper::Models::X::UserRetrieveLikesResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveLikesResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -101,14 +125,14 @@ def test_retrieve_media response = @x_twitter_scraper.x.users.retrieve_media("id") assert_pattern do - response => XTwitterScraper::Models::X::UserRetrieveMediaResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveMediaResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -119,7 +143,15 @@ def test_retrieve_mentions response = @x_twitter_scraper.x.users.retrieve_mentions("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedTweets + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + } end end @@ -129,7 +161,15 @@ def test_retrieve_search_required_params response = @x_twitter_scraper.x.users.retrieve_search(q: "q") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end @@ -139,14 +179,14 @@ def test_retrieve_tweets response = @x_twitter_scraper.x.users.retrieve_tweets("id") assert_pattern do - response => XTwitterScraper::Models::X::UserRetrieveTweetsResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::UserRetrieveTweetsResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -157,7 +197,15 @@ def test_retrieve_verified_followers response = @x_twitter_scraper.x.users.retrieve_verified_followers("id") assert_pattern do - response => nil + response => XTwitterScraper::PaginatedUsers + end + + assert_pattern do + response => { + has_next_page: XTwitterScraper::Internal::Type::Boolean, + next_cursor: String, + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + } end end end diff --git a/test/x_twitter_scraper/resources/x_test.rb b/test/x_twitter_scraper/resources/x_test.rb index 071c6e8..95b739a 100644 --- a/test/x_twitter_scraper/resources/x_test.rb +++ b/test/x_twitter_scraper/resources/x_test.rb @@ -15,7 +15,7 @@ def test_get_article assert_pattern do response => { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::Models::XGetArticleResponse::Author | nil + author: XTwitterScraper::X::TweetAuthor | nil } end end @@ -26,14 +26,14 @@ def test_get_home_timeline response = @x_twitter_scraper.x.get_home_timeline assert_pattern do - response => XTwitterScraper::Models::XGetHomeTimelineResponse + response => XTwitterScraper::PaginatedTweets end assert_pattern do response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::XGetHomeTimelineResponse::Tweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) } end end @@ -62,7 +62,15 @@ def test_get_trends response = @x_twitter_scraper.x.get_trends assert_pattern do - response => nil + response => XTwitterScraper::Models::XGetTrendsResponse + end + + assert_pattern do + response => { + count: Integer, + trends: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::XGetTrendsResponse::Trend]), + woeid: Integer + } end end end