From e34eb97fd5050d959d843a1e2f4d1b924f29b142 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 20:36:06 +0000 Subject: [PATCH 01/12] chore: sync repo --- .github/FUNDING.yml | 1 - .github/workflows/context7-refresh.yml | 77 -------- .github/workflows/publish-gem.yml | 35 ---- .github/workflows/release-doctor.yml | 22 --- .gitignore | 32 --- .release-please-manifest.json | 3 - .stats.yml | 8 +- CHANGELOG.md | 8 - CODE_OF_CONDUCT.md | 85 -------- CONTRIBUTING.md | 4 +- README.md | 32 +-- bin/check-release-environment | 21 -- context7.json | 37 ---- lib/x_twitter_scraper.rb | 20 +- lib/x_twitter_scraper/client.rb | 50 ++--- .../internal/transport/base_client.rb | 27 +-- lib/x_twitter_scraper/internal/util.rb | 4 +- lib/x_twitter_scraper/models.rb | 22 +-- .../models/account_retrieve_response.rb | 61 +++--- lib/x_twitter_scraper/models/error.rb | 5 +- lib/x_twitter_scraper/models/event_detail.rb | 4 +- lib/x_twitter_scraper/models/event_type.rb | 2 - .../extraction_estimate_cost_response.rb | 28 +-- .../models/extraction_retrieve_response.rb | 4 +- lib/x_twitter_scraper/models/integration.rb | 93 --------- .../models/integration_create_params.rb | 58 ------ .../models/integration_delete_params.rb | 20 -- .../models/integration_delete_response.rb | 16 -- .../models/integration_delivery.rb | 71 ------- .../integration_list_deliveries_params.rb | 29 --- .../integration_list_deliveries_response.rb | 17 -- .../models/integration_list_params.rb | 14 -- .../models/integration_list_response.rb | 16 -- .../models/integration_retrieve_params.rb | 20 -- .../models/integration_send_test_params.rb | 20 -- .../models/integration_send_test_response.rb | 16 -- .../models/integration_update_params.rb | 77 -------- .../models/paginated_tweets.rb | 6 +- .../models/paginated_users.rb | 6 +- lib/x_twitter_scraper/models/radar_item.rb | 105 +++++++++- .../radar_retrieve_trending_topics_params.rb | 49 +++-- ...radar_retrieve_trending_topics_response.rb | 19 +- lib/x_twitter_scraper/models/search_tweet.rb | 117 +++++++++++ .../models/trend_list_params.rb | 11 +- lib/x_twitter_scraper/models/user_profile.rb | 77 ++++++++ .../models/x/account_create_response.rb | 53 ++++- .../models/x/account_reauth_params.rb | 18 +- .../models/x/account_reauth_response.rb | 59 +++++- .../x/community_retrieve_members_params.rb | 10 +- .../models/x/list_retrieve_members_params.rb | 10 +- .../models/x/search_tweet.rb | 119 ------------ .../models/x/tweet_create_params.rb | 28 +-- .../models/x/tweet_search_params.rb | 14 +- .../models/x/user_profile.rb | 80 -------- lib/x_twitter_scraper/models/x/x_account.rb | 42 +++- .../models/x/x_account_detail.rb | 23 ++- .../models/x_get_trends_params.rb | 18 +- lib/x_twitter_scraper/resources/account.rb | 4 +- lib/x_twitter_scraper/resources/api_keys.rb | 3 - lib/x_twitter_scraper/resources/bot.rb | 18 -- .../resources/bot/platform_links.rb | 16 -- lib/x_twitter_scraper/resources/compose.rb | 2 +- lib/x_twitter_scraper/resources/credits.rb | 2 +- lib/x_twitter_scraper/resources/drafts.rb | 2 +- lib/x_twitter_scraper/resources/events.rb | 1 - .../resources/integrations.rb | 182 ------------------ lib/x_twitter_scraper/resources/radar.rb | 12 +- lib/x_twitter_scraper/resources/styles.rb | 2 +- lib/x_twitter_scraper/resources/subscribe.rb | 2 +- lib/x_twitter_scraper/resources/trends.rb | 11 +- lib/x_twitter_scraper/resources/webhooks.rb | 2 +- lib/x_twitter_scraper/resources/x.rb | 24 ++- lib/x_twitter_scraper/resources/x/accounts.rb | 12 +- .../resources/x/bookmarks.rb | 2 +- .../resources/x/communities.rb | 16 +- .../resources/x/communities/tweets.rb | 6 +- .../resources/x/followers.rb | 4 +- lib/x_twitter_scraper/resources/x/lists.rb | 14 +- lib/x_twitter_scraper/resources/x/media.rb | 4 +- lib/x_twitter_scraper/resources/x/tweets.rb | 31 +-- lib/x_twitter_scraper/resources/x/users.rb | 26 +-- lib/x_twitter_scraper/version.rb | 2 +- rbi/x_twitter_scraper/client.rbi | 39 ++-- .../internal/transport/base_client.rbi | 9 +- rbi/x_twitter_scraper/models.rbi | 23 +-- .../models/account_retrieve_response.rbi | 75 +++++--- rbi/x_twitter_scraper/models/error.rbi | 19 +- rbi/x_twitter_scraper/models/event_detail.rbi | 4 +- rbi/x_twitter_scraper/models/event_type.rbi | 4 - .../extraction_estimate_cost_response.rbi | 31 +-- .../models/extraction_retrieve_response.rbi | 4 +- rbi/x_twitter_scraper/models/integration.rbi | 117 ----------- .../models/integration_create_params.rbi | 95 --------- .../models/integration_delete_params.rbi | 38 ---- .../models/integration_delete_response.rbi | 26 --- .../models/integration_delivery.rbi | 108 ----------- .../integration_list_deliveries_params.rbi | 55 ------ .../integration_list_deliveries_response.rbi | 34 ---- .../models/integration_list_params.rbi | 32 --- .../models/integration_list_response.rbi | 34 ---- .../models/integration_retrieve_params.rbi | 38 ---- .../models/integration_send_test_params.rbi | 38 ---- .../models/integration_send_test_response.rbi | 26 --- .../models/integration_update_params.rbi | 115 ----------- .../models/paginated_tweets.rbi | 6 +- .../models/paginated_users.rbi | 6 +- rbi/x_twitter_scraper/models/radar_item.rbi | 137 ++++++++++++- .../radar_retrieve_trending_topics_params.rbi | 125 ++++++++++-- ...adar_retrieve_trending_topics_response.rbi | 27 ++- rbi/x_twitter_scraper/models/search_tweet.rbi | 172 +++++++++++++++++ .../models/trend_list_params.rbi | 8 +- rbi/x_twitter_scraper/models/user_profile.rbi | 123 ++++++++++++ .../models/x/account_create_response.rbi | 103 +++++++++- .../models/x/account_reauth_params.rbi | 22 +++ .../models/x/account_reauth_response.rbi | 120 +++++++++++- .../x/community_retrieve_members_params.rbi | 11 ++ .../models/x/list_retrieve_members_params.rbi | 11 ++ .../models/x/search_tweet.rbi | 181 ----------------- .../models/x/tweet_create_params.rbi | 33 ++-- .../models/x/tweet_search_params.rbi | 14 +- .../models/x/user_profile.rbi | 125 ------------ rbi/x_twitter_scraper/models/x/x_account.rbi | 70 ++++++- .../models/x/x_account_detail.rbi | 57 ++++++ .../models/x_get_trends_params.rbi | 32 ++- rbi/x_twitter_scraper/resources/account.rbi | 2 +- rbi/x_twitter_scraper/resources/bot.rbi | 15 -- .../resources/bot/platform_links.rbi | 16 -- rbi/x_twitter_scraper/resources/compose.rbi | 2 +- rbi/x_twitter_scraper/resources/credits.rbi | 2 +- rbi/x_twitter_scraper/resources/drafts.rbi | 2 +- .../resources/integrations.rbi | 133 ------------- rbi/x_twitter_scraper/resources/radar.rbi | 18 +- rbi/x_twitter_scraper/resources/styles.rbi | 2 +- rbi/x_twitter_scraper/resources/subscribe.rbi | 2 +- rbi/x_twitter_scraper/resources/trends.rbi | 8 +- rbi/x_twitter_scraper/resources/webhooks.rbi | 2 +- rbi/x_twitter_scraper/resources/x.rbi | 23 ++- .../resources/x/accounts.rbi | 6 + .../resources/x/bookmarks.rbi | 2 +- .../resources/x/communities.rbi | 13 +- .../resources/x/communities/tweets.rbi | 6 +- .../resources/x/followers.rbi | 4 +- rbi/x_twitter_scraper/resources/x/lists.rbi | 11 +- rbi/x_twitter_scraper/resources/x/media.rbi | 4 +- rbi/x_twitter_scraper/resources/x/tweets.rbi | 31 +-- rbi/x_twitter_scraper/resources/x/users.rbi | 24 +-- release-please-config.json | 70 ------- scripts/bootstrap | 2 +- sig/x_twitter_scraper/client.rbs | 8 +- .../internal/transport/base_client.rbs | 2 - sig/x_twitter_scraper/models.rbs | 22 +-- .../models/account_retrieve_response.rbs | 53 +++-- sig/x_twitter_scraper/models/error.rbs | 10 +- sig/x_twitter_scraper/models/event_type.rbs | 9 +- .../extraction_estimate_cost_response.rbs | 25 ++- sig/x_twitter_scraper/models/integration.rbs | 78 -------- .../models/integration_create_params.rbs | 51 ----- .../models/integration_delete_params.rbs | 23 --- .../models/integration_delete_response.rbs | 13 -- .../models/integration_delivery.rbs | 75 -------- .../integration_list_deliveries_params.rbs | 30 --- .../integration_list_deliveries_response.rbs | 18 -- .../models/integration_list_params.rbs | 15 -- .../models/integration_list_response.rbs | 16 -- .../models/integration_retrieve_params.rbs | 23 --- .../models/integration_send_test_params.rbs | 23 --- .../models/integration_send_test_response.rbs | 13 -- .../models/integration_update_params.rbs | 77 -------- .../models/paginated_tweets.rbs | 8 +- .../models/paginated_users.rbs | 8 +- sig/x_twitter_scraper/models/radar_item.rbs | 89 ++++++++- .../radar_retrieve_trending_topics_params.rbs | 54 +++++- ...adar_retrieve_trending_topics_response.rbs | 18 +- sig/x_twitter_scraper/models/search_tweet.rbs | 119 ++++++++++++ sig/x_twitter_scraper/models/user_profile.rbs | 86 +++++++++ .../models/x/account_create_response.rbs | 49 ++++- .../models/x/account_reauth_params.rbs | 20 +- .../models/x/account_reauth_response.rbs | 61 +++++- .../x/community_retrieve_members_params.rbs | 8 +- .../models/x/list_retrieve_members_params.rbs | 8 +- .../models/x/search_tweet.rbs | 121 ------------ .../models/x/tweet_create_params.rbs | 24 +-- .../models/x/user_profile.rbs | 88 --------- sig/x_twitter_scraper/models/x/x_account.rbs | 26 +++ .../models/x/x_account_detail.rbs | 26 +++ .../models/x_get_trends_params.rbs | 23 ++- sig/x_twitter_scraper/resources/bot.rbs | 9 - .../resources/bot/platform_links.rbs | 9 - .../resources/integrations.rbs | 52 ----- sig/x_twitter_scraper/resources/radar.rbs | 5 +- sig/x_twitter_scraper/resources/x.rbs | 2 + .../resources/x/accounts.rbs | 2 + .../resources/x/communities.rbs | 1 + sig/x_twitter_scraper/resources/x/lists.rbs | 1 + sig/x_twitter_scraper/resources/x/tweets.rbs | 4 +- sig/x_twitter_scraper/resources/x/users.rbs | 2 +- test/x_twitter_scraper/client_test.rb | 179 +++++------------ test/x_twitter_scraper/resource_namespaces.rb | 3 - .../resources/account_test.rb | 3 +- .../resources/bot/platform_links_test.rb | 6 - test/x_twitter_scraper/resources/bot_test.rb | 6 - .../resources/extractions_test.rb | 5 +- .../resources/integrations_test.rb | 153 --------------- .../resources/monitors_test.rb | 5 +- .../x_twitter_scraper/resources/radar_test.rb | 3 +- .../resources/webhooks_test.rb | 2 +- .../resources/x/accounts_test.rb | 12 +- .../resources/x/bookmarks_test.rb | 2 +- .../resources/x/communities/tweets_test.rb | 4 +- .../resources/x/communities_test.rb | 6 +- .../resources/x/lists_test.rb | 6 +- .../resources/x/tweets_test.rb | 17 +- .../resources/x/users_test.rb | 22 +-- test/x_twitter_scraper/resources/x_test.rb | 2 +- test/x_twitter_scraper/test_helper.rb | 6 +- x_twitter_scraper.gemspec | 17 +- 216 files changed, 2777 insertions(+), 4259 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/context7-refresh.yml delete mode 100644 .github/workflows/publish-gem.yml delete mode 100644 .github/workflows/release-doctor.yml delete mode 100644 .release-please-manifest.json delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 bin/check-release-environment delete mode 100644 context7.json delete mode 100644 lib/x_twitter_scraper/models/integration.rb delete mode 100644 lib/x_twitter_scraper/models/integration_create_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_delete_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_delete_response.rb delete mode 100644 lib/x_twitter_scraper/models/integration_delivery.rb delete mode 100644 lib/x_twitter_scraper/models/integration_list_deliveries_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_list_deliveries_response.rb delete mode 100644 lib/x_twitter_scraper/models/integration_list_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_list_response.rb delete mode 100644 lib/x_twitter_scraper/models/integration_retrieve_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_send_test_params.rb delete mode 100644 lib/x_twitter_scraper/models/integration_send_test_response.rb delete mode 100644 lib/x_twitter_scraper/models/integration_update_params.rb create mode 100644 lib/x_twitter_scraper/models/search_tweet.rb create mode 100644 lib/x_twitter_scraper/models/user_profile.rb delete mode 100644 lib/x_twitter_scraper/models/x/search_tweet.rb delete mode 100644 lib/x_twitter_scraper/models/x/user_profile.rb delete mode 100644 lib/x_twitter_scraper/resources/bot.rb delete mode 100644 lib/x_twitter_scraper/resources/bot/platform_links.rb delete mode 100644 lib/x_twitter_scraper/resources/integrations.rb delete mode 100644 rbi/x_twitter_scraper/models/integration.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_create_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_delete_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_delete_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_delivery.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_list_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_list_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_retrieve_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_send_test_params.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_send_test_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/integration_update_params.rbi create mode 100644 rbi/x_twitter_scraper/models/search_tweet.rbi create mode 100644 rbi/x_twitter_scraper/models/user_profile.rbi delete mode 100644 rbi/x_twitter_scraper/models/x/search_tweet.rbi delete mode 100644 rbi/x_twitter_scraper/models/x/user_profile.rbi delete mode 100644 rbi/x_twitter_scraper/resources/bot.rbi delete mode 100644 rbi/x_twitter_scraper/resources/bot/platform_links.rbi delete mode 100644 rbi/x_twitter_scraper/resources/integrations.rbi delete mode 100644 release-please-config.json delete mode 100644 sig/x_twitter_scraper/models/integration.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_create_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_delete_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_delete_response.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_delivery.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_list_deliveries_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_list_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_list_response.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_retrieve_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_send_test_params.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_send_test_response.rbs delete mode 100644 sig/x_twitter_scraper/models/integration_update_params.rbs create mode 100644 sig/x_twitter_scraper/models/search_tweet.rbs create mode 100644 sig/x_twitter_scraper/models/user_profile.rbs delete mode 100644 sig/x_twitter_scraper/models/x/search_tweet.rbs delete mode 100644 sig/x_twitter_scraper/models/x/user_profile.rbs delete mode 100644 sig/x_twitter_scraper/resources/bot.rbs delete mode 100644 sig/x_twitter_scraper/resources/bot/platform_links.rbs delete mode 100644 sig/x_twitter_scraper/resources/integrations.rbs delete mode 100644 test/x_twitter_scraper/resources/bot/platform_links_test.rb delete mode 100644 test/x_twitter_scraper/resources/bot_test.rb delete mode 100644 test/x_twitter_scraper/resources/integrations_test.rb diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index d29b58c..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: ["https://xquik.com"] diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml deleted file mode 100644 index 0d5dbca..0000000 --- a/.github/workflows/context7-refresh.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Refresh Context7 Docs - -on: - push: - branches: - - main - paths: - - ".github/workflows/context7-refresh.yml" - - "README.md" - - "api.md" - - "context7.json" - - "x_twitter_scraper.gemspec" - - "lib/**/*.rb" - - "docs/**" - - "examples/**" - - "rbi/**/*.rbi" - - "sig/**/*.rbs" - workflow_dispatch: - -permissions: {} - -jobs: - refresh: - runs-on: ubuntu-latest - steps: - - name: Trigger Context7 refresh - env: - CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }} - run: | - set -euo pipefail - - if [ -z "$CONTEXT7_API_KEY" ]; then - echo "::warning ::CONTEXT7_API_KEY secret is not configured. Configure it to enable automatic Context7 refreshes." - exit 0 - fi - - body_file="$(mktemp)" - trap 'rm -f "$body_file"' EXIT - status="$(curl -sS -o "$body_file" -w "%{http_code}" -X POST "https://context7.com/api/v1/refresh" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer ${CONTEXT7_API_KEY}" \ - -d '{"libraryName": "/xquik-dev/x-twitter-scraper-ruby"}')" - - case "$status" in - 200|202) - cat "$body_file" - ;; - 400) - if grep -Eiq "active-task|being processed|already.*process" "$body_file"; then - echo "::warning ::Context7 is already processing another library. Retry on the next docs change." - cat "$body_file" - elif grep -Eiq "too-early|minimum .* days|required between updates" "$body_file"; then - echo "::warning ::Context7 refresh is not due yet." - cat "$body_file" - else - echo "::error ::Context7 refresh returned HTTP $status." - cat "$body_file" - exit 1 - fi - ;; - 404) - echo "::warning ::Context7 library /xquik-dev/x-twitter-scraper-ruby is not available yet. Add processing may still be pending." - cat "$body_file" - ;; - 401|403) - echo "::error ::Context7 authentication failed." - exit 1 - ;; - 429) - echo "::warning ::Context7 refresh is rate limited. Retry on the next docs change." - ;; - *) - echo "::error ::Context7 refresh returned HTTP $status." - cat "$body_file" - exit 1 - ;; - esac diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml deleted file mode 100644 index 47de36b..0000000 --- a/.github/workflows/publish-gem.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow is triggered when a GitHub release is created. -# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/Xquik-dev/x-twitter-scraper-ruby/actions/workflows/publish-gem.yml -name: Publish Gem -on: - workflow_dispatch: - - release: - types: [published] - -jobs: - publish: - name: publish - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v6 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: false - - run: |- - bundle install - - - name: Configure RubyGems credentials (trusted publishing) - uses: rubygems/configure-rubygems-credentials@main - - - name: Publish to RubyGems.org - run: | - bash ./bin/publish-gem - env: - RUBYGEMS_HOST: ${{ secrets.X_TWITTER_SCRAPER_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml deleted file mode 100644 index 75e533e..0000000 --- a/.github/workflows/release-doctor.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release Doctor -on: - pull_request: - branches: - - main - workflow_dispatch: - -jobs: - release_doctor: - name: release doctor - runs-on: ubuntu-latest - if: github.repository == 'Xquik-dev/x-twitter-scraper-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') - - steps: - - uses: actions/checkout@v6 - - - name: Check release environment - run: | - bash ./bin/check-release-environment - env: - 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/.gitignore b/.gitignore index b9fc791..fc9eb28 100644 --- a/.gitignore +++ b/.gitignore @@ -9,35 +9,3 @@ bin/tapioca Brewfile.lock.json doc/ sorbet/tapioca/* - -# Public repo local safety -.env -.env.* -!.env.example -!.env.sample -.npmrc -.pypirc -*.pem -*.key -*.crt -*.p12 -*.pfx -*.token -*.secret -*.log -*.log.* -.bundle/ -coverage/ -.cache/ -.tmp/ -tmp/ -temp/ -.codex/ -.agents/ -.claude/ -.vscode/ -.DS_Store -Thumbs.db -*.swp -*.swo -*~ diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index 218393f..0000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.4.1" -} diff --git a/.stats.yml b/.stats.yml index d8c6752..52f4e24 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -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 +configured_endpoints: 110 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-fa5dce40b67286178b383dc78f45cf06031f3c78db04306630abc8d9d12ee03e.yml +openapi_spec_hash: 89dbd520dbea314871679a8321ce7f65 +config_hash: 0a29dafd3c416019a49430105808d7d4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bec119..d3dc45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,5 @@ # Changelog -## 0.4.1 (2026-05-10) - -Full Changelog: [v0.4.0...v0.4.1](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.4.0...v0.4.1) - -### Bug Fixes - -* expose RubyGems license, issue tracker, changelog, and funding metadata - ## 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) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 0f624a1..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,85 +0,0 @@ - -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@xquik.com. All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of actions. - -**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 39a1b67..11a69b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g To install via git in your `Gemfile`: ```ruby -gem "x-twitter-scraper", git: "https://github.com/Xquik-dev/x-twitter-scraper-ruby" +gem "x-twitter-scraper", git: "https://github.com/stainless-sdks/x-twitter-scraper-ruby" ``` Alternatively, reference local copy of the repo: ```bash -$ git clone -- 'https://github.com/Xquik-dev/x-twitter-scraper-ruby' '' +$ git clone -- 'https://github.com/stainless-sdks/x-twitter-scraper-ruby' '' ``` ```ruby diff --git a/README.md b/README.md index 24ab8f2..497c209 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ -# X (Twitter) Scraper Ruby SDK: Tweet Search, Profile Tweets, Followers & Posting +# Xquik API library -> **Xquik is an independent third-party service.** Not affiliated with X Corp. -> "Twitter" and "X" are trademarks of X Corp. - -[![Ask DeepWiki](https://deepwiki.com/badge.svg?url=https%3A%2F%2Fgithub.com%2FXquik-dev%2Fx-twitter-scraper-ruby)](https://deepwiki.com/Xquik-dev/x-twitter-scraper-ruby) -[![Skills.sh x-twitter-scraper Skill](https://skills.sh/b/xquik-dev/x-twitter-scraper)](https://skills.sh/xquik-dev/x-twitter-scraper) - -The Xquik Ruby SDK is a Twitter API SDK and X API alternative for tweet search, advanced Twitter search queries, profile tweets, user lookup, follower export, media download, media upload, monitoring, webhooks, and posting automation. - -Use it from Ruby 3.2.0+ applications to get tweets from profiles, search tweets by keyword or operator query, send tweets, post replies, like, repost, follow, DM, run giveaway draws, and automate X workflows. It ships with comprehensive types and docstrings in Yard, RBS, and RBI. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. +The Xquik library provides convenient access to the X Twitter Scraper REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/stainless-sdks/x-twitter-scraper-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. It is generated with [Stainless](https://www.stainless.com/). @@ -22,14 +14,10 @@ The REST API documentation can be found on [xquik.com](https://xquik.com). To use this gem, install via Bundler by adding the following to your application's `Gemfile`: - - ```ruby gem "x-twitter-scraper", "~> 0.4.0" ``` - - ## Usage ```ruby @@ -74,7 +62,7 @@ When the library is unable to connect to the API, or if the API returns a non-su ```ruby begin - tweet = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10) + account = x_twitter_scraper.account.retrieve rescue XTwitterScraper::Errors::APIConnectionError => e puts("The server could not be reached") puts(e.cause) # an underlying Exception, likely raised within `net/http` @@ -117,7 +105,7 @@ x_twitter_scraper = XTwitterScraper::Client.new( ) # Or, configure per-request: -x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10, request_options: {max_retries: 5}) +x_twitter_scraper.account.retrieve(request_options: {max_retries: 5}) ``` ### Timeouts @@ -131,7 +119,7 @@ x_twitter_scraper = XTwitterScraper::Client.new( ) # Or, configure per-request: -x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10, request_options: {timeout: 5}) +x_twitter_scraper.account.retrieve(request_options: {timeout: 5}) ``` On timeout, `XTwitterScraper::Errors::APITimeoutError` is raised. @@ -161,10 +149,8 @@ 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 -paginated_tweets = - x_twitter_scraper.x.tweets.search( - q: "from:elonmusk", - limit: 10, +account = + x_twitter_scraper.account.retrieve( request_options: { extra_query: {my_query_parameter: value}, extra_body: {my_body_parameter: value}, @@ -172,7 +158,7 @@ paginated_tweets = } ) -puts(paginated_tweets[:my_undocumented_property]) +puts(account[:my_undocumented_property]) ``` #### Undocumented request params @@ -264,4 +250,4 @@ Ruby 3.2.0 or higher. ## Contributing -See [the contributing documentation](https://github.com/Xquik-dev/x-twitter-scraper-ruby/tree/main/CONTRIBUTING.md). +See [the contributing documentation](https://github.com/stainless-sdks/x-twitter-scraper-ruby/tree/main/CONTRIBUTING.md). diff --git a/bin/check-release-environment b/bin/check-release-environment deleted file mode 100644 index c05436e..0000000 --- a/bin/check-release-environment +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -errors=() - -if [ -z "${GEM_HOST_API_KEY}" ]; then - errors+=("The GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - -lenErrors=${#errors[@]} - -if [[ lenErrors -gt 0 ]]; then - echo -e "Found the following errors in the release environment:\n" - - for error in "${errors[@]}"; do - echo -e "- $error\n" - done - - exit 1 -fi - -echo "The environment is ready to push releases!" diff --git a/context7.json b/context7.json deleted file mode 100644 index caff6e7..0000000 --- a/context7.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://context7.com/schema/context7.json", - "projectTitle": "Xquik Ruby SDK", - "description": "Xquik Ruby SDK for X/Twitter workflows with typed methods for tweet search, user lookup, media workflows, monitors, webhooks, posting, and bulk extractions. Not affiliated with X Corp.", - "branch": "main", - "excludeFolders": [ - ".github", - ".yardoc", - "bin", - "doc", - "gemfiles", - "sorbet", - "test" - ], - "excludeFiles": [ - "CHANGELOG.md", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "Gemfile.lock", - "LICENSE", - "SECURITY.md", - "Tapiocafile", - "rbi/todo.rbi" - ], - "rules": [ - "Install from RubyGems package x-twitter-scraper, then require x_twitter_scraper.", - "Authenticate with XTwitterScraper::Client api_key or the X_TWITTER_SCRAPER_API_KEY environment variable.", - "Use README.md first for install, authentication, first request, uploads, retries, errors, pagination, and common workflows.", - "Use x_twitter_scraper.gemspec for package name, version, license, homepage, support URLs, Ruby version, files, and dependencies.", - "Use lib/x_twitter_scraper/resources and lib/x_twitter_scraper/models for generated Ruby method names and typed request parameters.", - "Use lib/x_twitter_scraper/resources/x/tweets.rb for tweet search, posting, replies, retweets, likes, and tweet retrieval workflows.", - "Use lib/x_twitter_scraper/resources/x/media.rb, lib/x_twitter_scraper/resources/monitors.rb, lib/x_twitter_scraper/resources/webhooks.rb, and lib/x_twitter_scraper/resources/extractions.rb for media, monitoring, webhook, and bulk extraction workflows.", - "Never expose API keys, bearer tokens, webhook signing values, user credentials, or local runtime secrets in examples, logs, or commits." - ], - "url": "https://context7.com/xquik-dev/x-twitter-scraper-ruby", - "public_key": "pk_oCPeRRqZFJsY4cCUSotDD" -} diff --git a/lib/x_twitter_scraper.rb b/lib/x_twitter_scraper.rb index 3c185bf..e587d1e 100644 --- a/lib/x_twitter_scraper.rb +++ b/lib/x_twitter_scraper.rb @@ -105,19 +105,6 @@ require_relative "x_twitter_scraper/models/extraction_retrieve_response" require_relative "x_twitter_scraper/models/extraction_run_params" 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_delete_params" -require_relative "x_twitter_scraper/models/integration_delete_response" -require_relative "x_twitter_scraper/models/integration_delivery" -require_relative "x_twitter_scraper/models/integration_list_deliveries_params" -require_relative "x_twitter_scraper/models/integration_list_deliveries_response" -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_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/monitor" require_relative "x_twitter_scraper/models/monitor_create_params" require_relative "x_twitter_scraper/models/monitor_create_response" @@ -132,6 +119,7 @@ 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/search_tweet" require_relative "x_twitter_scraper/models/style_analyze_params" require_relative "x_twitter_scraper/models/style_compare_params" require_relative "x_twitter_scraper/models/style_compare_response" @@ -158,6 +146,7 @@ require_relative "x_twitter_scraper/models/support/ticket_update_response" require_relative "x_twitter_scraper/models/trend_list_params" require_relative "x_twitter_scraper/models/trend_list_response" +require_relative "x_twitter_scraper/models/user_profile" require_relative "x_twitter_scraper/models/webhook" require_relative "x_twitter_scraper/models/webhook_create_params" require_relative "x_twitter_scraper/models/webhook_create_response" @@ -218,7 +207,6 @@ require_relative "x_twitter_scraper/models/x/profile_update_banner_response" require_relative "x_twitter_scraper/models/x/profile_update_params" require_relative "x_twitter_scraper/models/x/profile_update_response" -require_relative "x_twitter_scraper/models/x/search_tweet" require_relative "x_twitter_scraper/models/x/tweet_author" require_relative "x_twitter_scraper/models/x/tweet_create_params" require_relative "x_twitter_scraper/models/x/tweet_create_response" @@ -242,7 +230,6 @@ 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/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" @@ -270,15 +257,12 @@ require_relative "x_twitter_scraper/models" require_relative "x_twitter_scraper/resources/account" require_relative "x_twitter_scraper/resources/api_keys" -require_relative "x_twitter_scraper/resources/bot" -require_relative "x_twitter_scraper/resources/bot/platform_links" require_relative "x_twitter_scraper/resources/compose" require_relative "x_twitter_scraper/resources/credits" require_relative "x_twitter_scraper/resources/drafts" require_relative "x_twitter_scraper/resources/draws" require_relative "x_twitter_scraper/resources/events" require_relative "x_twitter_scraper/resources/extractions" -require_relative "x_twitter_scraper/resources/integrations" require_relative "x_twitter_scraper/resources/monitors" require_relative "x_twitter_scraper/resources/radar" require_relative "x_twitter_scraper/resources/styles" diff --git a/lib/x_twitter_scraper/client.rb b/lib/x_twitter_scraper/client.rb index 38f2ef3..78b9025 100644 --- a/lib/x_twitter_scraper/client.rb +++ b/lib/x_twitter_scraper/client.rb @@ -22,7 +22,7 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [String, nil] attr_reader :bearer_token - # Account info & settings + # Account info and settings # @return [XTwitterScraper::Resources::Account] attr_reader :account @@ -30,23 +30,23 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [XTwitterScraper::Resources::APIKeys] attr_reader :api_keys - # Subscription & billing + # Subscription, billing, and credits # @return [XTwitterScraper::Resources::Subscribe] attr_reader :subscribe - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar # @return [XTwitterScraper::Resources::Compose] attr_reader :compose - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar # @return [XTwitterScraper::Resources::Drafts] attr_reader :drafts - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar # @return [XTwitterScraper::Resources::Styles] attr_reader :styles - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar # @return [XTwitterScraper::Resources::Radar] attr_reader :radar @@ -66,39 +66,29 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [XTwitterScraper::Resources::Draws] attr_reader :draws - # Webhook endpoint management & delivery + # Webhook endpoint management and delivery # @return [XTwitterScraper::Resources::Webhooks] attr_reader :webhooks - # Push notification integrations (Telegram) - # @return [XTwitterScraper::Resources::Integrations] - attr_reader :integrations - - # X data lookups (subscription required) # @return [XTwitterScraper::Resources::X] attr_reader :x - # Trending topics by region + # Trending topics and hashtags by region # @return [XTwitterScraper::Resources::Trends] attr_reader :trends - # @return [XTwitterScraper::Resources::Bot] - attr_reader :bot - # @return [XTwitterScraper::Resources::Support] attr_reader :support - # Subscription & billing + # Subscription, billing, and credits # @return [XTwitterScraper::Resources::Credits] attr_reader :credits # @api private # - # @param security [Hash{Symbol=>Boolean}] - # # @return [Hash{String=>String}] - private def auth_headers(security:) - {auth_api_key:, oauth_bearer:}.slice(*security.keys).values.reduce({}, :merge) + private def auth_headers + {**auth_api_key, **oauth_bearer} end # @api private @@ -144,6 +134,19 @@ def initialize( ) base_url ||= "https://xquik.com/api/v1" + headers = {} + custom_headers_env = ENV["X_TWITTER_SCRAPER_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end + @api_key = api_key&.to_s @bearer_token = bearer_token&.to_s @@ -152,7 +155,8 @@ def initialize( timeout: timeout, max_retries: max_retries, initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay + max_retry_delay: max_retry_delay, + headers: headers ) @account = XTwitterScraper::Resources::Account.new(client: self) @@ -167,10 +171,8 @@ def initialize( @extractions = XTwitterScraper::Resources::Extractions.new(client: self) @draws = XTwitterScraper::Resources::Draws.new(client: self) @webhooks = XTwitterScraper::Resources::Webhooks.new(client: self) - @integrations = XTwitterScraper::Resources::Integrations.new(client: self) @x = XTwitterScraper::Resources::X.new(client: self) @trends = XTwitterScraper::Resources::Trends.new(client: self) - @bot = XTwitterScraper::Resources::Bot.new(client: self) @support = XTwitterScraper::Resources::Support.new(client: self) @credits = XTwitterScraper::Resources::Credits.new(client: self) end diff --git a/lib/x_twitter_scraper/internal/transport/base_client.rb b/lib/x_twitter_scraper/internal/transport/base_client.rb index 213b27b..aa3b191 100644 --- a/lib/x_twitter_scraper/internal/transport/base_client.rb +++ b/lib/x_twitter_scraper/internal/transport/base_client.rb @@ -31,19 +31,7 @@ class << self # # @raise [ArgumentError] def validate!(req) - keys = [ - :method, - :path, - :query, - :headers, - :body, - :unwrap, - :page, - :stream, - :model, - :security, - :options - ] + keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] case req in Hash req.each_key do |k| @@ -264,8 +252,6 @@ def initialize( # # @option req [XTwitterScraper::Internal::Type::Converter, Class, nil] :model # - # @option req [Hash{Symbol=>Boolean}, nil] :security - # # @param opts [Hash{Symbol=>Object}] . # # @option opts [String, nil] :idempotency_key @@ -290,11 +276,7 @@ def initialize( headers = XTwitterScraper::Internal::Util.normalized_headers( @headers, - auth_headers( - security: req.fetch( - :security, {auth_api_key: true, oauth_bearer: true} - ) - ), + auth_headers, req[:headers].to_h, opts[:extra_headers].to_h ) @@ -461,7 +443,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # Execute the request specified by `req`. This is the method that all resource # methods call into. # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, security: {auth_api_key: true, oauth_bearer: true}, options: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, options: {}) # # @param method [Symbol] # @@ -481,8 +463,6 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # # @param model [XTwitterScraper::Internal::Type::Converter, Class, nil] # - # @param security [Hash{Symbol=>Boolean}, nil] - # # @param options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] . # # @option options [String, nil] :idempotency_key @@ -575,7 +555,6 @@ def inspect page: T.nilable(T::Class[XTwitterScraper::Internal::Type::BasePage[XTwitterScraper::Internal::Type::BaseModel]]), stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), - security: T.nilable({auth_api_key: T::Boolean, oauth_bearer: T::Boolean}), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) } end diff --git a/lib/x_twitter_scraper/internal/util.rb b/lib/x_twitter_scraper/internal/util.rb index f384f5b..502f914 100644 --- a/lib/x_twitter_scraper/internal/util.rb +++ b/lib/x_twitter_scraper/internal/util.rb @@ -610,6 +610,7 @@ def encode_query_params(query) # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) + # rubocop:disable Style/CaseEquality # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length boundary = SecureRandom.urlsafe_base64(46) @@ -619,7 +620,7 @@ def encode_query_params(query) in Hash body.each do |key, val| case val - in Array if val.all? { primitive?(_1) } + in Array if val.all? { primitive?(_1) || XTwitterScraper::Internal::Type::FileInput === _1 } val.each do |v| write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) end @@ -635,6 +636,7 @@ def encode_query_params(query) fused_io = fused_enum(strio) { closing.each(&:call) } [boundary, fused_io] + # rubocop:enable Style/CaseEquality end # @api private diff --git a/lib/x_twitter_scraper/models.rb b/lib/x_twitter_scraper/models.rb index 41b8099..900e376 100644 --- a/lib/x_twitter_scraper/models.rb +++ b/lib/x_twitter_scraper/models.rb @@ -112,24 +112,6 @@ module XTwitterScraper ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams - Integration = XTwitterScraper::Models::Integration - - IntegrationCreateParams = XTwitterScraper::Models::IntegrationCreateParams - - IntegrationDeleteParams = XTwitterScraper::Models::IntegrationDeleteParams - - IntegrationDelivery = XTwitterScraper::Models::IntegrationDelivery - - IntegrationListDeliveriesParams = XTwitterScraper::Models::IntegrationListDeliveriesParams - - IntegrationListParams = XTwitterScraper::Models::IntegrationListParams - - IntegrationRetrieveParams = XTwitterScraper::Models::IntegrationRetrieveParams - - IntegrationSendTestParams = XTwitterScraper::Models::IntegrationSendTestParams - - IntegrationUpdateParams = XTwitterScraper::Models::IntegrationUpdateParams - Monitor = XTwitterScraper::Models::Monitor MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -150,6 +132,8 @@ module XTwitterScraper RadarRetrieveTrendingTopicsParams = XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams + SearchTweet = XTwitterScraper::Models::SearchTweet + StyleAnalyzeParams = XTwitterScraper::Models::StyleAnalyzeParams StyleCompareParams = XTwitterScraper::Models::StyleCompareParams @@ -174,6 +158,8 @@ module XTwitterScraper TrendListParams = XTwitterScraper::Models::TrendListParams + UserProfile = XTwitterScraper::Models::UserProfile + Webhook = XTwitterScraper::Models::Webhook WebhookCreateParams = XTwitterScraper::Models::WebhookCreateParams diff --git a/lib/x_twitter_scraper/models/account_retrieve_response.rb b/lib/x_twitter_scraper/models/account_retrieve_response.rb index 6929932..95f4fe5 100644 --- a/lib/x_twitter_scraper/models/account_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/account_retrieve_response.rb @@ -19,18 +19,29 @@ class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::AccountRetrieveResponse::Plan] required :plan, enum: -> { XTwitterScraper::Models::AccountRetrieveResponse::Plan } - # @!attribute current_period + # @!attribute credit_info # - # @return [XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod, nil] - optional :current_period, - -> { XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod }, - api_name: :currentPeriod + # @return [XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, nil] + optional :credit_info, + -> { XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo }, + api_name: :creditInfo - # @!method initialize(monitors_allowed:, monitors_used:, plan:, current_period: nil) + # @!attribute x_username + # Linked X username, omitted when no X account is connected. + # + # @return [String, nil] + optional :x_username, String, api_name: :xUsername + + # @!method initialize(monitors_allowed:, monitors_used:, plan:, credit_info: nil, x_username: nil) # @param monitors_allowed [Integer] + # # @param monitors_used [Integer] + # # @param plan [Symbol, XTwitterScraper::Models::AccountRetrieveResponse::Plan] - # @param current_period [XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod] + # + # @param credit_info [XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo] + # + # @param x_username [String] Linked X username, omitted when no X account is connected. # @see XTwitterScraper::Models::AccountRetrieveResponse#plan module Plan @@ -43,27 +54,33 @@ module Plan # @return [Array] end - # @see XTwitterScraper::Models::AccountRetrieveResponse#current_period - class CurrentPeriod < XTwitterScraper::Internal::Type::BaseModel - # @!attribute end_ + # @see XTwitterScraper::Models::AccountRetrieveResponse#credit_info + class CreditInfo < XTwitterScraper::Internal::Type::BaseModel + # @!attribute auto_topup_enabled + # + # @return [Boolean] + required :auto_topup_enabled, XTwitterScraper::Internal::Type::Boolean, api_name: :autoTopupEnabled + + # @!attribute balance # - # @return [Time] - required :end_, Time, api_name: :end + # @return [Integer] + required :balance, Integer - # @!attribute start + # @!attribute lifetime_purchased # - # @return [Time] - required :start, Time + # @return [Integer] + required :lifetime_purchased, Integer, api_name: :lifetimePurchased - # @!attribute usage_percent + # @!attribute lifetime_used # - # @return [Float] - required :usage_percent, Float, api_name: :usagePercent + # @return [Integer] + required :lifetime_used, Integer, api_name: :lifetimeUsed - # @!method initialize(end_:, start:, usage_percent:) - # @param end_ [Time] - # @param start [Time] - # @param usage_percent [Float] + # @!method initialize(auto_topup_enabled:, balance:, lifetime_purchased:, lifetime_used:) + # @param auto_topup_enabled [Boolean] + # @param balance [Integer] + # @param lifetime_purchased [Integer] + # @param lifetime_used [Integer] end end end diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index d8d81c8..fda7eac 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -26,17 +26,18 @@ module Error INVALID_TWEET_ID = :invalid_tweet_id INVALID_TWEET_URL = :invalid_tweet_url INVALID_USERNAME = :invalid_username + INSUFFICIENT_CREDITS = :insufficient_credits MISSING_PARAMS = :missing_params MISSING_QUERY = :missing_query MONITOR_ALREADY_EXISTS = :monitor_already_exists MONITOR_LIMIT_REACHED = :monitor_limit_reached + NO_CREDITS = :no_credits NO_SUBSCRIPTION = :no_subscription NOT_FOUND = :not_found - STREAM_REGISTRATION_FAILED = :stream_registration_failed SUBSCRIPTION_INACTIVE = :subscription_inactive TWEET_NOT_FOUND = :tweet_not_found UNAUTHENTICATED = :unauthenticated - USAGE_LIMIT_REACHED = :usage_limit_reached + UNSUPPORTED_FIELD = :unsupported_field USER_NOT_FOUND = :user_not_found WEBHOOK_INACTIVE = :webhook_inactive X_API_RATE_LIMITED = :x_api_rate_limited diff --git a/lib/x_twitter_scraper/models/event_detail.rb b/lib/x_twitter_scraper/models/event_detail.rb index 3e87746..ab9a93a 100644 --- a/lib/x_twitter_scraper/models/event_detail.rb +++ b/lib/x_twitter_scraper/models/event_detail.rb @@ -10,7 +10,7 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute data - # Event payload — shape varies by event type (JSON) + # Event payload - shape varies by event type (JSON) # # @return [Hash{Symbol=>Object}] required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -46,7 +46,7 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel # # @param id [String] # - # @param data [Hash{Symbol=>Object}] Event payload — shape varies by event type (JSON) + # @param data [Hash{Symbol=>Object}] Event payload - shape varies by event type (JSON) # # @param monitor_id [String] # diff --git a/lib/x_twitter_scraper/models/event_type.rb b/lib/x_twitter_scraper/models/event_type.rb index 05de66d..f41fff8 100644 --- a/lib/x_twitter_scraper/models/event_type.rb +++ b/lib/x_twitter_scraper/models/event_type.rb @@ -10,8 +10,6 @@ module EventType 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] diff --git a/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb b/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb index 4f1abc4..dcf0903 100644 --- a/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb +++ b/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb @@ -9,32 +9,38 @@ class ExtractionEstimateCostResponse < XTwitterScraper::Internal::Type::BaseMode # @return [Boolean] required :allowed, XTwitterScraper::Internal::Type::Boolean + # @!attribute credits_available + # + # @return [String] + required :credits_available, String, api_name: :creditsAvailable + + # @!attribute credits_required + # + # @return [String] + required :credits_required, String, api_name: :creditsRequired + # @!attribute estimated_results # # @return [Integer] required :estimated_results, Integer, api_name: :estimatedResults - # @!attribute projected_percent - # - # @return [Float] - required :projected_percent, Float, api_name: :projectedPercent - # @!attribute source # # @return [String] required :source, String - # @!attribute usage_percent + # @!attribute resolved_x_user_id # - # @return [Float] - required :usage_percent, Float, api_name: :usagePercent + # @return [String, nil] + optional :resolved_x_user_id, String, api_name: :resolvedXUserId - # @!method initialize(allowed:, estimated_results:, projected_percent:, source:, usage_percent:) + # @!method initialize(allowed:, credits_available:, credits_required:, estimated_results:, source:, resolved_x_user_id: nil) # @param allowed [Boolean] + # @param credits_available [String] + # @param credits_required [String] # @param estimated_results [Integer] - # @param projected_percent [Float] # @param source [String] - # @param usage_percent [Float] + # @param resolved_x_user_id [String] end end end diff --git a/lib/x_twitter_scraper/models/extraction_retrieve_response.rb b/lib/x_twitter_scraper/models/extraction_retrieve_response.rb index a5e4454..5a706fc 100644 --- a/lib/x_twitter_scraper/models/extraction_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/extraction_retrieve_response.rb @@ -10,7 +10,7 @@ class ExtractionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel required :has_more, XTwitterScraper::Internal::Type::Boolean, api_name: :hasMore # @!attribute job - # Extraction job metadata — shape varies by tool type (JSON) + # Extraction job metadata - shape varies by tool type (JSON) # # @return [Hash{Symbol=>Object}] required :job, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -29,7 +29,7 @@ class ExtractionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(has_more:, job:, results:, next_cursor: nil) # @param has_more [Boolean] # - # @param job [Hash{Symbol=>Object}] Extraction job metadata — shape varies by tool type (JSON) + # @param job [Hash{Symbol=>Object}] Extraction job metadata - shape varies by tool type (JSON) # # @param results [ArrayObject}>] # diff --git a/lib/x_twitter_scraper/models/integration.rb b/lib/x_twitter_scraper/models/integration.rb deleted file mode 100644 index d85d985..0000000 --- a/lib/x_twitter_scraper/models/integration.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#create - 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 - # Array of event types to subscribe to. - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::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, :telegram] - required :type, const: :telegram - - # @!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:, 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] Array of event types to subscribe to. - # - # @param is_active [Boolean] - # - # @param name [String] - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param message_template [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - # - # @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 deleted file mode 100644 index 514dbd2..0000000 --- a/lib/x_twitter_scraper/models/integration_create_params.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#create - class IntegrationCreateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute config - # Integration config (e.g. Telegram chatId) - # - # @return [XTwitterScraper::Models::IntegrationCreateParams::Config] - required :config, -> { XTwitterScraper::IntegrationCreateParams::Config } - - # @!attribute event_types - # Array of event types to subscribe to. - # - # @return [Array] - required :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, - api_name: :eventTypes - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute type - # - # @return [Symbol, :telegram] - required :type, const: :telegram - - # @!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] Array of event types to subscribe to. - # - # @param name [String] - # - # @param type [Symbol, :telegram] - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - - class Config < XTwitterScraper::Internal::Type::BaseModel - # @!attribute chat_id - # - # @return [String] - required :chat_id, String, api_name: :chatId - - # @!method initialize(chat_id:) - # Integration config (e.g. Telegram chatId) - # - # @param chat_id [String] - end - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_delete_params.rb b/lib/x_twitter_scraper/models/integration_delete_params.rb deleted file mode 100644 index c2b092f..0000000 --- a/lib/x_twitter_scraper/models/integration_delete_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#delete - class IntegrationDeleteParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_delete_response.rb b/lib/x_twitter_scraper/models/integration_delete_response.rb deleted file mode 100644 index 7c5b012..0000000 --- a/lib/x_twitter_scraper/models/integration_delete_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#delete - class IntegrationDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute success - # - # @return [Boolean, true] - required :success, const: true - - # @!method initialize(success: true) - # @param success [Boolean, true] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_delivery.rb b/lib/x_twitter_scraper/models/integration_delivery.rb deleted file mode 100644 index 57a428f..0000000 --- a/lib/x_twitter_scraper/models/integration_delivery.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - class IntegrationDelivery < 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) - # Integration delivery attempt record with status and retry count. - # - # @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 - end -end diff --git a/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb b/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb deleted file mode 100644 index ddf885e..0000000 --- a/lib/x_twitter_scraper/models/integration_list_deliveries_params.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#list_deliveries - class IntegrationListDeliveriesParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute id - # - # @return [String] - 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] Maximum number of items to return (1-100, default 50) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - 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 deleted file mode 100644 index 529e3ec..0000000 --- a/lib/x_twitter_scraper/models/integration_list_deliveries_response.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#list_deliveries - class IntegrationListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute deliveries - # - # @return [Array] - required :deliveries, - -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::IntegrationDelivery] } - - # @!method initialize(deliveries:) - # @param deliveries [Array] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_list_params.rb b/lib/x_twitter_scraper/models/integration_list_params.rb deleted file mode 100644 index 1370fcf..0000000 --- a/lib/x_twitter_scraper/models/integration_list_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#list - class IntegrationListParams < 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 diff --git a/lib/x_twitter_scraper/models/integration_list_response.rb b/lib/x_twitter_scraper/models/integration_list_response.rb deleted file mode 100644 index 13f3155..0000000 --- a/lib/x_twitter_scraper/models/integration_list_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#list - class IntegrationListResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute integrations - # - # @return [Array] - required :integrations, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Integration] } - - # @!method initialize(integrations:) - # @param integrations [Array] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_retrieve_params.rb b/lib/x_twitter_scraper/models/integration_retrieve_params.rb deleted file mode 100644 index 03e3765..0000000 --- a/lib/x_twitter_scraper/models/integration_retrieve_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#retrieve - class IntegrationRetrieveParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_send_test_params.rb b/lib/x_twitter_scraper/models/integration_send_test_params.rb deleted file mode 100644 index 5a9c25d..0000000 --- a/lib/x_twitter_scraper/models/integration_send_test_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#send_test - class IntegrationSendTestParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/x_twitter_scraper/models/integration_send_test_response.rb b/lib/x_twitter_scraper/models/integration_send_test_response.rb deleted file mode 100644 index 56cd13f..0000000 --- a/lib/x_twitter_scraper/models/integration_send_test_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#send_test - class IntegrationSendTestResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute success - # - # @return [Boolean, true] - required :success, const: true - - # @!method initialize(success: true) - # @param success [Boolean, true] - 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 deleted file mode 100644 index 1f41337..0000000 --- a/lib/x_twitter_scraper/models/integration_update_params.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::Integrations#update - class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute event_types - # Array of event types to subscribe to. - # - # @return [Array, nil] - optional :event_types, - -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, - api_name: :eventTypes - - # @!attribute filters - # Event filter rules (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] - - # @!attribute is_active - # - # @return [Boolean, nil] - optional :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive - - # @!attribute message_template - # Custom message template (JSON) - # - # @return [Hash{Symbol=>Object}, nil] - optional :message_template, - XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], - api_name: :messageTemplate - - # @!attribute name - # - # @return [String, nil] - optional :name, String - - # @!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:, 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] Array of event types to subscribe to. - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param is_active [Boolean] - # - # @param message_template [Hash{Symbol=>Object}] Custom message template (JSON) - # - # @param name [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/x_twitter_scraper/models/paginated_tweets.rb b/lib/x_twitter_scraper/models/paginated_tweets.rb index 2cff003..d4551ed 100644 --- a/lib/x_twitter_scraper/models/paginated_tweets.rb +++ b/lib/x_twitter_scraper/models/paginated_tweets.rb @@ -15,15 +15,15 @@ class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel # @!attribute tweets # - # @return [Array] - required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet] } + # @return [Array] + required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::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] + # @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 4efadd6..cab7caa 100644 --- a/lib/x_twitter_scraper/models/paginated_users.rb +++ b/lib/x_twitter_scraper/models/paginated_users.rb @@ -15,15 +15,15 @@ class PaginatedUsers < XTwitterScraper::Internal::Type::BaseModel # @!attribute users # - # @return [Array] - required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile] } + # @return [Array] + required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::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] + # @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 4509867..71c2832 100644 --- a/lib/x_twitter_scraper/models/radar_item.rb +++ b/lib/x_twitter_scraper/models/radar_item.rb @@ -3,10 +3,42 @@ module XTwitterScraper module Models class RadarItem < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # Internal numeric identifier (stringified bigint). + # + # @return [String] + required :id, String + # @!attribute category # + # @return [Symbol, XTwitterScraper::Models::RadarItem::Category] + required :category, enum: -> { XTwitterScraper::RadarItem::Category } + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute language + # # @return [String] - required :category, String + required :language, String + + # @!attribute metadata + # Source-specific fields. Shape varies per source: + # + # - reddit: { subreddit: string, author: string } + # - github: { starsToday: number } + # - hacker_news: { points: number, numberComments: number } + # - google_trends: { approxTraffic: number } + # - polymarket: { volume24hr: number } + # - wikipedia: { views: number } + # - trustmrr: { mrr, growthPercent, last30Days, total, customers, + # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?, + # growthMrrPercent?, multiple?, paymentProvider?, rank? } + # + # @return [Hash{Symbol=>Object}] + required :metadata, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] # @!attribute published_at # @@ -25,8 +57,14 @@ class RadarItem < XTwitterScraper::Internal::Type::BaseModel # @!attribute source # + # @return [Symbol, XTwitterScraper::Models::RadarItem::Source] + required :source, enum: -> { XTwitterScraper::RadarItem::Source } + + # @!attribute source_id + # Source-specific identifier used for deduplication. + # # @return [String] - required :source, String + required :source_id, String, api_name: :sourceId # @!attribute title # @@ -48,18 +86,73 @@ class RadarItem < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] 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. + # @!method initialize(id:, category:, created_at:, language:, metadata:, published_at:, region:, score:, source:, source_id:, title:, description: nil, image_url: nil, url: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::RadarItem} for more details. + # + # Trending topic with score, category, source, region, language, and + # source-specific metadata. + # + # @param id [String] Internal numeric identifier (stringified bigint). + # + # @param category [Symbol, XTwitterScraper::Models::RadarItem::Category] + # + # @param created_at [Time] + # + # @param language [String] + # + # @param metadata [Hash{Symbol=>Object}] Source-specific fields. Shape varies per source: # - # @param category [String] # @param published_at [Time] + # # @param region [String] + # # @param score [Float] - # @param source [String] + # + # @param source [Symbol, XTwitterScraper::Models::RadarItem::Source] + # + # @param source_id [String] Source-specific identifier used for deduplication. + # # @param title [String] + # # @param description [String] + # # @param image_url [String] + # # @param url [String] + + # @see XTwitterScraper::Models::RadarItem#category + module Category + extend XTwitterScraper::Internal::Type::Enum + + GENERAL = :general + TECH = :tech + DEV = :dev + SCIENCE = :science + CULTURE = :culture + POLITICS = :politics + BUSINESS = :business + ENTERTAINMENT = :entertainment + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::RadarItem#source + 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_params.rb b/lib/x_twitter_scraper/models/radar_retrieve_trending_topics_params.rb index 8f22c9c..1b337c2 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 @@ -7,24 +7,30 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute category - # Filter by category (general, tech, dev, etc.) + # @!attribute after + # Cursor for pagination (from prior response nextCursor). # # @return [String, nil] - optional :category, String + optional :after, String - # @!attribute count - # Number of items to return + # @!attribute category + # Filter by category. # - # @return [Integer, nil] - optional :count, Integer + # @return [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Category, nil] + optional :category, enum: -> { XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category } # @!attribute hours - # Lookback window in hours + # Lookback window in hours (1-168, default 24). # # @return [Integer, nil] optional :hours, Integer + # @!attribute limit + # Number of items to return (1-100, default 50). + # + # @return [Integer, nil] + optional :limit, Integer + # @!attribute region # Region filter (us, global, etc.) # @@ -38,15 +44,17 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM # @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: {}) + # @!method initialize(after: nil, category: nil, hours: nil, limit: nil, region: nil, source: nil, request_options: {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams} for more details. # - # @param category [String] Filter by category (general, tech, dev, etc.) + # @param after [String] Cursor for pagination (from prior response nextCursor). + # + # @param category [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Category] Filter by category. # - # @param count [Integer] Number of items to return + # @param hours [Integer] Lookback window in hours (1-168, default 24). # - # @param hours [Integer] Lookback window in hours + # @param limit [Integer] Number of items to return (1-100, default 50). # # @param region [String] Region filter (us, global, etc.) # @@ -54,6 +62,23 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Filter by category. + module Category + extend XTwitterScraper::Internal::Type::Enum + + GENERAL = :general + TECH = :tech + DEV = :dev + SCIENCE = :science + CULTURE = :culture + POLITICS = :politics + BUSINESS = :business + ENTERTAINMENT = :entertainment + + # @!method self.values + # @return [Array] + end + # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia module Source 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 d37de6e..ab11e7d 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 @@ -4,19 +4,28 @@ module XTwitterScraper module Models # @see XTwitterScraper::Resources::Radar#retrieve_trending_topics class RadarRetrieveTrendingTopicsResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute has_more + # + # @return [Boolean] + required :has_more, XTwitterScraper::Internal::Type::Boolean, api_name: :hasMore + # @!attribute items # # @return [Array] required :items, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::RadarItem] } - # @!attribute total + # @!attribute next_cursor + # Opaque cursor for the next page (present only when hasMore is true). # - # @return [Integer] - required :total, Integer + # @return [String, nil] + optional :next_cursor, String, api_name: :nextCursor - # @!method initialize(items:, total:) + # @!method initialize(has_more:, items:, next_cursor: nil) + # @param has_more [Boolean] + # # @param items [Array] - # @param total [Integer] + # + # @param next_cursor [String] Opaque cursor for the next page (present only when hasMore is true). end end end diff --git a/lib/x_twitter_scraper/models/search_tweet.rb b/lib/x_twitter_scraper/models/search_tweet.rb new file mode 100644 index 0000000..04fb0ae --- /dev/null +++ b/lib/x_twitter_scraper/models/search_tweet.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class SearchTweet < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute text + # + # @return [String] + required :text, String + + # @!attribute author + # + # @return [XTwitterScraper::Models::SearchTweet::Author, nil] + optional :author, -> { XTwitterScraper::SearchTweet::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 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] + 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, 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::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::SearchTweet#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 diff --git a/lib/x_twitter_scraper/models/trend_list_params.rb b/lib/x_twitter_scraper/models/trend_list_params.rb index 7219bed..f205164 100644 --- a/lib/x_twitter_scraper/models/trend_list_params.rb +++ b/lib/x_twitter_scraper/models/trend_list_params.rb @@ -8,21 +8,24 @@ class TrendListParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute count - # Number of trending topics to return (1-50, default 30) + # Number of trending topics returned (1-50, default 30) # # @return [Integer, nil] optional :count, Integer # @!attribute woeid - # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) # # @return [Integer, nil] optional :woeid, Integer # @!method initialize(count: nil, woeid: nil, request_options: {}) - # @param count [Integer] Number of trending topics to return (1-50, default 30) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::TrendListParams} for more details. # - # @param woeid [Integer] Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # @param count [Integer] Number of trending topics returned (1-50, default 30) + # + # @param woeid [Integer] Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/user_profile.rb b/lib/x_twitter_scraper/models/user_profile.rb new file mode 100644 index 0000000..1e5ec2d --- /dev/null +++ b/lib/x_twitter_scraper/models/user_profile.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class UserProfile < 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) + # X user profile with bio, follower counts, and verification status. + # + # @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 diff --git a/lib/x_twitter_scraper/models/x/account_create_response.rb b/lib/x_twitter_scraper/models/x/account_create_response.rb index 1d3b02f..783e6be 100644 --- a/lib/x_twitter_scraper/models/x/account_create_response.rb +++ b/lib/x_twitter_scraper/models/x/account_create_response.rb @@ -10,6 +10,16 @@ class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute health + # + # @return [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::Health] + required :health, enum: -> { XTwitterScraper::Models::X::AccountCreateResponse::Health } + # @!attribute status # # @return [String] @@ -25,11 +35,52 @@ class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!method initialize(id:, status:, x_user_id:, x_username:) + # @!attribute login_country + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + # + # @return [String, nil] + optional :login_country, String, api_name: :loginCountry + + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, login_country: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::AccountCreateResponse} for more details. + # + # Sanitized X account summary returned by connect and reauth. Includes an optional + # `loginCountry` field surfaced only when the declared proxy region had no Driver + # capacity and the login fell back to a single US consumer device for this + # one-time action. Future activity continues to use the selected `proxy_country`; + # the field is omitted on normal logins. + # # @param id [String] + # + # @param created_at [Time] + # + # @param health [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::Health] + # # @param status [String] + # # @param x_user_id [String] + # # @param x_username [String] + # + # @param login_country [String] ISO-3166-1 alpha-2 country code of the Driver consumer device used for this logi + + # @see XTwitterScraper::Models::X::AccountCreateResponse#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end 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 90107bc..1db8565 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_params.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_params.rb @@ -19,17 +19,33 @@ class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :password, String + # @!attribute email + # Email for the X account (updates stored email) + # + # @return [String, nil] + optional :email, String + + # @!attribute proxy_country + # Two-letter country code for login proxy region + # + # @return [String, nil] + optional :proxy_country, String + # @!attribute totp_secret # TOTP secret for 2FA re-authentication # # @return [String, nil] optional :totp_secret, String - # @!method initialize(id:, password:, totp_secret: nil, request_options: {}) + # @!method initialize(id:, password:, email: nil, proxy_country: nil, totp_secret: nil, request_options: {}) # @param id [String] # # @param password [String] Updated account password # + # @param email [String] Email for the X account (updates stored email) + # + # @param proxy_country [String] Two-letter country code for login proxy region + # # @param totp_secret [String] TOTP secret for 2FA re-authentication # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/x_twitter_scraper/models/x/account_reauth_response.rb b/lib/x_twitter_scraper/models/x/account_reauth_response.rb index 46d6e73..e4b9f8d 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_response.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_response.rb @@ -10,20 +10,77 @@ class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute health + # + # @return [Symbol, XTwitterScraper::Models::X::AccountReauthResponse::Health] + required :health, enum: -> { XTwitterScraper::Models::X::AccountReauthResponse::Health } + # @!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:, status:, x_username:) + # @!attribute login_country + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + # + # @return [String, nil] + optional :login_country, String, api_name: :loginCountry + + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, login_country: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::AccountReauthResponse} for more details. + # + # Sanitized X account summary returned by connect and reauth. Includes an optional + # `loginCountry` field surfaced only when the declared proxy region had no Driver + # capacity and the login fell back to a single US consumer device for this + # one-time action. Future activity continues to use the selected `proxy_country`; + # the field is omitted on normal logins. + # # @param id [String] + # + # @param created_at [Time] + # + # @param health [Symbol, XTwitterScraper::Models::X::AccountReauthResponse::Health] + # # @param status [String] + # + # @param x_user_id [String] + # # @param x_username [String] + # + # @param login_country [String] ISO-3166-1 alpha-2 country code of the Driver consumer device used for this logi + + # @see XTwitterScraper::Models::X::AccountReauthResponse#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb b/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb index 5291e62..80223f0 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb @@ -19,11 +19,19 @@ class CommunityRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseMode # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Items per page (20-200, default 20) + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) # @param id [String] # # @param cursor [String] Pagination cursor # + # @param page_size [Integer] Items per page (20-200, default 20) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 663b6cb..91691a6 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 @@ -19,11 +19,19 @@ class ListRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Members per page (20-200, default 20) + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) # @param id [String] # # @param cursor [String] Pagination cursor for list members # + # @param page_size [Integer] Members per page (20-200, default 20) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/search_tweet.rb b/lib/x_twitter_scraper/models/x/search_tweet.rb deleted file mode 100644 index 9f6f293..0000000 --- a/lib/x_twitter_scraper/models/x/search_tweet.rb +++ /dev/null @@ -1,119 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - class SearchTweet < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute text - # - # @return [String] - required :text, String - - # @!attribute author - # - # @return [XTwitterScraper::Models::X::SearchTweet::Author, nil] - optional :author, -> { XTwitterScraper::X::SearchTweet::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 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] - 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, 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 - 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/tweet_create_params.rb b/lib/x_twitter_scraper/models/x/tweet_create_params.rb index 2c9d732..59f71ec 100644 --- a/lib/x_twitter_scraper/models/x/tweet_create_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_create_params.rb @@ -14,11 +14,6 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!attribute text - # - # @return [String] - required :text, String - # @!attribute attachment_url # # @return [String, nil] @@ -34,20 +29,29 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_note_tweet, XTwitterScraper::Internal::Type::Boolean - # @!attribute media_ids + # @!attribute media + # Array of public image URLs to attach (max 4). Each URL must be publicly + # reachable - the browser composer fetches them directly. # # @return [Array, nil] - optional :media_ids, XTwitterScraper::Internal::Type::ArrayOf[String] + optional :media, XTwitterScraper::Internal::Type::ArrayOf[String] # @!attribute reply_to_tweet_id # # @return [String, nil] optional :reply_to_tweet_id, String - # @!method initialize(account:, text:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media_ids: nil, reply_to_tweet_id: nil, request_options: {}) - # @param account [String] X account (@username or account ID) + # @!attribute text + # Tweet text (optional when media is provided) # - # @param text [String] + # @return [String, nil] + optional :text, String + + # @!method initialize(account:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetCreateParams} for more details. + # + # @param account [String] X account (@username or account ID) # # @param attachment_url [String] # @@ -55,10 +59,12 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # # @param is_note_tweet [Boolean] # - # @param media_ids [Array] + # @param media [Array] Array of public image URLs to attach (max 4). Each URL must be publicly reachabl # # @param reply_to_tweet_id [String] # + # @param text [String] Tweet text (optional when media is provided) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 0704d7c..de9d93c 100644 --- a/lib/x_twitter_scraper/models/x/tweet_search_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_search_params.rb @@ -27,19 +27,19 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel optional :limit, Integer # @!attribute query_type - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) # # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType, nil] optional :query_type, enum: -> { XTwitterScraper::X::TweetSearchParams::QueryType } # @!attribute since_time - # ISO 8601 timestamp — only return tweets after this time + # ISO 8601 timestamp - only return tweets after this time # # @return [String, nil] optional :since_time, String # @!attribute until_time - # ISO 8601 timestamp — only return tweets before this time + # ISO 8601 timestamp - only return tweets before this time # # @return [String, nil] optional :until_time, String @@ -51,15 +51,15 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel # # @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) + # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order - Latest (chronological) or Top (engagement-ranked) # - # @param since_time [String] ISO 8601 timestamp — only return tweets after this time + # @param since_time [String] ISO 8601 timestamp - only return tweets after this time # - # @param until_time [String] ISO 8601 timestamp — only return tweets before this time + # @param until_time [String] ISO 8601 timestamp - only return tweets before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) module QueryType extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/x/user_profile.rb b/lib/x_twitter_scraper/models/x/user_profile.rb deleted file mode 100644 index b570228..0000000 --- a/lib/x_twitter_scraper/models/x/user_profile.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - # @see XTwitterScraper::Resources::X::Users#retrieve - class UserProfile < 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) - # X user profile with bio, follower counts, and verification status. - # - # @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/x_account.rb b/lib/x_twitter_scraper/models/x/x_account.rb index 3e3e1b9..54ad7f8 100644 --- a/lib/x_twitter_scraper/models/x/x_account.rb +++ b/lib/x_twitter_scraper/models/x/x_account.rb @@ -14,6 +14,16 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # @return [Time] required :created_at, Time, api_name: :createdAt + # @!attribute health + # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user + # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # first. `suspended` = X banned the account. `recovering` = past cooldown, will + # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # shortly. + # + # @return [Symbol, XTwitterScraper::Models::X::XAccount::Health] + required :health, enum: -> { XTwitterScraper::X::XAccount::Health } + # @!attribute status # # @return [String] @@ -29,14 +39,44 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!method initialize(id:, created_at:, status:, x_user_id:, x_username:) + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::XAccount} for more details. + # # Linked X account summary with username and connection status. # # @param id [String] + # # @param created_at [Time] + # + # @param health [Symbol, XTwitterScraper::Models::X::XAccount::Health] Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user mus + # # @param status [String] + # # @param x_user_id [String] + # # @param x_username [String] + + # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user + # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # first. `suspended` = X banned the account. `recovering` = past cooldown, will + # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # shortly. + # + # @see XTwitterScraper::Models::X::XAccount#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end end end 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 4b7e069..2090e0c 100644 --- a/lib/x_twitter_scraper/models/x/x_account_detail.rb +++ b/lib/x_twitter_scraper/models/x/x_account_detail.rb @@ -15,6 +15,11 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Time] required :created_at, Time, api_name: :createdAt + # @!attribute health + # + # @return [Symbol, XTwitterScraper::Models::X::XAccountDetail::Health] + required :health, enum: -> { XTwitterScraper::X::XAccountDetail::Health } + # @!attribute status # # @return [String] @@ -45,17 +50,33 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel # @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) + # @!method initialize(id:, created_at:, health:, 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 health [Symbol, XTwitterScraper::Models::X::XAccountDetail::Health] # @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] + + # @see XTwitterScraper::Models::X::XAccountDetail#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end end end diff --git a/lib/x_twitter_scraper/models/x_get_trends_params.rb b/lib/x_twitter_scraper/models/x_get_trends_params.rb index 047a151..5f0b25c 100644 --- a/lib/x_twitter_scraper/models/x_get_trends_params.rb +++ b/lib/x_twitter_scraper/models/x_get_trends_params.rb @@ -7,7 +7,23 @@ class XGetTrendsParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!method initialize(request_options: {}) + # @!attribute count + # Number of trending topics to return (1-50, default 30) + # + # @return [Integer, nil] + optional :count, Integer + + # @!attribute woeid + # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # + # @return [Integer, nil] + optional :woeid, Integer + + # @!method initialize(count: nil, woeid: nil, request_options: {}) + # @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) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/resources/account.rb b/lib/x_twitter_scraper/resources/account.rb index aec9f9a..1c60299 100644 --- a/lib/x_twitter_scraper/resources/account.rb +++ b/lib/x_twitter_scraper/resources/account.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Account info & settings + # Account info and settings class Account # Get account info # @@ -18,7 +18,6 @@ def retrieve(params = {}) method: :get, path: "account", model: XTwitterScraper::Models::AccountRetrieveResponse, - security: {auth_api_key: true}, options: params[:request_options] ) end @@ -62,7 +61,6 @@ def update_locale(params) path: "account", body: parsed, model: XTwitterScraper::Models::AccountUpdateLocaleResponse, - security: {auth_api_key: true}, options: options ) end diff --git a/lib/x_twitter_scraper/resources/api_keys.rb b/lib/x_twitter_scraper/resources/api_keys.rb index e2e4882..49feecb 100644 --- a/lib/x_twitter_scraper/resources/api_keys.rb +++ b/lib/x_twitter_scraper/resources/api_keys.rb @@ -21,7 +21,6 @@ def create(params = {}) path: "api-keys", body: parsed, model: XTwitterScraper::Models::APIKeyCreateResponse, - security: {auth_api_key: true}, options: options ) end @@ -40,7 +39,6 @@ def list(params = {}) method: :get, path: "api-keys", model: XTwitterScraper::Models::APIKeyListResponse, - security: {auth_api_key: true}, options: params[:request_options] ) end @@ -61,7 +59,6 @@ def revoke(id, params = {}) method: :delete, path: ["api-keys/%1$s", id], model: XTwitterScraper::Models::APIKeyRevokeResponse, - security: {auth_api_key: true}, options: params[:request_options] ) end diff --git a/lib/x_twitter_scraper/resources/bot.rb b/lib/x_twitter_scraper/resources/bot.rb deleted file mode 100644 index fe21274..0000000 --- a/lib/x_twitter_scraper/resources/bot.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Resources - class Bot - # @return [XTwitterScraper::Resources::Bot::PlatformLinks] - attr_reader :platform_links - - # @api private - # - # @param client [XTwitterScraper::Client] - def initialize(client:) - @client = client - @platform_links = XTwitterScraper::Resources::Bot::PlatformLinks.new(client: client) - end - end - end -end diff --git a/lib/x_twitter_scraper/resources/bot/platform_links.rb b/lib/x_twitter_scraper/resources/bot/platform_links.rb deleted file mode 100644 index f855e96..0000000 --- a/lib/x_twitter_scraper/resources/bot/platform_links.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Resources - class Bot - class PlatformLinks - # @api private - # - # @param client [XTwitterScraper::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/x_twitter_scraper/resources/compose.rb b/lib/x_twitter_scraper/resources/compose.rb index efaeace..f139641 100644 --- a/lib/x_twitter_scraper/resources/compose.rb +++ b/lib/x_twitter_scraper/resources/compose.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Compose # Compose, refine, or score a tweet # diff --git a/lib/x_twitter_scraper/resources/credits.rb b/lib/x_twitter_scraper/resources/credits.rb index d21b84d..f331bf8 100644 --- a/lib/x_twitter_scraper/resources/credits.rb +++ b/lib/x_twitter_scraper/resources/credits.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Subscription & billing + # Subscription, billing, and credits class Credits # Get credits balance # diff --git a/lib/x_twitter_scraper/resources/drafts.rb b/lib/x_twitter_scraper/resources/drafts.rb index cd46d58..0c0eab8 100644 --- a/lib/x_twitter_scraper/resources/drafts.rb +++ b/lib/x_twitter_scraper/resources/drafts.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Drafts # Save a tweet draft # diff --git a/lib/x_twitter_scraper/resources/events.rb b/lib/x_twitter_scraper/resources/events.rb index 213f663..eb43f1e 100644 --- a/lib/x_twitter_scraper/resources/events.rb +++ b/lib/x_twitter_scraper/resources/events.rb @@ -49,7 +49,6 @@ def list(params = {}) path: "events", query: query.transform_keys(event_type: "eventType", monitor_id: "monitorId"), model: XTwitterScraper::Models::EventListResponse, - security: {auth_api_key: true}, options: options ) end diff --git a/lib/x_twitter_scraper/resources/integrations.rb b/lib/x_twitter_scraper/resources/integrations.rb deleted file mode 100644 index 286abbe..0000000 --- a/lib/x_twitter_scraper/resources/integrations.rb +++ /dev/null @@ -1,182 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Resources - # Push notification integrations (Telegram) - class Integrations - # Create integration - # - # @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] Array of event types to subscribe to. - # - # @param name [String] - # - # @param type [Symbol, :telegram] - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::Integration] - # - # @see XTwitterScraper::Models::IntegrationCreateParams - def create(params) - parsed, options = XTwitterScraper::IntegrationCreateParams.dump_request(params) - @client.request( - method: :post, - path: "integrations", - body: parsed, - model: XTwitterScraper::Integration, - options: options - ) - end - - # Get integration details - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] Resource ID (stringified bigint) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::Integration] - # - # @see XTwitterScraper::Models::IntegrationRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["integrations/%1$s", id], - model: XTwitterScraper::Integration, - options: params[:request_options] - ) - end - - # Update integration - # - # @overload update(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] Resource ID (stringified bigint) - # - # @param event_types [Array] Array of event types to subscribe to. - # - # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) - # - # @param is_active [Boolean] - # - # @param message_template [Hash{Symbol=>Object}] Custom message template (JSON) - # - # @param name [String] - # - # @param scope_all_monitors [Boolean] - # - # @param silent_push [Boolean] - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::Integration] - # - # @see XTwitterScraper::Models::IntegrationUpdateParams - def update(id, params = {}) - parsed, options = XTwitterScraper::IntegrationUpdateParams.dump_request(params) - @client.request( - method: :patch, - path: ["integrations/%1$s", id], - body: parsed, - model: XTwitterScraper::Integration, - options: options - ) - end - - # List integrations - # - # @overload list(request_options: {}) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::IntegrationListResponse] - # - # @see XTwitterScraper::Models::IntegrationListParams - def list(params = {}) - @client.request( - method: :get, - path: "integrations", - model: XTwitterScraper::Models::IntegrationListResponse, - options: params[:request_options] - ) - end - - # Delete integration - # - # @overload delete(id, request_options: {}) - # - # @param id [String] Resource ID (stringified bigint) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::IntegrationDeleteResponse] - # - # @see XTwitterScraper::Models::IntegrationDeleteParams - def delete(id, params = {}) - @client.request( - method: :delete, - path: ["integrations/%1$s", id], - model: XTwitterScraper::Models::IntegrationDeleteResponse, - options: params[:request_options] - ) - end - - # List integration delivery history - # - # @overload list_deliveries(id, limit: nil, request_options: {}) - # - # @param id [String] Resource ID (stringified bigint) - # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::IntegrationListDeliveriesResponse] - # - # @see XTwitterScraper::Models::IntegrationListDeliveriesParams - def list_deliveries(id, params = {}) - parsed, options = XTwitterScraper::IntegrationListDeliveriesParams.dump_request(params) - query = XTwitterScraper::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: ["integrations/%1$s/deliveries", id], - query: query, - model: XTwitterScraper::Models::IntegrationListDeliveriesResponse, - options: options - ) - end - - # Send test delivery - # - # @overload send_test(id, request_options: {}) - # - # @param id [String] Resource ID (stringified bigint) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::IntegrationSendTestResponse] - # - # @see XTwitterScraper::Models::IntegrationSendTestParams - def send_test(id, params = {}) - @client.request( - method: :post, - path: ["integrations/%1$s/test", id], - model: XTwitterScraper::Models::IntegrationSendTestResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [XTwitterScraper::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/x_twitter_scraper/resources/radar.rb b/lib/x_twitter_scraper/resources/radar.rb index 88632a5..dc85e64 100644 --- a/lib/x_twitter_scraper/resources/radar.rb +++ b/lib/x_twitter_scraper/resources/radar.rb @@ -2,20 +2,22 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Radar # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams} for more details. # # Get trending topics from curated sources # - # @overload retrieve_trending_topics(category: nil, count: nil, hours: nil, region: nil, source: nil, request_options: {}) + # @overload retrieve_trending_topics(after: nil, category: nil, hours: nil, limit: nil, region: nil, source: nil, request_options: {}) # - # @param category [String] Filter by category (general, tech, dev, etc.) + # @param after [String] Cursor for pagination (from prior response nextCursor). # - # @param count [Integer] Number of items to return + # @param category [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Category] Filter by category. # - # @param hours [Integer] Lookback window in hours + # @param hours [Integer] Lookback window in hours (1-168, default 24). + # + # @param limit [Integer] Number of items to return (1-100, default 50). # # @param region [String] Region filter (us, global, etc.) # diff --git a/lib/x_twitter_scraper/resources/styles.rb b/lib/x_twitter_scraper/resources/styles.rb index 59708df..6e08571 100644 --- a/lib/x_twitter_scraper/resources/styles.rb +++ b/lib/x_twitter_scraper/resources/styles.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Styles # Get cached style profile # diff --git a/lib/x_twitter_scraper/resources/subscribe.rb b/lib/x_twitter_scraper/resources/subscribe.rb index cd597c4..a9aa0ef 100644 --- a/lib/x_twitter_scraper/resources/subscribe.rb +++ b/lib/x_twitter_scraper/resources/subscribe.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Subscription & billing + # Subscription, billing, and credits class Subscribe # Get checkout or billing URL # diff --git a/lib/x_twitter_scraper/resources/trends.rb b/lib/x_twitter_scraper/resources/trends.rb index 134894e..9887ded 100644 --- a/lib/x_twitter_scraper/resources/trends.rb +++ b/lib/x_twitter_scraper/resources/trends.rb @@ -2,15 +2,18 @@ module XTwitterScraper module Resources - # Trending topics by region + # Trending topics and hashtags by region class Trends - # Get regional trending topics + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::TrendListParams} for more details. + # + # Get trending hashtags & topics by region (alias) # # @overload list(count: nil, woeid: nil, request_options: {}) # - # @param count [Integer] Number of trending topics to return (1-50, default 30) + # @param count [Integer] Number of trending topics returned (1-50, default 30) # - # @param woeid [Integer] Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # @param woeid [Integer] Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/webhooks.rb b/lib/x_twitter_scraper/resources/webhooks.rb index e3bd142..5d96ef4 100644 --- a/lib/x_twitter_scraper/resources/webhooks.rb +++ b/lib/x_twitter_scraper/resources/webhooks.rb @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Webhook endpoint management & delivery + # Webhook endpoint management and delivery class Webhooks # Create webhook # diff --git a/lib/x_twitter_scraper/resources/x.rb b/lib/x_twitter_scraper/resources/x.rb index 61f73cf..1b44dce 100644 --- a/lib/x_twitter_scraper/resources/x.rb +++ b/lib/x_twitter_scraper/resources/x.rb @@ -2,23 +2,22 @@ module XTwitterScraper module Resources - # X data lookups (subscription required) class X # @return [XTwitterScraper::Resources::X::Tweets] attr_reader :tweets - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships # @return [XTwitterScraper::Resources::X::Users] attr_reader :users - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships # @return [XTwitterScraper::Resources::X::Followers] attr_reader :followers # @return [XTwitterScraper::Resources::X::Dm] attr_reader :dm - # Media upload & download + # Media upload and download # @return [XTwitterScraper::Resources::X::Media] attr_reader :media @@ -33,11 +32,11 @@ class X # @return [XTwitterScraper::Resources::X::Accounts] attr_reader :accounts - # X data lookups (subscription required) + # Look up, search, and analyze individual tweets # @return [XTwitterScraper::Resources::X::Bookmarks] attr_reader :bookmarks - # X data lookups (subscription required) + # X List followers, members, and tweets # @return [XTwitterScraper::Resources::X::Lists] attr_reader :lists @@ -111,9 +110,13 @@ def get_notifications(params = {}) ) end - # Get trending topics + # Get trending hashtags & topics from X by region # - # @overload get_trends(request_options: {}) + # @overload get_trends(count: nil, woeid: nil, request_options: {}) + # + # @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) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -121,11 +124,14 @@ def get_notifications(params = {}) # # @see XTwitterScraper::Models::XGetTrendsParams def get_trends(params = {}) + parsed, options = XTwitterScraper::XGetTrendsParams.dump_request(params) + query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "x/trends", + query: query, model: XTwitterScraper::Models::XGetTrendsResponse, - options: params[:request_options] + options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/accounts.rb b/lib/x_twitter_scraper/resources/x/accounts.rb index ef832fb..1bcc4ca 100644 --- a/lib/x_twitter_scraper/resources/x/accounts.rb +++ b/lib/x_twitter_scraper/resources/x/accounts.rb @@ -31,7 +31,6 @@ def create(params) path: "x/accounts", body: parsed, model: XTwitterScraper::Models::X::AccountCreateResponse, - security: {auth_api_key: true}, options: options ) end @@ -52,7 +51,6 @@ def retrieve(id, params = {}) method: :get, path: ["x/accounts/%1$s", id], model: XTwitterScraper::X::XAccountDetail, - security: {auth_api_key: true}, options: params[:request_options] ) end @@ -71,7 +69,6 @@ def list(params = {}) method: :get, path: "x/accounts", model: XTwitterScraper::Models::X::AccountListResponse, - security: {auth_api_key: true}, options: params[:request_options] ) end @@ -92,7 +89,6 @@ def delete(id, params = {}) method: :delete, path: ["x/accounts/%1$s", id], model: XTwitterScraper::Models::X::AccountDeleteResponse, - security: {auth_api_key: true}, options: params[:request_options] ) end @@ -112,19 +108,22 @@ def bulk_retry(params = {}) 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: {}) + # @overload reauth(id, password:, email: nil, proxy_country: nil, totp_secret: nil, request_options: {}) # # @param id [String] Resource ID (stringified bigint) # # @param password [String] Updated account password # + # @param email [String] Email for the X account (updates stored email) + # + # @param proxy_country [String] Two-letter country code for login proxy region + # # @param totp_secret [String] TOTP secret for 2FA re-authentication # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] @@ -139,7 +138,6 @@ def reauth(id, params) path: ["x/accounts/%1$s/reauth", id], body: parsed, model: XTwitterScraper::Models::X::AccountReauthResponse, - security: {auth_api_key: true}, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/bookmarks.rb b/lib/x_twitter_scraper/resources/x/bookmarks.rb index f46ff83..e605c08 100644 --- a/lib/x_twitter_scraper/resources/x/bookmarks.rb +++ b/lib/x_twitter_scraper/resources/x/bookmarks.rb @@ -3,7 +3,7 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and analyze individual tweets class Bookmarks # Get bookmarked tweets # diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index 7c899df..7de9202 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -8,7 +8,7 @@ class Communities # @return [XTwitterScraper::Resources::X::Communities::Join] attr_reader :join - # X data lookups (subscription required) + # X Community info, members, and tweets # @return [XTwitterScraper::Resources::X::Communities::Tweets] attr_reader :tweets @@ -64,7 +64,7 @@ def delete(id, params) ) end - # Get community details + # Get community name, description & member count # # @overload retrieve_info(id, request_options: {}) # @@ -84,14 +84,16 @@ def retrieve_info(id, params = {}) ) end - # Get community members + # List members of a community # - # @overload retrieve_members(id, cursor: nil, request_options: {}) + # @overload retrieve_members(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] Community ID for member lookup # # @param cursor [String] Pagination cursor # + # @param page_size [Integer] Items per page (20-200, default 20) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -103,13 +105,13 @@ def retrieve_members(id, params = {}) @client.request( method: :get, path: ["x/communities/%1$s/members", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) end - # Get community moderators + # List moderators of a community # # @overload retrieve_moderators(id, cursor: nil, request_options: {}) # @@ -134,7 +136,7 @@ def retrieve_moderators(id, params = {}) ) end - # Search tweets across communities + # Search for communities by keyword # # @overload retrieve_search(q:, cursor: nil, query_type: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/communities/tweets.rb b/lib/x_twitter_scraper/resources/x/communities/tweets.rb index 615b6de..d268fd9 100644 --- a/lib/x_twitter_scraper/resources/x/communities/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/communities/tweets.rb @@ -4,9 +4,9 @@ module XTwitterScraper module Resources class X class Communities - # X data lookups (subscription required) + # X Community info, members, and tweets class Tweets - # Search tweets across all communities + # List tweets across all communities # # @overload list(q:, cursor: nil, query_type: nil, request_options: {}) # @@ -33,7 +33,7 @@ def list(params) ) end - # Get community tweets + # List tweets posted in a community # # @overload list_by_community(id, cursor: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/followers.rb b/lib/x_twitter_scraper/resources/x/followers.rb index 7f6d681..c5c1ec1 100644 --- a/lib/x_twitter_scraper/resources/x/followers.rb +++ b/lib/x_twitter_scraper/resources/x/followers.rb @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships class Followers - # Check follow relationship + # Check if one user follows another # # @overload check(source:, target:, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/lists.rb b/lib/x_twitter_scraper/resources/x/lists.rb index 785b207..36e4299 100644 --- a/lib/x_twitter_scraper/resources/x/lists.rb +++ b/lib/x_twitter_scraper/resources/x/lists.rb @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # X List followers, members, and tweets class Lists - # Get list followers + # List followers of an X List # # @overload retrieve_followers(id, cursor: nil, request_options: {}) # @@ -30,14 +30,16 @@ def retrieve_followers(id, params = {}) ) end - # Get list members + # List members of an X List # - # @overload retrieve_members(id, cursor: nil, request_options: {}) + # @overload retrieve_members(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] List ID for member lookup # # @param cursor [String] Pagination cursor for list members # + # @param page_size [Integer] Members per page (20-200, default 20) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -49,13 +51,13 @@ def retrieve_members(id, params = {}) @client.request( method: :get, path: ["x/lists/%1$s/members", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) end - # Get list tweets + # List tweets from an X List # # @overload retrieve_tweets(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/media.rb b/lib/x_twitter_scraper/resources/x/media.rb index 10af42c..6545393 100644 --- a/lib/x_twitter_scraper/resources/x/media.rb +++ b/lib/x_twitter_scraper/resources/x/media.rb @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # Media upload & download + # Media upload and download class Media - # Download tweet media + # Download images & videos from tweets # # @overload download(tweet_ids: nil, tweet_input: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index 2ab9e5d..777260d 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -12,24 +12,27 @@ class Tweets # @return [XTwitterScraper::Resources::X::Tweets::Retweet] attr_reader :retweet + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetCreateParams} for more details. + # # Create tweet # - # @overload create(account:, text:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media_ids: nil, reply_to_tweet_id: nil, request_options: {}) + # @overload create(account:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) # # @param account [String] X account (@username or account ID) # - # @param text [String] - # # @param attachment_url [String] # # @param community_id [String] # # @param is_note_tweet [Boolean] # - # @param media_ids [Array] + # @param media [Array] Array of public image URLs to attach (max 4). Each URL must be publicly reachabl # # @param reply_to_tweet_id [String] # + # @param text [String] Tweet text (optional when media is provided) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::TweetCreateResponse] @@ -46,7 +49,7 @@ def create(params) ) end - # Look up tweet + # Get tweet with full text, author, metrics & media # # @overload retrieve(id, request_options: {}) # @@ -113,7 +116,7 @@ def delete(id, params) ) end - # Get users who liked a tweet + # List users who liked a tweet # # @overload get_favoriters(id, cursor: nil, request_options: {}) # @@ -138,7 +141,7 @@ def get_favoriters(id, params = {}) ) end - # Get quote tweets of a tweet + # List quote tweets of a tweet # # @overload get_quotes(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) # @@ -173,7 +176,7 @@ def get_quotes(id, params = {}) ) end - # Get replies to a tweet + # List replies to a tweet # # @overload get_replies(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # @@ -202,7 +205,7 @@ def get_replies(id, params = {}) ) end - # Get users who retweeted a tweet + # List users who retweeted a tweet # # @overload get_retweeters(id, cursor: nil, request_options: {}) # @@ -227,7 +230,7 @@ def get_retweeters(id, params = {}) ) end - # Get thread context for a tweet + # Get full conversation thread for a tweet # # @overload get_thread(id, cursor: nil, request_options: {}) # @@ -252,7 +255,7 @@ def get_thread(id, params = {}) ) end - # Search tweets + # Search tweets with X query operators & pagination # # @overload search(q:, cursor: nil, limit: nil, query_type: nil, since_time: nil, until_time: nil, request_options: {}) # @@ -262,11 +265,11 @@ def get_thread(id, params = {}) # # @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) + # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order - Latest (chronological) or Top (engagement-ranked) # - # @param since_time [String] ISO 8601 timestamp — only return tweets after this time + # @param since_time [String] ISO 8601 timestamp - only return tweets after this time # - # @param until_time [String] ISO 8601 timestamp — only return tweets before this time + # @param until_time [String] ISO 8601 timestamp - only return tweets before this time # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index 4fb06d8..f9e7067 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -3,13 +3,13 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships class Users # X write actions (tweets, likes, follows, DMs) # @return [XTwitterScraper::Resources::X::Users::Follow] attr_reader :follow - # Look up X user + # Get user profile with follower counts & verification # # @overload retrieve(id, request_options: {}) # @@ -17,19 +17,19 @@ class Users # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::UserProfile] + # @return [XTwitterScraper::Models::UserProfile] # # @see XTwitterScraper::Models::X::UserRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s", id], - model: XTwitterScraper::X::UserProfile, + model: XTwitterScraper::UserProfile, options: params[:request_options] ) end - # Get multiple users by IDs + # Look up multiple users by IDs in one call # # @overload retrieve_batch(ids:, request_options: {}) # @@ -52,7 +52,7 @@ def retrieve_batch(params) ) end - # Get user followers + # List followers of a user # # @overload retrieve_followers(id, cursor: nil, page_size: nil, request_options: {}) # @@ -79,7 +79,7 @@ def retrieve_followers(id, params = {}) ) end - # Get followers you know for a user + # List mutual followers between you and a user # # @overload retrieve_followers_you_know(id, cursor: nil, request_options: {}) # @@ -104,7 +104,7 @@ def retrieve_followers_you_know(id, params = {}) ) end - # Get users this user follows + # List accounts a user follows # # @overload retrieve_following(id, cursor: nil, page_size: nil, request_options: {}) # @@ -131,7 +131,7 @@ def retrieve_following(id, params = {}) ) end - # Get tweets liked by a user + # List tweets liked by a user # # @overload retrieve_likes(id, cursor: nil, request_options: {}) # @@ -156,7 +156,7 @@ def retrieve_likes(id, params = {}) ) end - # Get media tweets by a user + # List media tweets posted by a user # # @overload retrieve_media(id, cursor: nil, request_options: {}) # @@ -181,7 +181,7 @@ def retrieve_media(id, params = {}) ) end - # Get tweets mentioning a user + # List tweets mentioning a user # # @overload retrieve_mentions(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) # @@ -235,7 +235,7 @@ def retrieve_search(params) ) end - # Get recent tweets by a user + # List recent tweets posted by a user # # @overload retrieve_tweets(id, cursor: nil, include_parent_tweet: nil, include_replies: nil, request_options: {}) # @@ -267,7 +267,7 @@ def retrieve_tweets(id, params = {}) ) end - # Get verified followers + # List verified followers of a user # # @overload retrieve_verified_followers(id, cursor: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/version.rb b/lib/x_twitter_scraper/version.rb index f1c59b7..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.4.1" + VERSION = "0.4.0" end diff --git a/rbi/x_twitter_scraper/client.rbi b/rbi/x_twitter_scraper/client.rbi index c3e89d9..88a7076 100644 --- a/rbi/x_twitter_scraper/client.rbi +++ b/rbi/x_twitter_scraper/client.rbi @@ -17,7 +17,7 @@ module XTwitterScraper sig { returns(T.nilable(String)) } attr_reader :bearer_token - # Account info & settings + # Account info and settings sig { returns(XTwitterScraper::Resources::Account) } attr_reader :account @@ -25,23 +25,23 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::APIKeys) } attr_reader :api_keys - # Subscription & billing + # Subscription, billing, and credits sig { returns(XTwitterScraper::Resources::Subscribe) } attr_reader :subscribe - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar sig { returns(XTwitterScraper::Resources::Compose) } attr_reader :compose - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar sig { returns(XTwitterScraper::Resources::Drafts) } attr_reader :drafts - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar sig { returns(XTwitterScraper::Resources::Styles) } attr_reader :styles - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar sig { returns(XTwitterScraper::Resources::Radar) } attr_reader :radar @@ -61,44 +61,27 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::Draws) } attr_reader :draws - # Webhook endpoint management & delivery + # Webhook endpoint management and delivery sig { returns(XTwitterScraper::Resources::Webhooks) } attr_reader :webhooks - # Push notification integrations (Telegram) - sig { returns(XTwitterScraper::Resources::Integrations) } - attr_reader :integrations - - # X data lookups (subscription required) sig { returns(XTwitterScraper::Resources::X) } attr_reader :x - # Trending topics by region + # Trending topics and hashtags by region sig { returns(XTwitterScraper::Resources::Trends) } attr_reader :trends - sig { returns(XTwitterScraper::Resources::Bot) } - attr_reader :bot - sig { returns(XTwitterScraper::Resources::Support) } attr_reader :support - # Subscription & billing + # Subscription, billing, and credits sig { returns(XTwitterScraper::Resources::Credits) } attr_reader :credits # @api private - sig do - override - .params( - security: { - auth_api_key: T::Boolean, - oauth_bearer: T::Boolean - } - ) - .returns(T::Hash[String, String]) - end - private def auth_headers(security:) + sig { override.returns(T::Hash[String, String]) } + private def auth_headers end # @api private diff --git a/rbi/x_twitter_scraper/internal/transport/base_client.rbi b/rbi/x_twitter_scraper/internal/transport/base_client.rbi index c8669de..af0adf3 100644 --- a/rbi/x_twitter_scraper/internal/transport/base_client.rbi +++ b/rbi/x_twitter_scraper/internal/transport/base_client.rbi @@ -52,10 +52,6 @@ module XTwitterScraper stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), - security: - T.nilable( - { auth_api_key: T::Boolean, oauth_bearer: T::Boolean } - ), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) } end @@ -244,7 +240,7 @@ module XTwitterScraper # Execute the request specified by `req`. This is the method that all resource # methods call into. # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, security: {auth_api_key: true, oauth_bearer: true}, options: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, options: {}) sig do params( method: Symbol, @@ -286,8 +282,6 @@ module XTwitterScraper ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), - security: - T.nilable({ auth_api_key: T::Boolean, oauth_bearer: T::Boolean }), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) ).returns(T.anything) end @@ -301,7 +295,6 @@ module XTwitterScraper page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, - security: { auth_api_key: true, oauth_bearer: true }, options: {} ) end diff --git a/rbi/x_twitter_scraper/models.rbi b/rbi/x_twitter_scraper/models.rbi index 99499ab..2ace23b 100644 --- a/rbi/x_twitter_scraper/models.rbi +++ b/rbi/x_twitter_scraper/models.rbi @@ -74,25 +74,6 @@ module XTwitterScraper ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams - Integration = XTwitterScraper::Models::Integration - - IntegrationCreateParams = XTwitterScraper::Models::IntegrationCreateParams - - IntegrationDeleteParams = XTwitterScraper::Models::IntegrationDeleteParams - - IntegrationDelivery = XTwitterScraper::Models::IntegrationDelivery - - IntegrationListDeliveriesParams = - XTwitterScraper::Models::IntegrationListDeliveriesParams - - IntegrationListParams = XTwitterScraper::Models::IntegrationListParams - - IntegrationRetrieveParams = XTwitterScraper::Models::IntegrationRetrieveParams - - IntegrationSendTestParams = XTwitterScraper::Models::IntegrationSendTestParams - - IntegrationUpdateParams = XTwitterScraper::Models::IntegrationUpdateParams - Monitor = XTwitterScraper::Models::Monitor MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -114,6 +95,8 @@ module XTwitterScraper RadarRetrieveTrendingTopicsParams = XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams + SearchTweet = XTwitterScraper::Models::SearchTweet + StyleAnalyzeParams = XTwitterScraper::Models::StyleAnalyzeParams StyleCompareParams = XTwitterScraper::Models::StyleCompareParams @@ -138,6 +121,8 @@ module XTwitterScraper TrendListParams = XTwitterScraper::Models::TrendListParams + UserProfile = XTwitterScraper::Models::UserProfile + Webhook = XTwitterScraper::Models::Webhook WebhookCreateParams = XTwitterScraper::Models::WebhookCreateParams diff --git a/rbi/x_twitter_scraper/models/account_retrieve_response.rbi b/rbi/x_twitter_scraper/models/account_retrieve_response.rbi index 9351f4f..58d19ce 100644 --- a/rbi/x_twitter_scraper/models/account_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/account_retrieve_response.rbi @@ -27,19 +27,26 @@ module XTwitterScraper sig do returns( T.nilable( - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo ) ) end - attr_reader :current_period + attr_reader :credit_info sig do params( - current_period: - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod::OrHash + credit_info: + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo::OrHash ).void end - attr_writer :current_period + attr_writer :credit_info + + # Linked X username, omitted when no X account is connected. + sig { returns(T.nilable(String)) } + attr_reader :x_username + + sig { params(x_username: String).void } + attr_writer :x_username sig do params( @@ -47,15 +54,18 @@ module XTwitterScraper monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::Plan::OrSymbol, - current_period: - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod::OrHash + credit_info: + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo::OrHash, + x_username: String ).returns(T.attached_class) end def self.new( monitors_allowed:, monitors_used:, plan:, - current_period: nil + credit_info: nil, + # Linked X username, omitted when no X account is connected. + x_username: nil ) end @@ -66,8 +76,9 @@ module XTwitterScraper monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::Plan::TaggedSymbol, - current_period: - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + credit_info: + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, + x_username: String } ) end @@ -108,34 +119,52 @@ module XTwitterScraper end end - class CurrentPeriod < XTwitterScraper::Internal::Type::BaseModel + class CreditInfo < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod, + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, XTwitterScraper::Internal::AnyHash ) end - sig { returns(Time) } - attr_accessor :end_ + sig { returns(T::Boolean) } + attr_accessor :auto_topup_enabled - sig { returns(Time) } - attr_accessor :start + sig { returns(Integer) } + attr_accessor :balance - sig { returns(Float) } - attr_accessor :usage_percent + sig { returns(Integer) } + attr_accessor :lifetime_purchased + + sig { returns(Integer) } + attr_accessor :lifetime_used sig do - params(end_: Time, start: Time, usage_percent: Float).returns( - T.attached_class - ) + params( + auto_topup_enabled: T::Boolean, + balance: Integer, + lifetime_purchased: Integer, + lifetime_used: Integer + ).returns(T.attached_class) end - def self.new(end_:, start:, usage_percent:) + def self.new( + auto_topup_enabled:, + balance:, + lifetime_purchased:, + lifetime_used: + ) end sig do - override.returns({ end_: Time, start: Time, usage_percent: Float }) + override.returns( + { + auto_topup_enabled: T::Boolean, + balance: Integer, + lifetime_purchased: Integer, + lifetime_used: Integer + } + ) end def to_hash end diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index 1bff9f2..3acde29 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -51,6 +51,11 @@ module XTwitterScraper T.let(:invalid_tweet_url, XTwitterScraper::Error::Error::TaggedSymbol) INVALID_USERNAME = T.let(:invalid_username, XTwitterScraper::Error::Error::TaggedSymbol) + INSUFFICIENT_CREDITS = + T.let( + :insufficient_credits, + XTwitterScraper::Error::Error::TaggedSymbol + ) MISSING_PARAMS = T.let(:missing_params, XTwitterScraper::Error::Error::TaggedSymbol) MISSING_QUERY = @@ -65,15 +70,12 @@ module XTwitterScraper :monitor_limit_reached, XTwitterScraper::Error::Error::TaggedSymbol ) + NO_CREDITS = + T.let(:no_credits, XTwitterScraper::Error::Error::TaggedSymbol) NO_SUBSCRIPTION = T.let(:no_subscription, XTwitterScraper::Error::Error::TaggedSymbol) NOT_FOUND = T.let(:not_found, XTwitterScraper::Error::Error::TaggedSymbol) - STREAM_REGISTRATION_FAILED = - T.let( - :stream_registration_failed, - XTwitterScraper::Error::Error::TaggedSymbol - ) SUBSCRIPTION_INACTIVE = T.let( :subscription_inactive, @@ -83,11 +85,8 @@ module XTwitterScraper T.let(:tweet_not_found, XTwitterScraper::Error::Error::TaggedSymbol) UNAUTHENTICATED = T.let(:unauthenticated, XTwitterScraper::Error::Error::TaggedSymbol) - USAGE_LIMIT_REACHED = - T.let( - :usage_limit_reached, - XTwitterScraper::Error::Error::TaggedSymbol - ) + UNSUPPORTED_FIELD = + T.let(:unsupported_field, XTwitterScraper::Error::Error::TaggedSymbol) USER_NOT_FOUND = T.let(:user_not_found, XTwitterScraper::Error::Error::TaggedSymbol) WEBHOOK_INACTIVE = diff --git a/rbi/x_twitter_scraper/models/event_detail.rbi b/rbi/x_twitter_scraper/models/event_detail.rbi index c5e3279..d22c824 100644 --- a/rbi/x_twitter_scraper/models/event_detail.rbi +++ b/rbi/x_twitter_scraper/models/event_detail.rbi @@ -14,7 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Event payload — shape varies by event type (JSON) + # Event payload - shape varies by event type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :data @@ -51,7 +51,7 @@ module XTwitterScraper end def self.new( id:, - # Event payload — shape varies by event type (JSON) + # Event payload - shape varies by event type (JSON) data:, monitor_id:, occurred_at:, diff --git a/rbi/x_twitter_scraper/models/event_type.rbi b/rbi/x_twitter_scraper/models/event_type.rbi index 1252975..4a0ba79 100644 --- a/rbi/x_twitter_scraper/models/event_type.rbi +++ b/rbi/x_twitter_scraper/models/event_type.rbi @@ -16,10 +16,6 @@ module XTwitterScraper T.let(:"tweet.retweet", XTwitterScraper::EventType::TaggedSymbol) TWEET_QUOTE = T.let(:"tweet.quote", XTwitterScraper::EventType::TaggedSymbol) - FOLLOWER_GAINED = - T.let(:"follower.gained", XTwitterScraper::EventType::TaggedSymbol) - FOLLOWER_LOST = - T.let(:"follower.lost", XTwitterScraper::EventType::TaggedSymbol) sig do override.returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) diff --git a/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi b/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi index ee23ed8..f3337d6 100644 --- a/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi @@ -14,33 +14,41 @@ module XTwitterScraper sig { returns(T::Boolean) } attr_accessor :allowed + sig { returns(String) } + attr_accessor :credits_available + + sig { returns(String) } + attr_accessor :credits_required + sig { returns(Integer) } attr_accessor :estimated_results - sig { returns(Float) } - attr_accessor :projected_percent - sig { returns(String) } attr_accessor :source - sig { returns(Float) } - attr_accessor :usage_percent + sig { returns(T.nilable(String)) } + attr_reader :resolved_x_user_id + + sig { params(resolved_x_user_id: String).void } + attr_writer :resolved_x_user_id sig do params( allowed: T::Boolean, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + resolved_x_user_id: String ).returns(T.attached_class) end def self.new( allowed:, + credits_available:, + credits_required:, estimated_results:, - projected_percent:, source:, - usage_percent: + resolved_x_user_id: nil ) end @@ -48,10 +56,11 @@ module XTwitterScraper override.returns( { allowed: T::Boolean, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + resolved_x_user_id: String } ) end diff --git a/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi b/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi index 887ee76..74152b4 100644 --- a/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi @@ -14,7 +14,7 @@ module XTwitterScraper sig { returns(T::Boolean) } attr_accessor :has_more - # Extraction job metadata — shape varies by tool type (JSON) + # Extraction job metadata - shape varies by tool type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :job @@ -37,7 +37,7 @@ module XTwitterScraper end def self.new( has_more:, - # Extraction job metadata — shape varies by tool type (JSON) + # Extraction job metadata - shape varies by tool type (JSON) job:, results:, next_cursor: nil diff --git a/rbi/x_twitter_scraper/models/integration.rbi b/rbi/x_twitter_scraper/models/integration.rbi deleted file mode 100644 index c252cc5..0000000 --- a/rbi/x_twitter_scraper/models/integration.rbi +++ /dev/null @@ -1,117 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class Integration < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::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 - - # Array of event types to subscribe to. - sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } - attr_accessor :event_types - - sig { returns(T::Boolean) } - attr_accessor :is_active - - sig { returns(String) } - attr_accessor :name - - sig { returns(Symbol) } - 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 - - # 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::EventType::OrSymbol], - is_active: T::Boolean, - name: String, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - id:, - # Integration config — shape varies by type (JSON) - config:, - created_at:, - # Array of event types to subscribe to. - event_types:, - is_active:, - name:, - # Event filter rules (JSON) - filters: nil, - message_template: nil, - scope_all_monitors: nil, - silent_push: nil, - type: :telegram - ) - end - - sig do - override.returns( - { - id: String, - config: T::Hash[Symbol, T.anything], - created_at: Time, - event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], - is_active: T::Boolean, - name: String, - type: Symbol, - filters: T::Hash[Symbol, T.anything], - message_template: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean - } - ) - end - def to_hash - 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 deleted file mode 100644 index 4711f28..0000000 --- a/rbi/x_twitter_scraper/models/integration_create_params.rbi +++ /dev/null @@ -1,95 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationCreateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationCreateParams, - XTwitterScraper::Internal::AnyHash - ) - end - - # Integration config (e.g. Telegram chatId) - sig { returns(XTwitterScraper::IntegrationCreateParams::Config) } - attr_reader :config - - sig do - params( - config: XTwitterScraper::IntegrationCreateParams::Config::OrHash - ).void - end - attr_writer :config - - # 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(Symbol) } - attr_accessor :type - - sig do - params( - config: XTwitterScraper::IntegrationCreateParams::Config::OrHash, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - name: String, - 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: :telegram, - request_options: {} - ) - end - - sig do - override.returns( - { - config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - name: String, - type: Symbol, - request_options: XTwitterScraper::RequestOptions - } - ) - end - def to_hash - end - - class Config < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationCreateParams::Config, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :chat_id - - # Integration config (e.g. Telegram chatId) - sig { params(chat_id: String).returns(T.attached_class) } - def self.new(chat_id:) - end - - sig { override.returns({ chat_id: String }) } - def to_hash - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_delete_params.rbi b/rbi/x_twitter_scraper/models/integration_delete_params.rbi deleted file mode 100644 index 3e2bb5a..0000000 --- a/rbi/x_twitter_scraper/models/integration_delete_params.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationDeleteParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationDeleteParams, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(id:, request_options: {}) - end - - sig do - override.returns( - { id: String, request_options: XTwitterScraper::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_delete_response.rbi b/rbi/x_twitter_scraper/models/integration_delete_response.rbi deleted file mode 100644 index a85a06b..0000000 --- a/rbi/x_twitter_scraper/models/integration_delete_response.rbi +++ /dev/null @@ -1,26 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationDeleteResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :success - - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) - end - - sig { override.returns({ success: T::Boolean }) } - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_delivery.rbi b/rbi/x_twitter_scraper/models/integration_delivery.rbi deleted file mode 100644 index da0a75a..0000000 --- a/rbi/x_twitter_scraper/models/integration_delivery.rbi +++ /dev/null @@ -1,108 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationDelivery < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationDelivery, - 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 - - # Integration delivery attempt record with status and retry count. - 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 diff --git a/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi b/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi deleted file mode 100644 index 00dd336..0000000 --- a/rbi/x_twitter_scraper/models/integration_list_deliveries_params.rbi +++ /dev/null @@ -1,55 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationListDeliveriesParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationListDeliveriesParams, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # 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 - - sig do - params( - id: String, - limit: Integer, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - id:, - # Maximum number of items to return (1-100, default 50) - limit: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - limit: Integer, - request_options: XTwitterScraper::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi b/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi deleted file mode 100644 index d1b45e4..0000000 --- a/rbi/x_twitter_scraper/models/integration_list_deliveries_response.rbi +++ /dev/null @@ -1,34 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationListDeliveriesResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Array[XTwitterScraper::IntegrationDelivery]) } - attr_accessor :deliveries - - sig do - params( - deliveries: T::Array[XTwitterScraper::IntegrationDelivery::OrHash] - ).returns(T.attached_class) - end - def self.new(deliveries:) - end - - sig do - override.returns( - { deliveries: T::Array[XTwitterScraper::IntegrationDelivery] } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_list_params.rbi b/rbi/x_twitter_scraper/models/integration_list_params.rbi deleted file mode 100644 index 79748de..0000000 --- a/rbi/x_twitter_scraper/models/integration_list_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationListParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationListParams, - 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 diff --git a/rbi/x_twitter_scraper/models/integration_list_response.rbi b/rbi/x_twitter_scraper/models/integration_list_response.rbi deleted file mode 100644 index be7e3d4..0000000 --- a/rbi/x_twitter_scraper/models/integration_list_response.rbi +++ /dev/null @@ -1,34 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationListResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationListResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Array[XTwitterScraper::Integration]) } - attr_accessor :integrations - - sig do - params( - integrations: T::Array[XTwitterScraper::Integration::OrHash] - ).returns(T.attached_class) - end - def self.new(integrations:) - end - - sig do - override.returns( - { integrations: T::Array[XTwitterScraper::Integration] } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_retrieve_params.rbi b/rbi/x_twitter_scraper/models/integration_retrieve_params.rbi deleted file mode 100644 index 09b7486..0000000 --- a/rbi/x_twitter_scraper/models/integration_retrieve_params.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationRetrieveParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationRetrieveParams, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(id:, request_options: {}) - end - - sig do - override.returns( - { id: String, request_options: XTwitterScraper::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_send_test_params.rbi b/rbi/x_twitter_scraper/models/integration_send_test_params.rbi deleted file mode 100644 index 74ab767..0000000 --- a/rbi/x_twitter_scraper/models/integration_send_test_params.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationSendTestParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationSendTestParams, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(id:, request_options: {}) - end - - sig do - override.returns( - { id: String, request_options: XTwitterScraper::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/integration_send_test_response.rbi b/rbi/x_twitter_scraper/models/integration_send_test_response.rbi deleted file mode 100644 index 0dff30d..0000000 --- a/rbi/x_twitter_scraper/models/integration_send_test_response.rbi +++ /dev/null @@ -1,26 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationSendTestResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::IntegrationSendTestResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :success - - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) - end - - sig { override.returns({ success: T::Boolean }) } - def to_hash - 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 deleted file mode 100644 index f58d3a6..0000000 --- a/rbi/x_twitter_scraper/models/integration_update_params.rbi +++ /dev/null @@ -1,115 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - XTwitterScraper::IntegrationUpdateParams, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # 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::EventType::OrSymbol]).void - end - attr_writer :event_types - - # 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(T::Boolean)) } - attr_reader :is_active - - sig { params(is_active: T::Boolean).void } - attr_writer :is_active - - # Custom message template (JSON) - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :message_template - - sig { params(message_template: T::Hash[Symbol, T.anything]).void } - attr_writer :message_template - - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name - - 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, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - filters: T::Hash[Symbol, T.anything], - is_active: T::Boolean, - message_template: T::Hash[Symbol, T.anything], - name: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - id:, - # Array of event types to subscribe to. - event_types: nil, - # Event filter rules (JSON) - filters: nil, - is_active: nil, - # Custom message template (JSON) - message_template: nil, - name: nil, - scope_all_monitors: nil, - silent_push: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - filters: T::Hash[Symbol, T.anything], - is_active: T::Boolean, - message_template: T::Hash[Symbol, T.anything], - name: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean, - request_options: XTwitterScraper::RequestOptions - } - ) - end - def to_hash - 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 571a80c..0f975e4 100644 --- a/rbi/x_twitter_scraper/models/paginated_tweets.rbi +++ b/rbi/x_twitter_scraper/models/paginated_tweets.rbi @@ -17,7 +17,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :next_cursor - sig { returns(T::Array[XTwitterScraper::X::SearchTweet]) } + sig { returns(T::Array[XTwitterScraper::SearchTweet]) } attr_accessor :tweets # Paginated list of tweets with cursor-based navigation. @@ -25,7 +25,7 @@ module XTwitterScraper params( has_next_page: T::Boolean, next_cursor: String, - tweets: T::Array[XTwitterScraper::X::SearchTweet::OrHash] + tweets: T::Array[XTwitterScraper::SearchTweet::OrHash] ).returns(T.attached_class) end def self.new(has_next_page:, next_cursor:, tweets:) @@ -36,7 +36,7 @@ module XTwitterScraper { has_next_page: T::Boolean, next_cursor: String, - tweets: T::Array[XTwitterScraper::X::SearchTweet] + tweets: T::Array[XTwitterScraper::SearchTweet] } ) end diff --git a/rbi/x_twitter_scraper/models/paginated_users.rbi b/rbi/x_twitter_scraper/models/paginated_users.rbi index dd04ec3..8cd0882 100644 --- a/rbi/x_twitter_scraper/models/paginated_users.rbi +++ b/rbi/x_twitter_scraper/models/paginated_users.rbi @@ -17,7 +17,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :next_cursor - sig { returns(T::Array[XTwitterScraper::X::UserProfile]) } + sig { returns(T::Array[XTwitterScraper::UserProfile]) } attr_accessor :users # Paginated list of user profiles with cursor-based navigation. @@ -25,7 +25,7 @@ module XTwitterScraper params( has_next_page: T::Boolean, next_cursor: String, - users: T::Array[XTwitterScraper::X::UserProfile::OrHash] + users: T::Array[XTwitterScraper::UserProfile::OrHash] ).returns(T.attached_class) end def self.new(has_next_page:, next_cursor:, users:) @@ -36,7 +36,7 @@ module XTwitterScraper { has_next_page: T::Boolean, next_cursor: String, - users: T::Array[XTwitterScraper::X::UserProfile] + users: T::Array[XTwitterScraper::UserProfile] } ) end diff --git a/rbi/x_twitter_scraper/models/radar_item.rbi b/rbi/x_twitter_scraper/models/radar_item.rbi index 7ef6eea..1855836 100644 --- a/rbi/x_twitter_scraper/models/radar_item.rbi +++ b/rbi/x_twitter_scraper/models/radar_item.rbi @@ -8,9 +8,33 @@ module XTwitterScraper T.any(XTwitterScraper::RadarItem, XTwitterScraper::Internal::AnyHash) end + # Internal numeric identifier (stringified bigint). sig { returns(String) } + attr_accessor :id + + sig { returns(XTwitterScraper::RadarItem::Category::TaggedSymbol) } attr_accessor :category + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :language + + # Source-specific fields. Shape varies per source: + # + # - reddit: { subreddit: string, author: string } + # - github: { starsToday: number } + # - hacker_news: { points: number, numberComments: number } + # - google_trends: { approxTraffic: number } + # - polymarket: { volume24hr: number } + # - wikipedia: { views: number } + # - trustmrr: { mrr, growthPercent, last30Days, total, customers, + # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?, + # growthMrrPercent?, multiple?, paymentProvider?, rank? } + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :metadata + sig { returns(Time) } attr_accessor :published_at @@ -20,9 +44,13 @@ module XTwitterScraper sig { returns(Float) } attr_accessor :score - sig { returns(String) } + sig { returns(XTwitterScraper::RadarItem::Source::TaggedSymbol) } attr_accessor :source + # Source-specific identifier used for deduplication. + sig { returns(String) } + attr_accessor :source_id + sig { returns(String) } attr_accessor :title @@ -44,14 +72,20 @@ module XTwitterScraper sig { params(url: String).void } attr_writer :url - # Trending topic with score, category, source, and region. + # Trending topic with score, category, source, region, language, and + # source-specific metadata. sig do params( - category: String, + id: String, + category: XTwitterScraper::RadarItem::Category::OrSymbol, + created_at: Time, + language: String, + metadata: T::Hash[Symbol, T.anything], published_at: Time, region: String, score: Float, - source: String, + source: XTwitterScraper::RadarItem::Source::OrSymbol, + source_id: String, title: String, description: String, image_url: String, @@ -59,11 +93,29 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Internal numeric identifier (stringified bigint). + id:, category:, + created_at:, + language:, + # Source-specific fields. Shape varies per source: + # + # - reddit: { subreddit: string, author: string } + # - github: { starsToday: number } + # - hacker_news: { points: number, numberComments: number } + # - google_trends: { approxTraffic: number } + # - polymarket: { volume24hr: number } + # - wikipedia: { views: number } + # - trustmrr: { mrr, growthPercent, last30Days, total, customers, + # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?, + # growthMrrPercent?, multiple?, paymentProvider?, rank? } + metadata:, published_at:, region:, score:, source:, + # Source-specific identifier used for deduplication. + source_id:, title:, description: nil, image_url: nil, @@ -74,11 +126,16 @@ module XTwitterScraper sig do override.returns( { - category: String, + id: String, + category: XTwitterScraper::RadarItem::Category::TaggedSymbol, + created_at: Time, + language: String, + metadata: T::Hash[Symbol, T.anything], published_at: Time, region: String, score: Float, - source: String, + source: XTwitterScraper::RadarItem::Source::TaggedSymbol, + source_id: String, title: String, description: String, image_url: String, @@ -88,6 +145,74 @@ module XTwitterScraper end def to_hash end + + module Category + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, XTwitterScraper::RadarItem::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GENERAL = + T.let(:general, XTwitterScraper::RadarItem::Category::TaggedSymbol) + TECH = T.let(:tech, XTwitterScraper::RadarItem::Category::TaggedSymbol) + DEV = T.let(:dev, XTwitterScraper::RadarItem::Category::TaggedSymbol) + SCIENCE = + T.let(:science, XTwitterScraper::RadarItem::Category::TaggedSymbol) + CULTURE = + T.let(:culture, XTwitterScraper::RadarItem::Category::TaggedSymbol) + POLITICS = + T.let(:politics, XTwitterScraper::RadarItem::Category::TaggedSymbol) + BUSINESS = + T.let(:business, XTwitterScraper::RadarItem::Category::TaggedSymbol) + ENTERTAINMENT = + T.let( + :entertainment, + XTwitterScraper::RadarItem::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::RadarItem::Category::TaggedSymbol] + ) + end + def self.values + end + end + + module Source + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, XTwitterScraper::RadarItem::Source) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB = + T.let(:github, XTwitterScraper::RadarItem::Source::TaggedSymbol) + GOOGLE_TRENDS = + T.let( + :google_trends, + XTwitterScraper::RadarItem::Source::TaggedSymbol + ) + HACKER_NEWS = + T.let(:hacker_news, XTwitterScraper::RadarItem::Source::TaggedSymbol) + POLYMARKET = + T.let(:polymarket, XTwitterScraper::RadarItem::Source::TaggedSymbol) + REDDIT = + T.let(:reddit, XTwitterScraper::RadarItem::Source::TaggedSymbol) + TRUSTMRR = + T.let(:trustmrr, XTwitterScraper::RadarItem::Source::TaggedSymbol) + WIKIPEDIA = + T.let(:wikipedia, XTwitterScraper::RadarItem::Source::TaggedSymbol) + + sig do + override.returns( + T::Array[XTwitterScraper::RadarItem::Source::TaggedSymbol] + ) + end + def self.values + end + end end end end 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 0a95692..49fd852 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 @@ -14,27 +14,45 @@ module XTwitterScraper ) end - # Filter by category (general, tech, dev, etc.) + # Cursor for pagination (from prior response nextCursor). sig { returns(T.nilable(String)) } - attr_reader :category + attr_reader :after - sig { params(category: String).void } - attr_writer :category + sig { params(after: String).void } + attr_writer :after - # Number of items to return - sig { returns(T.nilable(Integer)) } - attr_reader :count + # Filter by category. + sig do + returns( + T.nilable( + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::OrSymbol + ) + ) + end + attr_reader :category - sig { params(count: Integer).void } - attr_writer :count + sig do + params( + category: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::OrSymbol + ).void + end + attr_writer :category - # Lookback window in hours + # Lookback window in hours (1-168, default 24). sig { returns(T.nilable(Integer)) } attr_reader :hours sig { params(hours: Integer).void } attr_writer :hours + # 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 + # Region filter (us, global, etc.) sig { returns(T.nilable(String)) } attr_reader :region @@ -63,9 +81,11 @@ module XTwitterScraper sig do params( - category: String, - count: Integer, + after: String, + category: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::OrSymbol, hours: Integer, + limit: Integer, region: String, source: XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, @@ -73,12 +93,14 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Filter by category (general, tech, dev, etc.) + # Cursor for pagination (from prior response nextCursor). + after: nil, + # Filter by category. category: nil, - # Number of items to return - count: nil, - # Lookback window in hours + # Lookback window in hours (1-168, default 24). hours: nil, + # Number of items to return (1-100, default 50). + limit: nil, # Region filter (us, global, etc.) region: nil, # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, @@ -91,9 +113,11 @@ module XTwitterScraper sig do override.returns( { - category: String, - count: Integer, + after: String, + category: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::OrSymbol, hours: Integer, + limit: Integer, region: String, source: XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, @@ -104,6 +128,71 @@ module XTwitterScraper def to_hash end + # Filter by category. + module Category + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GENERAL = + T.let( + :general, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + TECH = + T.let( + :tech, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + DEV = + T.let( + :dev, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + SCIENCE = + T.let( + :science, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + CULTURE = + T.let( + :culture, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + POLITICS = + T.let( + :politics, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + ENTERTAINMENT = + T.let( + :entertainment, + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia module Source 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 f64fe41..ac72564 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,24 +11,41 @@ module XTwitterScraper ) end + sig { returns(T::Boolean) } + attr_accessor :has_more + sig { returns(T::Array[XTwitterScraper::RadarItem]) } attr_accessor :items - sig { returns(Integer) } - attr_accessor :total + # Opaque cursor for the next page (present only when hasMore is true). + sig { returns(T.nilable(String)) } + attr_reader :next_cursor + + sig { params(next_cursor: String).void } + attr_writer :next_cursor sig do params( + has_more: T::Boolean, items: T::Array[XTwitterScraper::RadarItem::OrHash], - total: Integer + next_cursor: String ).returns(T.attached_class) end - def self.new(items:, total:) + def self.new( + has_more:, + items:, + # Opaque cursor for the next page (present only when hasMore is true). + next_cursor: nil + ) end sig do override.returns( - { items: T::Array[XTwitterScraper::RadarItem], total: Integer } + { + has_more: T::Boolean, + items: T::Array[XTwitterScraper::RadarItem], + next_cursor: String + } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/search_tweet.rbi b/rbi/x_twitter_scraper/models/search_tweet.rbi new file mode 100644 index 0000000..82d4779 --- /dev/null +++ b/rbi/x_twitter_scraper/models/search_tweet.rbi @@ -0,0 +1,172 @@ +# typed: strong + +module XTwitterScraper + module Models + class SearchTweet < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :text + + sig { returns(T.nilable(XTwitterScraper::SearchTweet::Author)) } + attr_reader :author + + sig { params(author: XTwitterScraper::SearchTweet::Author::OrHash).void } + 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 + + # 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 + + 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 + + # Tweet returned from search results with inline author info. + sig do + params( + id: String, + text: String, + author: XTwitterScraper::SearchTweet::Author::OrHash, + bookmark_count: Integer, + created_at: String, + is_note_tweet: T::Boolean, + 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, + # 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, + retweet_count: nil, + view_count: nil + ) + end + + sig do + override.returns( + { + id: String, + text: String, + author: XTwitterScraper::SearchTweet::Author, + bookmark_count: Integer, + created_at: String, + is_note_tweet: T::Boolean, + 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::SearchTweet::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 diff --git a/rbi/x_twitter_scraper/models/trend_list_params.rbi b/rbi/x_twitter_scraper/models/trend_list_params.rbi index 98b144c..717e280 100644 --- a/rbi/x_twitter_scraper/models/trend_list_params.rbi +++ b/rbi/x_twitter_scraper/models/trend_list_params.rbi @@ -14,14 +14,14 @@ module XTwitterScraper ) end - # Number of trending topics to return (1-50, default 30) + # Number of trending topics returned (1-50, default 30) sig { returns(T.nilable(Integer)) } attr_reader :count sig { params(count: Integer).void } attr_writer :count - # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) sig { returns(T.nilable(Integer)) } attr_reader :woeid @@ -36,9 +36,9 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Number of trending topics to return (1-50, default 30) + # Number of trending topics returned (1-50, default 30) count: nil, - # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) woeid: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/user_profile.rbi b/rbi/x_twitter_scraper/models/user_profile.rbi new file mode 100644 index 0000000..e0e0b69 --- /dev/null +++ b/rbi/x_twitter_scraper/models/user_profile.rbi @@ -0,0 +1,123 @@ +# typed: strong + +module XTwitterScraper + module Models + class UserProfile < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::UserProfile, + 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 + + # X user profile with bio, follower counts, and verification status. + 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 diff --git a/rbi/x_twitter_scraper/models/x/account_create_response.rbi b/rbi/x_twitter_scraper/models/x/account_create_response.rbi index 1a2db1b..54b7090 100644 --- a/rbi/x_twitter_scraper/models/x/account_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_create_response.rbi @@ -15,6 +15,16 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + end + attr_accessor :health + sig { returns(String) } attr_accessor :status @@ -24,29 +34,116 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + sig { returns(T.nilable(String)) } + attr_reader :login_country + + sig { params(login_country: String).void } + attr_writer :login_country + + # Sanitized X account summary returned by connect and reauth. Includes an optional + # `loginCountry` field surfaced only when the declared proxy region had no Driver + # capacity and the login fell back to a single US consumer device for this + # one-time action. Future activity continues to use the selected `proxy_country`; + # the field is omitted on normal logins. sig do params( id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountCreateResponse::Health::OrSymbol, status: String, x_user_id: String, - x_username: String + x_username: String, + login_country: String ).returns(T.attached_class) end - def self.new(id:, status:, x_user_id:, x_username:) + def self.new( + id:, + created_at:, + health:, + status:, + x_user_id:, + x_username:, + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + login_country: nil + ) end sig do override.returns( { id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol, status: String, x_user_id: String, - x_username: String + x_username: String, + login_country: String } ) end def to_hash end + + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::AccountCreateResponse::Health + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let( + :healthy, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + LOCKED = + T.let( + :locked, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol + ] + ) + end + def self.values + 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 c41ea44..f1b4103 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi @@ -22,6 +22,20 @@ module XTwitterScraper sig { returns(String) } attr_accessor :password + # Email for the X account (updates stored email) + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Two-letter country code for login proxy region + sig { returns(T.nilable(String)) } + attr_reader :proxy_country + + sig { params(proxy_country: String).void } + attr_writer :proxy_country + # TOTP secret for 2FA re-authentication sig { returns(T.nilable(String)) } attr_reader :totp_secret @@ -33,6 +47,8 @@ module XTwitterScraper params( id: String, password: String, + email: String, + proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) @@ -41,6 +57,10 @@ module XTwitterScraper id:, # Updated account password password:, + # Email for the X account (updates stored email) + email: nil, + # Two-letter country code for login proxy region + proxy_country: nil, # TOTP secret for 2FA re-authentication totp_secret: nil, request_options: {} @@ -52,6 +72,8 @@ module XTwitterScraper { id: String, password: String, + email: String, + proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi index 49bed8e..bac6c89 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi @@ -15,25 +15,135 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + end + attr_accessor :health + sig { returns(String) } attr_accessor :status + sig { returns(String) } + attr_accessor :x_user_id + sig { returns(String) } attr_accessor :x_username + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + sig { returns(T.nilable(String)) } + attr_reader :login_country + + sig { params(login_country: String).void } + attr_writer :login_country + + # Sanitized X account summary returned by connect and reauth. Includes an optional + # `loginCountry` field surfaced only when the declared proxy region had no Driver + # capacity and the login fell back to a single US consumer device for this + # one-time action. Future activity continues to use the selected `proxy_country`; + # the field is omitted on normal logins. sig do - params(id: String, status: String, x_username: String).returns( - T.attached_class - ) + params( + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountReauthResponse::Health::OrSymbol, + status: String, + x_user_id: String, + x_username: String, + login_country: String + ).returns(T.attached_class) end - def self.new(id:, status:, x_username:) + def self.new( + id:, + created_at:, + health:, + status:, + x_user_id:, + x_username:, + # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this + # login. Present only when the US fallback was triggered because Driver had no + # capacity in the declared region. Omitted otherwise. + login_country: nil + ) end sig do - override.returns({ id: String, status: String, x_username: String }) + override.returns( + { + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol, + status: String, + x_user_id: String, + x_username: String, + login_country: String + } + ) end def to_hash end + + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::AccountReauthResponse::Health + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let( + :healthy, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + LOCKED = + T.let( + :locked, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi index 80e2272..799a56a 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi @@ -25,10 +25,18 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Items per page (20-200, default 20) + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +44,8 @@ module XTwitterScraper id:, # Pagination cursor cursor: nil, + # Items per page (20-200, default 20) + page_size: nil, request_options: {} ) end @@ -45,6 +55,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 4f1f01d..5e411df 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 @@ -25,10 +25,18 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Members per page (20-200, default 20) + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +44,8 @@ module XTwitterScraper id:, # Pagination cursor for list members cursor: nil, + # Members per page (20-200, default 20) + page_size: nil, request_options: {} ) end @@ -45,6 +55,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/search_tweet.rbi b/rbi/x_twitter_scraper/models/x/search_tweet.rbi deleted file mode 100644 index 437adf7..0000000 --- a/rbi/x_twitter_scraper/models/x/search_tweet.rbi +++ /dev/null @@ -1,181 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class SearchTweet < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::X::SearchTweet, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :text - - sig { returns(T.nilable(XTwitterScraper::X::SearchTweet::Author)) } - attr_reader :author - - sig do - params(author: XTwitterScraper::X::SearchTweet::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 - - # 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 - - 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 - - # Tweet returned from search results with inline author info. - sig do - params( - id: String, - text: String, - 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, - retweet_count: Integer, - view_count: Integer - ).returns(T.attached_class) - end - def self.new( - id:, - text:, - 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, - retweet_count: nil, - view_count: nil - ) - end - - sig do - override.returns( - { - id: String, - text: String, - 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, - 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::X::SearchTweet::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/tweet_create_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi index 99b5146..c345ad6 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi @@ -19,9 +19,6 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account - sig { returns(String) } - attr_accessor :text - sig { returns(T.nilable(String)) } attr_reader :attachment_url @@ -40,11 +37,13 @@ module XTwitterScraper sig { params(is_note_tweet: T::Boolean).void } attr_writer :is_note_tweet + # Array of public image URLs to attach (max 4). Each URL must be publicly + # reachable - the browser composer fetches them directly. sig { returns(T.nilable(T::Array[String])) } - attr_reader :media_ids + attr_reader :media - sig { params(media_ids: T::Array[String]).void } - attr_writer :media_ids + sig { params(media: T::Array[String]).void } + attr_writer :media sig { returns(T.nilable(String)) } attr_reader :reply_to_tweet_id @@ -52,27 +51,37 @@ module XTwitterScraper sig { params(reply_to_tweet_id: String).void } attr_writer :reply_to_tweet_id + # Tweet text (optional when media is provided) + sig { returns(T.nilable(String)) } + attr_reader :text + + sig { params(text: String).void } + attr_writer :text + sig do params( account: String, - text: String, attachment_url: String, community_id: String, is_note_tweet: T::Boolean, - media_ids: T::Array[String], + media: T::Array[String], reply_to_tweet_id: String, + text: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # X account (@username or account ID) account:, - text:, attachment_url: nil, community_id: nil, is_note_tweet: nil, - media_ids: nil, + # Array of public image URLs to attach (max 4). Each URL must be publicly + # reachable - the browser composer fetches them directly. + media: nil, reply_to_tweet_id: nil, + # Tweet text (optional when media is provided) + text: nil, request_options: {} ) end @@ -81,12 +90,12 @@ module XTwitterScraper override.returns( { account: String, - text: String, attachment_url: String, community_id: String, is_note_tweet: T::Boolean, - media_ids: T::Array[String], + media: T::Array[String], reply_to_tweet_id: String, + text: String, request_options: XTwitterScraper::RequestOptions } ) 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 5cb9a13..ba4fd04 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi @@ -33,7 +33,7 @@ module XTwitterScraper sig { params(limit: Integer).void } attr_writer :limit - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) sig do returns( T.nilable( @@ -51,14 +51,14 @@ module XTwitterScraper end attr_writer :query_type - # ISO 8601 timestamp — only return tweets after this time + # ISO 8601 timestamp - only return tweets after this time sig { returns(T.nilable(String)) } attr_reader :since_time sig { params(since_time: String).void } attr_writer :since_time - # ISO 8601 timestamp — only return tweets before this time + # ISO 8601 timestamp - only return tweets before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -84,11 +84,11 @@ module XTwitterScraper cursor: nil, # Max tweets to return (server paginates internally). Omit for single page (~20). limit: nil, - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) query_type: nil, - # ISO 8601 timestamp — only return tweets after this time + # ISO 8601 timestamp - only return tweets after this time since_time: nil, - # ISO 8601 timestamp — only return tweets before this time + # ISO 8601 timestamp - only return tweets before this time until_time: nil, request_options: {} ) @@ -111,7 +111,7 @@ module XTwitterScraper def to_hash end - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) module QueryType extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/x/user_profile.rbi b/rbi/x_twitter_scraper/models/x/user_profile.rbi deleted file mode 100644 index 555d9d3..0000000 --- a/rbi/x_twitter_scraper/models/x/user_profile.rbi +++ /dev/null @@ -1,125 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class UserProfile < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::X::UserProfile, - 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 - - # X user profile with bio, follower counts, and verification status. - 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/x_account.rbi b/rbi/x_twitter_scraper/models/x/x_account.rbi index 2559fa2..f4f9601 100644 --- a/rbi/x_twitter_scraper/models/x/x_account.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account.rbi @@ -20,6 +20,14 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at + # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user + # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # first. `suspended` = X banned the account. `recovering` = past cooldown, will + # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # shortly. + sig { returns(XTwitterScraper::X::XAccount::Health::TaggedSymbol) } + attr_accessor :health + sig { returns(String) } attr_accessor :status @@ -34,12 +42,25 @@ module XTwitterScraper params( id: String, created_at: Time, + health: XTwitterScraper::X::XAccount::Health::OrSymbol, 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:) + def self.new( + id:, + created_at:, + # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user + # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # first. `suspended` = X banned the account. `recovering` = past cooldown, will + # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # shortly. + health:, + status:, + x_user_id:, + x_username: + ) end sig do @@ -47,6 +68,7 @@ module XTwitterScraper { id: String, created_at: Time, + health: XTwitterScraper::X::XAccount::Health::TaggedSymbol, status: String, x_user_id: String, x_username: String @@ -55,6 +77,52 @@ module XTwitterScraper end def to_hash end + + # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user + # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # first. `suspended` = X banned the account. `recovering` = past cooldown, will + # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # shortly. + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, XTwitterScraper::X::XAccount::Health) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let(:healthy, XTwitterScraper::X::XAccount::Health::TaggedSymbol) + LOCKED = + T.let(:locked, XTwitterScraper::X::XAccount::Health::TaggedSymbol) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::X::XAccount::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::X::XAccount::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::X::XAccount::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::X::XAccount::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::X::XAccount::Health::TaggedSymbol] + ) + end + def self.values + end + end end end end 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 fc1500c..88f7fc9 100644 --- a/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account_detail.rbi @@ -20,6 +20,11 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at + sig do + returns(XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol) + end + attr_accessor :health + sig { returns(String) } attr_accessor :status @@ -52,6 +57,7 @@ module XTwitterScraper params( id: String, created_at: Time, + health: XTwitterScraper::X::XAccountDetail::Health::OrSymbol, status: String, x_user_id: String, x_username: String, @@ -63,6 +69,7 @@ module XTwitterScraper def self.new( id:, created_at:, + health:, status:, x_user_id:, x_username:, @@ -77,6 +84,7 @@ module XTwitterScraper { id: String, created_at: Time, + health: XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol, status: String, x_user_id: String, x_username: String, @@ -88,6 +96,55 @@ module XTwitterScraper end def to_hash end + + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::XAccountDetail::Health) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let( + :healthy, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + LOCKED = + T.let( + :locked, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::X::XAccountDetail::Health::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x_get_trends_params.rbi b/rbi/x_twitter_scraper/models/x_get_trends_params.rbi index 8137cbc..fad72ee 100644 --- a/rbi/x_twitter_scraper/models/x_get_trends_params.rbi +++ b/rbi/x_twitter_scraper/models/x_get_trends_params.rbi @@ -14,16 +14,44 @@ module XTwitterScraper ) end + # Number of trending topics to return (1-50, default 30) + sig { returns(T.nilable(Integer)) } + attr_reader :count + + sig { params(count: Integer).void } + attr_writer :count + + # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + sig { returns(T.nilable(Integer)) } + attr_reader :woeid + + sig { params(woeid: Integer).void } + attr_writer :woeid + sig do params( + count: Integer, + woeid: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(request_options: {}) + 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, + request_options: {} + ) end sig do - override.returns({ request_options: XTwitterScraper::RequestOptions }) + override.returns( + { + count: Integer, + woeid: Integer, + request_options: XTwitterScraper::RequestOptions + } + ) end def to_hash end diff --git a/rbi/x_twitter_scraper/resources/account.rbi b/rbi/x_twitter_scraper/resources/account.rbi index dab8dc8..07f8b6e 100644 --- a/rbi/x_twitter_scraper/resources/account.rbi +++ b/rbi/x_twitter_scraper/resources/account.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Account info & settings + # Account info and settings class Account # Get account info sig do diff --git a/rbi/x_twitter_scraper/resources/bot.rbi b/rbi/x_twitter_scraper/resources/bot.rbi deleted file mode 100644 index 50faa6f..0000000 --- a/rbi/x_twitter_scraper/resources/bot.rbi +++ /dev/null @@ -1,15 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Resources - class Bot - sig { returns(XTwitterScraper::Resources::Bot::PlatformLinks) } - attr_reader :platform_links - - # @api private - sig { params(client: XTwitterScraper::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/x_twitter_scraper/resources/bot/platform_links.rbi b/rbi/x_twitter_scraper/resources/bot/platform_links.rbi deleted file mode 100644 index 04a1193..0000000 --- a/rbi/x_twitter_scraper/resources/bot/platform_links.rbi +++ /dev/null @@ -1,16 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Resources - class Bot - class PlatformLinks - # @api private - sig do - params(client: XTwitterScraper::Client).returns(T.attached_class) - end - def self.new(client:) - end - end - end - end -end diff --git a/rbi/x_twitter_scraper/resources/compose.rbi b/rbi/x_twitter_scraper/resources/compose.rbi index a2e018b..b89d9c2 100644 --- a/rbi/x_twitter_scraper/resources/compose.rbi +++ b/rbi/x_twitter_scraper/resources/compose.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Compose # Compose, refine, or score a tweet sig do diff --git a/rbi/x_twitter_scraper/resources/credits.rbi b/rbi/x_twitter_scraper/resources/credits.rbi index 50d1fd8..f71b052 100644 --- a/rbi/x_twitter_scraper/resources/credits.rbi +++ b/rbi/x_twitter_scraper/resources/credits.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Subscription & billing + # Subscription, billing, and credits class Credits # Get credits balance sig do diff --git a/rbi/x_twitter_scraper/resources/drafts.rbi b/rbi/x_twitter_scraper/resources/drafts.rbi index 0f13656..f425024 100644 --- a/rbi/x_twitter_scraper/resources/drafts.rbi +++ b/rbi/x_twitter_scraper/resources/drafts.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Drafts # Save a tweet draft sig do diff --git a/rbi/x_twitter_scraper/resources/integrations.rbi b/rbi/x_twitter_scraper/resources/integrations.rbi deleted file mode 100644 index af12a30..0000000 --- a/rbi/x_twitter_scraper/resources/integrations.rbi +++ /dev/null @@ -1,133 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Resources - # Push notification integrations (Telegram) - class Integrations - # Create integration - sig do - params( - config: XTwitterScraper::IntegrationCreateParams::Config::OrHash, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - name: String, - type: Symbol, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Integration) - end - def create( - # Integration config (e.g. Telegram chatId) - config:, - # Array of event types to subscribe to. - event_types:, - name:, - type: :telegram, - request_options: {} - ) - end - - # Get integration details - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Integration) - end - def retrieve( - # Resource ID (stringified bigint) - id, - request_options: {} - ) - end - - # Update integration - sig do - params( - id: String, - event_types: T::Array[XTwitterScraper::EventType::OrSymbol], - filters: T::Hash[Symbol, T.anything], - is_active: T::Boolean, - message_template: T::Hash[Symbol, T.anything], - name: String, - scope_all_monitors: T::Boolean, - silent_push: T::Boolean, - request_options: XTwitterScraper::RequestOptions::OrHash - ).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, - is_active: nil, - # Custom message template (JSON) - message_template: nil, - name: nil, - scope_all_monitors: nil, - silent_push: nil, - request_options: {} - ) - end - - # List integrations - sig do - params( - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationListResponse) - end - def list(request_options: {}) - end - - # Delete integration - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationDeleteResponse) - end - def delete( - # Resource ID (stringified bigint) - id, - request_options: {} - ) - end - - # List integration delivery history - sig do - params( - id: String, - limit: Integer, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationListDeliveriesResponse) - end - def list_deliveries( - # Resource ID (stringified bigint) - id, - # Maximum number of items to return (1-100, default 50) - limit: nil, - request_options: {} - ) - end - - # Send test delivery - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::IntegrationSendTestResponse) - end - def send_test( - # Resource ID (stringified bigint) - id, - request_options: {} - ) - end - - # @api private - sig { params(client: XTwitterScraper::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/x_twitter_scraper/resources/radar.rbi b/rbi/x_twitter_scraper/resources/radar.rbi index 3177d63..e8b6b5d 100644 --- a/rbi/x_twitter_scraper/resources/radar.rbi +++ b/rbi/x_twitter_scraper/resources/radar.rbi @@ -2,14 +2,16 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Radar # Get trending topics from curated sources sig do params( - category: String, - count: Integer, + after: String, + category: + XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category::OrSymbol, hours: Integer, + limit: Integer, region: String, source: XTwitterScraper::RadarRetrieveTrendingTopicsParams::Source::OrSymbol, @@ -17,12 +19,14 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::RadarRetrieveTrendingTopicsResponse) end def retrieve_trending_topics( - # Filter by category (general, tech, dev, etc.) + # Cursor for pagination (from prior response nextCursor). + after: nil, + # Filter by category. category: nil, - # Number of items to return - count: nil, - # Lookback window in hours + # Lookback window in hours (1-168, default 24). hours: nil, + # Number of items to return (1-100, default 50). + limit: nil, # Region filter (us, global, etc.) region: nil, # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, diff --git a/rbi/x_twitter_scraper/resources/styles.rbi b/rbi/x_twitter_scraper/resources/styles.rbi index 8767545..fca4cd6 100644 --- a/rbi/x_twitter_scraper/resources/styles.rbi +++ b/rbi/x_twitter_scraper/resources/styles.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Tweet composition, drafts, writing styles & radar + # AI tweet composition, drafts, writing styles, and radar class Styles # Get cached style profile sig do diff --git a/rbi/x_twitter_scraper/resources/subscribe.rbi b/rbi/x_twitter_scraper/resources/subscribe.rbi index 019d3c5..fb2f3da 100644 --- a/rbi/x_twitter_scraper/resources/subscribe.rbi +++ b/rbi/x_twitter_scraper/resources/subscribe.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Subscription & billing + # Subscription, billing, and credits class Subscribe # Get checkout or billing URL sig do diff --git a/rbi/x_twitter_scraper/resources/trends.rbi b/rbi/x_twitter_scraper/resources/trends.rbi index 2c5f1b2..bf4cbcd 100644 --- a/rbi/x_twitter_scraper/resources/trends.rbi +++ b/rbi/x_twitter_scraper/resources/trends.rbi @@ -2,9 +2,9 @@ module XTwitterScraper module Resources - # Trending topics by region + # Trending topics and hashtags by region class Trends - # Get regional trending topics + # Get trending hashtags & topics by region (alias) sig do params( count: Integer, @@ -13,9 +13,9 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::TrendListResponse) end def list( - # Number of trending topics to return (1-50, default 30) + # Number of trending topics returned (1-50, default 30) count: nil, - # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + # Region Yahoo WOEID code (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) woeid: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/webhooks.rbi b/rbi/x_twitter_scraper/resources/webhooks.rbi index b3ef6e0..5699050 100644 --- a/rbi/x_twitter_scraper/resources/webhooks.rbi +++ b/rbi/x_twitter_scraper/resources/webhooks.rbi @@ -2,7 +2,7 @@ module XTwitterScraper module Resources - # Webhook endpoint management & delivery + # Webhook endpoint management and delivery class Webhooks # Create webhook sig do diff --git a/rbi/x_twitter_scraper/resources/x.rbi b/rbi/x_twitter_scraper/resources/x.rbi index f1421af..b770676 100644 --- a/rbi/x_twitter_scraper/resources/x.rbi +++ b/rbi/x_twitter_scraper/resources/x.rbi @@ -2,23 +2,22 @@ module XTwitterScraper module Resources - # X data lookups (subscription required) class X sig { returns(XTwitterScraper::Resources::X::Tweets) } attr_reader :tweets - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships sig { returns(XTwitterScraper::Resources::X::Users) } attr_reader :users - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships sig { returns(XTwitterScraper::Resources::X::Followers) } attr_reader :followers sig { returns(XTwitterScraper::Resources::X::Dm) } attr_reader :dm - # Media upload & download + # Media upload and download sig { returns(XTwitterScraper::Resources::X::Media) } attr_reader :media @@ -33,11 +32,11 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Accounts) } attr_reader :accounts - # X data lookups (subscription required) + # Look up, search, and analyze individual tweets sig { returns(XTwitterScraper::Resources::X::Bookmarks) } attr_reader :bookmarks - # X data lookups (subscription required) + # X List followers, members, and tweets sig { returns(XTwitterScraper::Resources::X::Lists) } attr_reader :lists @@ -89,13 +88,21 @@ module XTwitterScraper ) end - # Get trending topics + # Get trending hashtags & topics from X by region sig do params( + count: Integer, + woeid: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::XGetTrendsResponse) end - def get_trends(request_options: {}) + def get_trends( + # Number of trending topics to return (1-50, default 30) + count: nil, + # Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey) + woeid: nil, + request_options: {} + ) end # @api private diff --git a/rbi/x_twitter_scraper/resources/x/accounts.rbi b/rbi/x_twitter_scraper/resources/x/accounts.rbi index 188ff21..921842e 100644 --- a/rbi/x_twitter_scraper/resources/x/accounts.rbi +++ b/rbi/x_twitter_scraper/resources/x/accounts.rbi @@ -83,6 +83,8 @@ module XTwitterScraper params( id: String, password: String, + email: String, + proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::AccountReauthResponse) @@ -92,6 +94,10 @@ module XTwitterScraper id, # Updated account password password:, + # Email for the X account (updates stored email) + email: nil, + # Two-letter country code for login proxy region + proxy_country: nil, # 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 3146b8e..859c236 100644 --- a/rbi/x_twitter_scraper/resources/x/bookmarks.rbi +++ b/rbi/x_twitter_scraper/resources/x/bookmarks.rbi @@ -3,7 +3,7 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and analyze individual tweets class Bookmarks # Get bookmarked tweets sig do diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index 964279f..c797005 100644 --- a/rbi/x_twitter_scraper/resources/x/communities.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities.rbi @@ -8,7 +8,7 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Communities::Join) } attr_reader :join - # X data lookups (subscription required) + # X Community info, members, and tweets sig { returns(XTwitterScraper::Resources::X::Communities::Tweets) } attr_reader :tweets @@ -52,7 +52,7 @@ module XTwitterScraper ) end - # Get community details + # Get community name, description & member count sig do params( id: String, @@ -66,11 +66,12 @@ module XTwitterScraper ) end - # Get community members + # List members of a community sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -79,11 +80,13 @@ module XTwitterScraper id, # Pagination cursor cursor: nil, + # Items per page (20-200, default 20) + page_size: nil, request_options: {} ) end - # Get community moderators + # List moderators of a community sig do params( id: String, @@ -100,7 +103,7 @@ module XTwitterScraper ) end - # Search tweets across communities + # Search for communities by keyword sig do params( q: String, diff --git a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi index 6aa94f9..89d33bf 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi @@ -4,9 +4,9 @@ module XTwitterScraper module Resources class X class Communities - # X data lookups (subscription required) + # X Community info, members, and tweets class Tweets - # Search tweets across all communities + # List tweets across all communities sig do params( q: String, @@ -26,7 +26,7 @@ module XTwitterScraper ) end - # Get community tweets + # List tweets posted in a community sig do params( id: String, diff --git a/rbi/x_twitter_scraper/resources/x/followers.rbi b/rbi/x_twitter_scraper/resources/x/followers.rbi index c09a732..c0936b6 100644 --- a/rbi/x_twitter_scraper/resources/x/followers.rbi +++ b/rbi/x_twitter_scraper/resources/x/followers.rbi @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships class Followers - # Check follow relationship + # Check if one user follows another sig do params( source: String, diff --git a/rbi/x_twitter_scraper/resources/x/lists.rbi b/rbi/x_twitter_scraper/resources/x/lists.rbi index 1d75770..6441106 100644 --- a/rbi/x_twitter_scraper/resources/x/lists.rbi +++ b/rbi/x_twitter_scraper/resources/x/lists.rbi @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # X List followers, members, and tweets class Lists - # Get list followers + # List followers of an X List sig do params( id: String, @@ -22,11 +22,12 @@ module XTwitterScraper ) end - # Get list members + # List members of an X List sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -35,11 +36,13 @@ module XTwitterScraper id, # Pagination cursor for list members cursor: nil, + # Members per page (20-200, default 20) + page_size: nil, request_options: {} ) end - # Get list tweets + # List tweets from an X List sig do params( id: String, diff --git a/rbi/x_twitter_scraper/resources/x/media.rbi b/rbi/x_twitter_scraper/resources/x/media.rbi index 1b9faeb..1d62a03 100644 --- a/rbi/x_twitter_scraper/resources/x/media.rbi +++ b/rbi/x_twitter_scraper/resources/x/media.rbi @@ -3,9 +3,9 @@ module XTwitterScraper module Resources class X - # Media upload & download + # Media upload and download class Media - # Download tweet media + # Download images & videos from tweets sig do params( tweet_ids: T::Array[String], diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index 916265c..042fc0b 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -16,29 +16,32 @@ module XTwitterScraper sig do params( account: String, - text: String, attachment_url: String, community_id: String, is_note_tweet: T::Boolean, - media_ids: T::Array[String], + media: T::Array[String], reply_to_tweet_id: String, + text: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::TweetCreateResponse) end def create( # X account (@username or account ID) account:, - text:, attachment_url: nil, community_id: nil, is_note_tweet: nil, - media_ids: nil, + # Array of public image URLs to attach (max 4). Each URL must be publicly + # reachable - the browser composer fetches them directly. + media: nil, reply_to_tweet_id: nil, + # Tweet text (optional when media is provided) + text: nil, request_options: {} ) end - # Look up tweet + # Get tweet with full text, author, metrics & media sig do params( id: String, @@ -83,7 +86,7 @@ module XTwitterScraper ) end - # Get users who liked a tweet + # List users who liked a tweet sig do params( id: String, @@ -100,7 +103,7 @@ module XTwitterScraper ) end - # Get quote tweets of a tweet + # List quote tweets of a tweet sig do params( id: String, @@ -126,7 +129,7 @@ module XTwitterScraper ) end - # Get replies to a tweet + # List replies to a tweet sig do params( id: String, @@ -149,7 +152,7 @@ module XTwitterScraper ) end - # Get users who retweeted a tweet + # List users who retweeted a tweet sig do params( id: String, @@ -166,7 +169,7 @@ module XTwitterScraper ) end - # Get thread context for a tweet + # Get full conversation thread for a tweet sig do params( id: String, @@ -183,7 +186,7 @@ module XTwitterScraper ) end - # Search tweets + # Search tweets with X query operators & pagination sig do params( q: String, @@ -203,11 +206,11 @@ module XTwitterScraper cursor: nil, # Max tweets to return (server paginates internally). Omit for single page (~20). limit: nil, - # Sort order — Latest (chronological) or Top (engagement-ranked) + # Sort order - Latest (chronological) or Top (engagement-ranked) query_type: nil, - # ISO 8601 timestamp — only return tweets after this time + # ISO 8601 timestamp - only return tweets after this time since_time: nil, - # ISO 8601 timestamp — only return tweets before this time + # ISO 8601 timestamp - only return tweets before this time until_time: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index b87ad0b..7ac08be 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -3,18 +3,18 @@ module XTwitterScraper module Resources class X - # X data lookups (subscription required) + # Look up, search, and explore user profiles and relationships class Users # X write actions (tweets, likes, follows, DMs) sig { returns(XTwitterScraper::Resources::X::Users::Follow) } attr_reader :follow - # Look up X user + # Get user profile with follower counts & verification sig do params( id: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::X::UserProfile) + ).returns(XTwitterScraper::UserProfile) end def retrieve( # X username (without @) or user ID @@ -23,7 +23,7 @@ module XTwitterScraper ) end - # Get multiple users by IDs + # Look up multiple users by IDs in one call sig do params( ids: String, @@ -37,7 +37,7 @@ module XTwitterScraper ) end - # Get user followers + # List followers of a user sig do params( id: String, @@ -57,7 +57,7 @@ module XTwitterScraper ) end - # Get followers you know for a user + # List mutual followers between you and a user sig do params( id: String, @@ -74,7 +74,7 @@ module XTwitterScraper ) end - # Get users this user follows + # List accounts a user follows sig do params( id: String, @@ -94,7 +94,7 @@ module XTwitterScraper ) end - # Get tweets liked by a user + # List tweets liked by a user sig do params( id: String, @@ -111,7 +111,7 @@ module XTwitterScraper ) end - # Get media tweets by a user + # List media tweets posted by a user sig do params( id: String, @@ -128,7 +128,7 @@ module XTwitterScraper ) end - # Get tweets mentioning a user + # List tweets mentioning a user sig do params( id: String, @@ -168,7 +168,7 @@ module XTwitterScraper ) end - # Get recent tweets by a user + # List recent tweets posted by a user sig do params( id: String, @@ -191,7 +191,7 @@ module XTwitterScraper ) end - # Get verified followers + # List verified followers of a user sig do params( id: String, diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 8278dc1..0000000 --- a/release-please-config.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "packages": { - ".": {} - }, - "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", - "include-v-in-tag": true, - "include-component-in-tag": false, - "versioning": "prerelease", - "prerelease": true, - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": false, - "pull-request-header": "Automated Release PR", - "pull-request-title-pattern": "release: ${version}", - "changelog-sections": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "perf", - "section": "Performance Improvements" - }, - { - "type": "revert", - "section": "Reverts" - }, - { - "type": "chore", - "section": "Chores" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "style", - "section": "Styles" - }, - { - "type": "refactor", - "section": "Refactors" - }, - { - "type": "test", - "section": "Tests", - "hidden": true - }, - { - "type": "build", - "section": "Build System" - }, - { - "type": "ci", - "section": "Continuous Integration", - "hidden": true - } - ], - "release-type": "ruby", - "version-file": "lib/x_twitter_scraper/version.rb", - "extra-files": [ - { - "type": "ruby-readme", - "path": "README.md" - } - ] -} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap index 3487864..a5e1b80 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd -- "$(dirname -- "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/sig/x_twitter_scraper/client.rbs b/sig/x_twitter_scraper/client.rbs index ba3df51..4dd52cf 100644 --- a/sig/x_twitter_scraper/client.rbs +++ b/sig/x_twitter_scraper/client.rbs @@ -36,21 +36,15 @@ module XTwitterScraper attr_reader webhooks: XTwitterScraper::Resources::Webhooks - attr_reader integrations: XTwitterScraper::Resources::Integrations - attr_reader x: XTwitterScraper::Resources::X attr_reader trends: XTwitterScraper::Resources::Trends - attr_reader bot: XTwitterScraper::Resources::Bot - attr_reader support: XTwitterScraper::Resources::Support attr_reader credits: XTwitterScraper::Resources::Credits - private def auth_headers: ( - security: { auth_api_key: bool, oauth_bearer: bool } - ) -> ::Hash[String, String] + private def auth_headers: -> ::Hash[String, String] private def auth_api_key: -> ::Hash[String, String] diff --git a/sig/x_twitter_scraper/internal/transport/base_client.rbs b/sig/x_twitter_scraper/internal/transport/base_client.rbs index ae83c6f..4de0c9e 100644 --- a/sig/x_twitter_scraper/internal/transport/base_client.rbs +++ b/sig/x_twitter_scraper/internal/transport/base_client.rbs @@ -20,7 +20,6 @@ module XTwitterScraper page: Class?, stream: Class?, model: XTwitterScraper::Internal::Type::Converter::input?, - security: { auth_api_key: bool, oauth_bearer: bool }?, options: XTwitterScraper::request_opts? } type request_input = @@ -124,7 +123,6 @@ module XTwitterScraper ?page: Class?, ?stream: Class?, ?model: XTwitterScraper::Internal::Type::Converter::input?, - ?security: { auth_api_key: bool, oauth_bearer: bool }?, ?options: XTwitterScraper::request_opts? ) -> top diff --git a/sig/x_twitter_scraper/models.rbs b/sig/x_twitter_scraper/models.rbs index 843876a..ab6aab2 100644 --- a/sig/x_twitter_scraper/models.rbs +++ b/sig/x_twitter_scraper/models.rbs @@ -69,24 +69,6 @@ module XTwitterScraper class ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams - class Integration = XTwitterScraper::Models::Integration - - class IntegrationCreateParams = XTwitterScraper::Models::IntegrationCreateParams - - class IntegrationDeleteParams = XTwitterScraper::Models::IntegrationDeleteParams - - class IntegrationDelivery = XTwitterScraper::Models::IntegrationDelivery - - class IntegrationListDeliveriesParams = XTwitterScraper::Models::IntegrationListDeliveriesParams - - class IntegrationListParams = XTwitterScraper::Models::IntegrationListParams - - class IntegrationRetrieveParams = XTwitterScraper::Models::IntegrationRetrieveParams - - class IntegrationSendTestParams = XTwitterScraper::Models::IntegrationSendTestParams - - class IntegrationUpdateParams = XTwitterScraper::Models::IntegrationUpdateParams - class Monitor = XTwitterScraper::Models::Monitor class MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -107,6 +89,8 @@ module XTwitterScraper class RadarRetrieveTrendingTopicsParams = XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams + class SearchTweet = XTwitterScraper::Models::SearchTweet + class StyleAnalyzeParams = XTwitterScraper::Models::StyleAnalyzeParams class StyleCompareParams = XTwitterScraper::Models::StyleCompareParams @@ -131,6 +115,8 @@ module XTwitterScraper class TrendListParams = XTwitterScraper::Models::TrendListParams + class UserProfile = XTwitterScraper::Models::UserProfile + class Webhook = XTwitterScraper::Models::Webhook class WebhookCreateParams = XTwitterScraper::Models::WebhookCreateParams diff --git a/sig/x_twitter_scraper/models/account_retrieve_response.rbs b/sig/x_twitter_scraper/models/account_retrieve_response.rbs index 9c5afd9..ae85137 100644 --- a/sig/x_twitter_scraper/models/account_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/account_retrieve_response.rbs @@ -5,7 +5,8 @@ module XTwitterScraper monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, - current_period: XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + credit_info: XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, + x_username: String } class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel @@ -15,24 +16,30 @@ module XTwitterScraper attr_accessor plan: XTwitterScraper::Models::AccountRetrieveResponse::plan - attr_reader current_period: XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod? + attr_reader credit_info: XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo? - def current_period=: ( - XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod - ) -> XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + def credit_info=: ( + XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo + ) -> XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo + + attr_reader x_username: String? + + def x_username=: (String) -> String def initialize: ( monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, - ?current_period: XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + ?credit_info: XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, + ?x_username: String ) -> void def to_hash: -> { monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, - current_period: XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod + credit_info: XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo, + x_username: String } type plan = :active | :inactive @@ -46,18 +53,36 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::AccountRetrieveResponse::plan] end - type current_period = { end_: Time, start: Time, usage_percent: Float } + type credit_info = + { + auto_topup_enabled: bool, + balance: Integer, + lifetime_purchased: Integer, + lifetime_used: Integer + } + + class CreditInfo < XTwitterScraper::Internal::Type::BaseModel + attr_accessor auto_topup_enabled: bool - class CurrentPeriod < XTwitterScraper::Internal::Type::BaseModel - attr_accessor end_: Time + attr_accessor balance: Integer - attr_accessor start: Time + attr_accessor lifetime_purchased: Integer - attr_accessor usage_percent: Float + attr_accessor lifetime_used: Integer - def initialize: (end_: Time, start: Time, usage_percent: Float) -> void + def initialize: ( + auto_topup_enabled: bool, + balance: Integer, + lifetime_purchased: Integer, + lifetime_used: Integer + ) -> void - def to_hash: -> { end_: Time, start: Time, usage_percent: Float } + def to_hash: -> { + auto_topup_enabled: bool, + balance: Integer, + lifetime_purchased: Integer, + lifetime_used: Integer + } end end end diff --git a/sig/x_twitter_scraper/models/error.rbs b/sig/x_twitter_scraper/models/error.rbs index 8ed307f..04c853a 100644 --- a/sig/x_twitter_scraper/models/error.rbs +++ b/sig/x_twitter_scraper/models/error.rbs @@ -19,17 +19,18 @@ module XTwitterScraper | :invalid_tweet_id | :invalid_tweet_url | :invalid_username + | :insufficient_credits | :missing_params | :missing_query | :monitor_already_exists | :monitor_limit_reached + | :no_credits | :no_subscription | :not_found - | :stream_registration_failed | :subscription_inactive | :tweet_not_found | :unauthenticated - | :usage_limit_reached + | :unsupported_field | :user_not_found | :webhook_inactive | :x_api_rate_limited @@ -48,17 +49,18 @@ module XTwitterScraper INVALID_TWEET_ID: :invalid_tweet_id INVALID_TWEET_URL: :invalid_tweet_url INVALID_USERNAME: :invalid_username + INSUFFICIENT_CREDITS: :insufficient_credits MISSING_PARAMS: :missing_params MISSING_QUERY: :missing_query MONITOR_ALREADY_EXISTS: :monitor_already_exists MONITOR_LIMIT_REACHED: :monitor_limit_reached + NO_CREDITS: :no_credits NO_SUBSCRIPTION: :no_subscription NOT_FOUND: :not_found - STREAM_REGISTRATION_FAILED: :stream_registration_failed SUBSCRIPTION_INACTIVE: :subscription_inactive TWEET_NOT_FOUND: :tweet_not_found UNAUTHENTICATED: :unauthenticated - USAGE_LIMIT_REACHED: :usage_limit_reached + UNSUPPORTED_FIELD: :unsupported_field USER_NOT_FOUND: :user_not_found WEBHOOK_INACTIVE: :webhook_inactive X_API_RATE_LIMITED: :x_api_rate_limited diff --git a/sig/x_twitter_scraper/models/event_type.rbs b/sig/x_twitter_scraper/models/event_type.rbs index eea3fc1..451f9f0 100644 --- a/sig/x_twitter_scraper/models/event_type.rbs +++ b/sig/x_twitter_scraper/models/event_type.rbs @@ -1,12 +1,7 @@ module XTwitterScraper module Models type event_type = - :"tweet.new" - | :"tweet.reply" - | :"tweet.retweet" - | :"tweet.quote" - | :"follower.gained" - | :"follower.lost" + :"tweet.new" | :"tweet.reply" | :"tweet.retweet" | :"tweet.quote" module EventType extend XTwitterScraper::Internal::Type::Enum @@ -15,8 +10,6 @@ module XTwitterScraper 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 diff --git a/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs b/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs index 58a9a4c..187c5c6 100644 --- a/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs +++ b/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs @@ -3,37 +3,44 @@ module XTwitterScraper type extraction_estimate_cost_response = { allowed: bool, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + resolved_x_user_id: String } class ExtractionEstimateCostResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor allowed: bool - attr_accessor estimated_results: Integer + attr_accessor credits_available: String + + attr_accessor credits_required: String - attr_accessor projected_percent: Float + attr_accessor estimated_results: Integer attr_accessor source: String - attr_accessor usage_percent: Float + attr_reader resolved_x_user_id: String? + + def resolved_x_user_id=: (String) -> String def initialize: ( allowed: bool, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + ?resolved_x_user_id: String ) -> void def to_hash: -> { allowed: bool, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + resolved_x_user_id: String } end end diff --git a/sig/x_twitter_scraper/models/integration.rbs b/sig/x_twitter_scraper/models/integration.rbs deleted file mode 100644 index 56f2546..0000000 --- a/sig/x_twitter_scraper/models/integration.rbs +++ /dev/null @@ -1,78 +0,0 @@ -module XTwitterScraper - module Models - type integration = - { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::event_type], - is_active: bool, - name: String, - type: :telegram, - 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::event_type] - - attr_accessor is_active: bool - - attr_accessor name: String - - attr_accessor type: :telegram - - 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::event_type], - is_active: bool, - name: String, - ?filters: ::Hash[Symbol, top], - ?message_template: String, - ?scope_all_monitors: bool, - ?silent_push: bool, - ?type: :telegram - ) -> void - - def to_hash: -> { - id: String, - config: ::Hash[Symbol, top], - created_at: Time, - event_types: ::Array[XTwitterScraper::Models::event_type], - is_active: bool, - name: String, - type: :telegram, - filters: ::Hash[Symbol, top], - message_template: String, - scope_all_monitors: bool, - silent_push: bool - } - 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 deleted file mode 100644 index 9384dc9..0000000 --- a/sig/x_twitter_scraper/models/integration_create_params.rbs +++ /dev/null @@ -1,51 +0,0 @@ -module XTwitterScraper - module Models - type integration_create_params = - { - config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::event_type], - name: String, - type: :telegram - } - & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationCreateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor config: XTwitterScraper::IntegrationCreateParams::Config - - attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] - - attr_accessor name: String - - attr_accessor type: :telegram - - def initialize: ( - config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::event_type], - name: String, - ?type: :telegram, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::event_type], - name: String, - type: :telegram, - request_options: XTwitterScraper::RequestOptions - } - - type config = { chat_id: String } - - class Config < XTwitterScraper::Internal::Type::BaseModel - attr_accessor chat_id: String - - def initialize: (chat_id: String) -> void - - def to_hash: -> { chat_id: String } - end - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_delete_params.rbs b/sig/x_twitter_scraper/models/integration_delete_params.rbs deleted file mode 100644 index 851878b..0000000 --- a/sig/x_twitter_scraper/models/integration_delete_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module XTwitterScraper - module Models - type integration_delete_params = - { id: String } & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationDeleteParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: XTwitterScraper::RequestOptions - } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_delete_response.rbs b/sig/x_twitter_scraper/models/integration_delete_response.rbs deleted file mode 100644 index 243619d..0000000 --- a/sig/x_twitter_scraper/models/integration_delete_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module XTwitterScraper - module Models - type integration_delete_response = { success: true } - - class IntegrationDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true - - def initialize: (?success: true) -> void - - def to_hash: -> { success: true } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_delivery.rbs b/sig/x_twitter_scraper/models/integration_delivery.rbs deleted file mode 100644 index f7d7dbd..0000000 --- a/sig/x_twitter_scraper/models/integration_delivery.rbs +++ /dev/null @@ -1,75 +0,0 @@ -module XTwitterScraper - module Models - type integration_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 IntegrationDelivery < 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 diff --git a/sig/x_twitter_scraper/models/integration_list_deliveries_params.rbs b/sig/x_twitter_scraper/models/integration_list_deliveries_params.rbs deleted file mode 100644 index 74c70be..0000000 --- a/sig/x_twitter_scraper/models/integration_list_deliveries_params.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module XTwitterScraper - module Models - type integration_list_deliveries_params = - { id: String, limit: Integer } - & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationListDeliveriesParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_reader limit: Integer? - - def limit=: (Integer) -> Integer - - def initialize: ( - id: String, - ?limit: Integer, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - id: String, - limit: Integer, - request_options: XTwitterScraper::RequestOptions - } - 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 deleted file mode 100644 index 4582d45..0000000 --- a/sig/x_twitter_scraper/models/integration_list_deliveries_response.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module XTwitterScraper - module Models - type integration_list_deliveries_response = - { deliveries: ::Array[XTwitterScraper::IntegrationDelivery] } - - class IntegrationListDeliveriesResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor deliveries: ::Array[XTwitterScraper::IntegrationDelivery] - - def initialize: ( - deliveries: ::Array[XTwitterScraper::IntegrationDelivery] - ) -> void - - def to_hash: -> { - deliveries: ::Array[XTwitterScraper::IntegrationDelivery] - } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_list_params.rbs b/sig/x_twitter_scraper/models/integration_list_params.rbs deleted file mode 100644 index c1ae07a..0000000 --- a/sig/x_twitter_scraper/models/integration_list_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module XTwitterScraper - module Models - type integration_list_params = - { } & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationListParams < 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 diff --git a/sig/x_twitter_scraper/models/integration_list_response.rbs b/sig/x_twitter_scraper/models/integration_list_response.rbs deleted file mode 100644 index 2d64d13..0000000 --- a/sig/x_twitter_scraper/models/integration_list_response.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module XTwitterScraper - module Models - type integration_list_response = - { integrations: ::Array[XTwitterScraper::Integration] } - - class IntegrationListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor integrations: ::Array[XTwitterScraper::Integration] - - def initialize: ( - integrations: ::Array[XTwitterScraper::Integration] - ) -> void - - def to_hash: -> { integrations: ::Array[XTwitterScraper::Integration] } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_retrieve_params.rbs b/sig/x_twitter_scraper/models/integration_retrieve_params.rbs deleted file mode 100644 index 95cde5b..0000000 --- a/sig/x_twitter_scraper/models/integration_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module XTwitterScraper - module Models - type integration_retrieve_params = - { id: String } & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationRetrieveParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: XTwitterScraper::RequestOptions - } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_send_test_params.rbs b/sig/x_twitter_scraper/models/integration_send_test_params.rbs deleted file mode 100644 index b82f148..0000000 --- a/sig/x_twitter_scraper/models/integration_send_test_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module XTwitterScraper - module Models - type integration_send_test_params = - { id: String } & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationSendTestParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: XTwitterScraper::RequestOptions - } - end - end -end diff --git a/sig/x_twitter_scraper/models/integration_send_test_response.rbs b/sig/x_twitter_scraper/models/integration_send_test_response.rbs deleted file mode 100644 index c36b404..0000000 --- a/sig/x_twitter_scraper/models/integration_send_test_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module XTwitterScraper - module Models - type integration_send_test_response = { success: true } - - class IntegrationSendTestResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true - - def initialize: (?success: true) -> void - - def to_hash: -> { success: true } - 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 deleted file mode 100644 index ad04555..0000000 --- a/sig/x_twitter_scraper/models/integration_update_params.rbs +++ /dev/null @@ -1,77 +0,0 @@ -module XTwitterScraper - module Models - type integration_update_params = - { - id: String, - event_types: ::Array[XTwitterScraper::Models::event_type], - filters: ::Hash[Symbol, top], - is_active: bool, - message_template: ::Hash[Symbol, top], - name: String, - scope_all_monitors: bool, - silent_push: bool - } - & XTwitterScraper::Internal::Type::request_parameters - - class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_reader event_types: ::Array[XTwitterScraper::Models::event_type]? - - def event_types=: ( - ::Array[XTwitterScraper::Models::event_type] - ) -> ::Array[XTwitterScraper::Models::event_type] - - attr_reader filters: ::Hash[Symbol, top]? - - def filters=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader is_active: bool? - - def is_active=: (bool) -> bool - - attr_reader message_template: ::Hash[Symbol, top]? - - def message_template=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader name: String? - - def name=: (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, - ?event_types: ::Array[XTwitterScraper::Models::event_type], - ?filters: ::Hash[Symbol, top], - ?is_active: bool, - ?message_template: ::Hash[Symbol, top], - ?name: String, - ?scope_all_monitors: bool, - ?silent_push: bool, - ?request_options: XTwitterScraper::request_opts - ) -> void - - def to_hash: -> { - id: String, - event_types: ::Array[XTwitterScraper::Models::event_type], - filters: ::Hash[Symbol, top], - is_active: bool, - message_template: ::Hash[Symbol, top], - name: String, - scope_all_monitors: bool, - silent_push: bool, - request_options: XTwitterScraper::RequestOptions - } - end - end -end diff --git a/sig/x_twitter_scraper/models/paginated_tweets.rbs b/sig/x_twitter_scraper/models/paginated_tweets.rbs index 65af5e0..0803196 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::X::SearchTweet] + tweets: ::Array[XTwitterScraper::SearchTweet] } class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel @@ -12,18 +12,18 @@ module XTwitterScraper attr_accessor next_cursor: String - attr_accessor tweets: ::Array[XTwitterScraper::X::SearchTweet] + attr_accessor tweets: ::Array[XTwitterScraper::SearchTweet] def initialize: ( has_next_page: bool, next_cursor: String, - tweets: ::Array[XTwitterScraper::X::SearchTweet] + tweets: ::Array[XTwitterScraper::SearchTweet] ) -> void def to_hash: -> { has_next_page: bool, next_cursor: String, - tweets: ::Array[XTwitterScraper::X::SearchTweet] + tweets: ::Array[XTwitterScraper::SearchTweet] } end end diff --git a/sig/x_twitter_scraper/models/paginated_users.rbs b/sig/x_twitter_scraper/models/paginated_users.rbs index f139b41..570fd13 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::X::UserProfile] + users: ::Array[XTwitterScraper::UserProfile] } class PaginatedUsers < XTwitterScraper::Internal::Type::BaseModel @@ -12,18 +12,18 @@ module XTwitterScraper attr_accessor next_cursor: String - attr_accessor users: ::Array[XTwitterScraper::X::UserProfile] + attr_accessor users: ::Array[XTwitterScraper::UserProfile] def initialize: ( has_next_page: bool, next_cursor: String, - users: ::Array[XTwitterScraper::X::UserProfile] + users: ::Array[XTwitterScraper::UserProfile] ) -> void def to_hash: -> { has_next_page: bool, next_cursor: String, - users: ::Array[XTwitterScraper::X::UserProfile] + users: ::Array[XTwitterScraper::UserProfile] } end end diff --git a/sig/x_twitter_scraper/models/radar_item.rbs b/sig/x_twitter_scraper/models/radar_item.rbs index 140b5c0..430d902 100644 --- a/sig/x_twitter_scraper/models/radar_item.rbs +++ b/sig/x_twitter_scraper/models/radar_item.rbs @@ -2,11 +2,16 @@ module XTwitterScraper module Models type radar_item = { - category: String, + id: String, + category: XTwitterScraper::Models::RadarItem::category, + created_at: Time, + language: String, + metadata: ::Hash[Symbol, top], published_at: Time, region: String, score: Float, - source: String, + source: XTwitterScraper::Models::RadarItem::source, + source_id: String, title: String, description: String, image_url: String, @@ -14,7 +19,15 @@ module XTwitterScraper } class RadarItem < XTwitterScraper::Internal::Type::BaseModel - attr_accessor category: String + attr_accessor id: String + + attr_accessor category: XTwitterScraper::Models::RadarItem::category + + attr_accessor created_at: Time + + attr_accessor language: String + + attr_accessor metadata: ::Hash[Symbol, top] attr_accessor published_at: Time @@ -22,7 +35,9 @@ module XTwitterScraper attr_accessor score: Float - attr_accessor source: String + attr_accessor source: XTwitterScraper::Models::RadarItem::source + + attr_accessor source_id: String attr_accessor title: String @@ -39,11 +54,16 @@ module XTwitterScraper def url=: (String) -> String def initialize: ( - category: String, + id: String, + category: XTwitterScraper::Models::RadarItem::category, + created_at: Time, + language: String, + metadata: ::Hash[Symbol, top], published_at: Time, region: String, score: Float, - source: String, + source: XTwitterScraper::Models::RadarItem::source, + source_id: String, title: String, ?description: String, ?image_url: String, @@ -51,16 +71,69 @@ module XTwitterScraper ) -> void def to_hash: -> { - category: String, + id: String, + category: XTwitterScraper::Models::RadarItem::category, + created_at: Time, + language: String, + metadata: ::Hash[Symbol, top], published_at: Time, region: String, score: Float, - source: String, + source: XTwitterScraper::Models::RadarItem::source, + source_id: String, title: String, description: String, image_url: String, url: String } + + type category = + :general + | :tech + | :dev + | :science + | :culture + | :politics + | :business + | :entertainment + + module Category + extend XTwitterScraper::Internal::Type::Enum + + GENERAL: :general + TECH: :tech + DEV: :dev + SCIENCE: :science + CULTURE: :culture + POLITICS: :politics + BUSINESS: :business + ENTERTAINMENT: :entertainment + + def self?.values: -> ::Array[XTwitterScraper::Models::RadarItem::category] + end + + 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::RadarItem::source] + 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 2670f94..bfe9c13 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 @@ -2,9 +2,10 @@ module XTwitterScraper module Models type radar_retrieve_trending_topics_params = { - category: String, - count: Integer, + after: String, + category: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category, hours: Integer, + limit: Integer, region: String, source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source } @@ -14,18 +15,24 @@ module XTwitterScraper extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_reader category: String? + attr_reader after: String? - def category=: (String) -> String + def after=: (String) -> String - attr_reader count: Integer? + attr_reader category: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category? - def count=: (Integer) -> Integer + def category=: ( + XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category + ) -> XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category attr_reader hours: Integer? def hours=: (Integer) -> Integer + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + attr_reader region: String? def region=: (String) -> String @@ -37,23 +44,50 @@ module XTwitterScraper ) -> XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source def initialize: ( - ?category: String, - ?count: Integer, + ?after: String, + ?category: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category, ?hours: Integer, + ?limit: Integer, ?region: String, ?source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - category: String, - count: Integer, + after: String, + category: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category, hours: Integer, + limit: Integer, region: String, source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, request_options: XTwitterScraper::RequestOptions } + type category = + :general + | :tech + | :dev + | :science + | :culture + | :politics + | :business + | :entertainment + + module Category + extend XTwitterScraper::Internal::Type::Enum + + GENERAL: :general + TECH: :tech + DEV: :dev + SCIENCE: :science + CULTURE: :culture + POLITICS: :politics + BUSINESS: :business + ENTERTAINMENT: :entertainment + + def self?.values: -> ::Array[XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category] + end + type source = :github | :google_trends 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 5348b2c..1a376ad 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,21 +1,31 @@ module XTwitterScraper module Models type radar_retrieve_trending_topics_response = - { items: ::Array[XTwitterScraper::RadarItem], total: Integer } + { + has_more: bool, + items: ::Array[XTwitterScraper::RadarItem], + next_cursor: String + } class RadarRetrieveTrendingTopicsResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor has_more: bool + attr_accessor items: ::Array[XTwitterScraper::RadarItem] - attr_accessor total: Integer + attr_reader next_cursor: String? + + def next_cursor=: (String) -> String def initialize: ( + has_more: bool, items: ::Array[XTwitterScraper::RadarItem], - total: Integer + ?next_cursor: String ) -> void def to_hash: -> { + has_more: bool, items: ::Array[XTwitterScraper::RadarItem], - total: Integer + next_cursor: String } end end diff --git a/sig/x_twitter_scraper/models/search_tweet.rbs b/sig/x_twitter_scraper/models/search_tweet.rbs new file mode 100644 index 0000000..aec8676 --- /dev/null +++ b/sig/x_twitter_scraper/models/search_tweet.rbs @@ -0,0 +1,119 @@ +module XTwitterScraper + module Models + type search_tweet = + { + id: String, + text: String, + author: XTwitterScraper::SearchTweet::Author, + bookmark_count: Integer, + created_at: String, + is_note_tweet: bool, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer, + view_count: Integer + } + + class SearchTweet < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor text: String + + attr_reader author: XTwitterScraper::SearchTweet::Author? + + def author=: ( + XTwitterScraper::SearchTweet::Author + ) -> XTwitterScraper::SearchTweet::Author + + attr_reader bookmark_count: Integer? + + def bookmark_count=: (Integer) -> Integer + + attr_reader created_at: String? + + 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 + + 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::SearchTweet::Author, + ?bookmark_count: Integer, + ?created_at: String, + ?is_note_tweet: bool, + ?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::SearchTweet::Author, + bookmark_count: Integer, + created_at: String, + is_note_tweet: bool, + 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 diff --git a/sig/x_twitter_scraper/models/user_profile.rbs b/sig/x_twitter_scraper/models/user_profile.rbs new file mode 100644 index 0000000..ac2c49e --- /dev/null +++ b/sig/x_twitter_scraper/models/user_profile.rbs @@ -0,0 +1,86 @@ +module XTwitterScraper + module Models + type user_profile = + { + 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 UserProfile < 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 diff --git a/sig/x_twitter_scraper/models/x/account_create_response.rbs b/sig/x_twitter_scraper/models/x/account_create_response.rbs index e6ab8a4..b176f72 100644 --- a/sig/x_twitter_scraper/models/x/account_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_create_response.rbs @@ -2,30 +2,73 @@ module XTwitterScraper module Models module X type account_create_response = - { id: String, status: String, x_user_id: String, x_username: String } + { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::health, + status: String, + x_user_id: String, + x_username: String, + login_country: String + } class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String + attr_accessor created_at: Time + + attr_accessor health: XTwitterScraper::Models::X::AccountCreateResponse::health + attr_accessor status: String attr_accessor x_user_id: String attr_accessor x_username: String + attr_reader login_country: String? + + def login_country=: (String) -> String + def initialize: ( id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::health, status: String, x_user_id: String, - x_username: String + x_username: String, + ?login_country: String ) -> void def to_hash: -> { id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::health, status: String, x_user_id: String, - x_username: String + x_username: String, + login_country: String } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue + + def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountCreateResponse::health] + end end end end diff --git a/sig/x_twitter_scraper/models/x/account_reauth_params.rbs b/sig/x_twitter_scraper/models/x/account_reauth_params.rbs index 6f8718b..547f6c4 100644 --- a/sig/x_twitter_scraper/models/x/account_reauth_params.rbs +++ b/sig/x_twitter_scraper/models/x/account_reauth_params.rbs @@ -2,7 +2,13 @@ module XTwitterScraper module Models module X type account_reauth_params = - { id: String, password: String, totp_secret: String } + { + id: String, + password: String, + email: String, + proxy_country: String, + totp_secret: String + } & XTwitterScraper::Internal::Type::request_parameters class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,6 +19,14 @@ module XTwitterScraper attr_accessor password: String + attr_reader email: String? + + def email=: (String) -> String + + attr_reader proxy_country: String? + + def proxy_country=: (String) -> String + attr_reader totp_secret: String? def totp_secret=: (String) -> String @@ -20,6 +34,8 @@ module XTwitterScraper def initialize: ( id: String, password: String, + ?email: String, + ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -27,6 +43,8 @@ module XTwitterScraper def to_hash: -> { id: String, password: String, + email: String, + proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs index 128f37b..1da44f3 100644 --- a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs @@ -2,18 +2,73 @@ module XTwitterScraper module Models module X type account_reauth_response = - { id: String, status: String, x_username: String } + { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountReauthResponse::health, + status: String, + x_user_id: String, + x_username: String, + login_country: String + } class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String + attr_accessor created_at: Time + + attr_accessor health: XTwitterScraper::Models::X::AccountReauthResponse::health + attr_accessor status: String + attr_accessor x_user_id: String + attr_accessor x_username: String - def initialize: (id: String, status: String, x_username: String) -> void + attr_reader login_country: String? + + def login_country=: (String) -> String + + def initialize: ( + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountReauthResponse::health, + status: String, + x_user_id: String, + x_username: String, + ?login_country: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountReauthResponse::health, + status: String, + x_user_id: String, + x_username: String, + login_country: String + } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue - def to_hash: -> { id: String, status: String, x_username: String } + def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountReauthResponse::health] + end end end end diff --git a/sig/x_twitter_scraper/models/x/community_retrieve_members_params.rbs b/sig/x_twitter_scraper/models/x/community_retrieve_members_params.rbs index e266981..7767555 100644 --- a/sig/x_twitter_scraper/models/x/community_retrieve_members_params.rbs +++ b/sig/x_twitter_scraper/models/x/community_retrieve_members_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type community_retrieve_members_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class CommunityRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/list_retrieve_members_params.rbs b/sig/x_twitter_scraper/models/x/list_retrieve_members_params.rbs index d39ab7d..f36f73d 100644 --- a/sig/x_twitter_scraper/models/x/list_retrieve_members_params.rbs +++ b/sig/x_twitter_scraper/models/x/list_retrieve_members_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type list_retrieve_members_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class ListRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/search_tweet.rbs b/sig/x_twitter_scraper/models/x/search_tweet.rbs deleted file mode 100644 index 9256302..0000000 --- a/sig/x_twitter_scraper/models/x/search_tweet.rbs +++ /dev/null @@ -1,121 +0,0 @@ -module XTwitterScraper - module Models - module X - type search_tweet = - { - id: String, - text: String, - author: XTwitterScraper::X::SearchTweet::Author, - bookmark_count: Integer, - created_at: String, - is_note_tweet: bool, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - view_count: Integer - } - - class SearchTweet < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor text: String - - attr_reader author: XTwitterScraper::X::SearchTweet::Author? - - def author=: ( - XTwitterScraper::X::SearchTweet::Author - ) -> XTwitterScraper::X::SearchTweet::Author - - attr_reader bookmark_count: Integer? - - def bookmark_count=: (Integer) -> Integer - - attr_reader created_at: String? - - 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 - - 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::X::SearchTweet::Author, - ?bookmark_count: Integer, - ?created_at: String, - ?is_note_tweet: bool, - ?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::X::SearchTweet::Author, - bookmark_count: Integer, - created_at: String, - is_note_tweet: bool, - 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/tweet_create_params.rbs b/sig/x_twitter_scraper/models/x/tweet_create_params.rbs index a447d34..ddb0bf5 100644 --- a/sig/x_twitter_scraper/models/x/tweet_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_create_params.rbs @@ -4,12 +4,12 @@ module XTwitterScraper type tweet_create_params = { account: String, - text: String, attachment_url: String, community_id: String, is_note_tweet: bool, - media_ids: ::Array[String], - reply_to_tweet_id: String + media: ::Array[String], + reply_to_tweet_id: String, + text: String } & XTwitterScraper::Internal::Type::request_parameters @@ -19,8 +19,6 @@ module XTwitterScraper attr_accessor account: String - attr_accessor text: String - attr_reader attachment_url: String? def attachment_url=: (String) -> String @@ -33,33 +31,37 @@ module XTwitterScraper def is_note_tweet=: (bool) -> bool - attr_reader media_ids: ::Array[String]? + attr_reader media: ::Array[String]? - def media_ids=: (::Array[String]) -> ::Array[String] + def media=: (::Array[String]) -> ::Array[String] attr_reader reply_to_tweet_id: String? def reply_to_tweet_id=: (String) -> String + attr_reader text: String? + + def text=: (String) -> String + def initialize: ( account: String, - text: String, ?attachment_url: String, ?community_id: String, ?is_note_tweet: bool, - ?media_ids: ::Array[String], + ?media: ::Array[String], ?reply_to_tweet_id: String, + ?text: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, - text: String, attachment_url: String, community_id: String, is_note_tweet: bool, - media_ids: ::Array[String], + media: ::Array[String], reply_to_tweet_id: String, + text: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/user_profile.rbs b/sig/x_twitter_scraper/models/x/user_profile.rbs deleted file mode 100644 index a397bb1..0000000 --- a/sig/x_twitter_scraper/models/x/user_profile.rbs +++ /dev/null @@ -1,88 +0,0 @@ -module XTwitterScraper - module Models - module X - type user_profile = - { - 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 UserProfile < 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/x_account.rbs b/sig/x_twitter_scraper/models/x/x_account.rbs index 2db4991..f788760 100644 --- a/sig/x_twitter_scraper/models/x/x_account.rbs +++ b/sig/x_twitter_scraper/models/x/x_account.rbs @@ -7,6 +7,7 @@ module XTwitterScraper { id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccount::health, status: String, x_user_id: String, x_username: String @@ -17,6 +18,8 @@ module XTwitterScraper attr_accessor created_at: Time + attr_accessor health: XTwitterScraper::Models::X::XAccount::health + attr_accessor status: String attr_accessor x_user_id: String @@ -26,6 +29,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccount::health, status: String, x_user_id: String, x_username: String @@ -34,10 +38,32 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccount::health, status: String, x_user_id: String, x_username: String } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue + + def self?.values: -> ::Array[XTwitterScraper::Models::X::XAccount::health] + end end end end diff --git a/sig/x_twitter_scraper/models/x/x_account_detail.rbs b/sig/x_twitter_scraper/models/x/x_account_detail.rbs index e74d6ce..298166e 100644 --- a/sig/x_twitter_scraper/models/x/x_account_detail.rbs +++ b/sig/x_twitter_scraper/models/x/x_account_detail.rbs @@ -7,6 +7,7 @@ module XTwitterScraper { id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccountDetail::health, status: String, x_user_id: String, x_username: String, @@ -20,6 +21,8 @@ module XTwitterScraper attr_accessor created_at: Time + attr_accessor health: XTwitterScraper::Models::X::XAccountDetail::health + attr_accessor status: String attr_accessor x_user_id: String @@ -41,6 +44,7 @@ module XTwitterScraper def initialize: ( id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccountDetail::health, status: String, x_user_id: String, x_username: String, @@ -52,6 +56,7 @@ module XTwitterScraper def to_hash: -> { id: String, created_at: Time, + health: XTwitterScraper::Models::X::XAccountDetail::health, status: String, x_user_id: String, x_username: String, @@ -59,6 +64,27 @@ module XTwitterScraper proxy_country: String, updated_at: Time } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue + + def self?.values: -> ::Array[XTwitterScraper::Models::X::XAccountDetail::health] + end end end end diff --git a/sig/x_twitter_scraper/models/x_get_trends_params.rbs b/sig/x_twitter_scraper/models/x_get_trends_params.rbs index 6978e89..a600e48 100644 --- a/sig/x_twitter_scraper/models/x_get_trends_params.rbs +++ b/sig/x_twitter_scraper/models/x_get_trends_params.rbs @@ -1,15 +1,32 @@ module XTwitterScraper module Models type x_get_trends_params = - { } & XTwitterScraper::Internal::Type::request_parameters + { count: Integer, woeid: Integer } + & XTwitterScraper::Internal::Type::request_parameters class XGetTrendsParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - def initialize: (?request_options: XTwitterScraper::request_opts) -> void + attr_reader count: Integer? - def to_hash: -> { request_options: XTwitterScraper::RequestOptions } + def count=: (Integer) -> Integer + + attr_reader woeid: Integer? + + def woeid=: (Integer) -> Integer + + def initialize: ( + ?count: Integer, + ?woeid: Integer, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + count: Integer, + woeid: Integer, + request_options: XTwitterScraper::RequestOptions + } end end end diff --git a/sig/x_twitter_scraper/resources/bot.rbs b/sig/x_twitter_scraper/resources/bot.rbs deleted file mode 100644 index ec180c6..0000000 --- a/sig/x_twitter_scraper/resources/bot.rbs +++ /dev/null @@ -1,9 +0,0 @@ -module XTwitterScraper - module Resources - class Bot - attr_reader platform_links: XTwitterScraper::Resources::Bot::PlatformLinks - - def initialize: (client: XTwitterScraper::Client) -> void - end - end -end diff --git a/sig/x_twitter_scraper/resources/bot/platform_links.rbs b/sig/x_twitter_scraper/resources/bot/platform_links.rbs deleted file mode 100644 index bcf35b7..0000000 --- a/sig/x_twitter_scraper/resources/bot/platform_links.rbs +++ /dev/null @@ -1,9 +0,0 @@ -module XTwitterScraper - module Resources - class Bot - class PlatformLinks - def initialize: (client: XTwitterScraper::Client) -> void - end - end - end -end diff --git a/sig/x_twitter_scraper/resources/integrations.rbs b/sig/x_twitter_scraper/resources/integrations.rbs deleted file mode 100644 index d2da60e..0000000 --- a/sig/x_twitter_scraper/resources/integrations.rbs +++ /dev/null @@ -1,52 +0,0 @@ -module XTwitterScraper - module Resources - class Integrations - def create: ( - config: XTwitterScraper::IntegrationCreateParams::Config, - event_types: ::Array[XTwitterScraper::Models::event_type], - name: String, - ?type: :telegram, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Integration - - def retrieve: ( - String id, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Integration - - def update: ( - String id, - ?event_types: ::Array[XTwitterScraper::Models::event_type], - ?filters: ::Hash[Symbol, top], - ?is_active: bool, - ?message_template: ::Hash[Symbol, top], - ?name: String, - ?scope_all_monitors: bool, - ?silent_push: bool, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Integration - - def list: ( - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationListResponse - - def delete: ( - String id, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationDeleteResponse - - def list_deliveries: ( - String id, - ?limit: Integer, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationListDeliveriesResponse - - def send_test: ( - String id, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::IntegrationSendTestResponse - - def initialize: (client: XTwitterScraper::Client) -> void - end - end -end diff --git a/sig/x_twitter_scraper/resources/radar.rbs b/sig/x_twitter_scraper/resources/radar.rbs index ecd4b00..47023a2 100644 --- a/sig/x_twitter_scraper/resources/radar.rbs +++ b/sig/x_twitter_scraper/resources/radar.rbs @@ -2,9 +2,10 @@ module XTwitterScraper module Resources class Radar def retrieve_trending_topics: ( - ?category: String, - ?count: Integer, + ?after: String, + ?category: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::category, ?hours: Integer, + ?limit: Integer, ?region: String, ?source: XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::source, ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/x.rbs b/sig/x_twitter_scraper/resources/x.rbs index 0051829..a5f6161 100644 --- a/sig/x_twitter_scraper/resources/x.rbs +++ b/sig/x_twitter_scraper/resources/x.rbs @@ -39,6 +39,8 @@ module XTwitterScraper ) -> XTwitterScraper::Models::XGetNotificationsResponse def get_trends: ( + ?count: Integer, + ?woeid: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::XGetTrendsResponse diff --git a/sig/x_twitter_scraper/resources/x/accounts.rbs b/sig/x_twitter_scraper/resources/x/accounts.rbs index 715f3c1..b6c9db2 100644 --- a/sig/x_twitter_scraper/resources/x/accounts.rbs +++ b/sig/x_twitter_scraper/resources/x/accounts.rbs @@ -32,6 +32,8 @@ module XTwitterScraper def reauth: ( String id, password: String, + ?email: String, + ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::AccountReauthResponse diff --git a/sig/x_twitter_scraper/resources/x/communities.rbs b/sig/x_twitter_scraper/resources/x/communities.rbs index df450c4..5a9f61a 100644 --- a/sig/x_twitter_scraper/resources/x/communities.rbs +++ b/sig/x_twitter_scraper/resources/x/communities.rbs @@ -28,6 +28,7 @@ module XTwitterScraper def retrieve_members: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers diff --git a/sig/x_twitter_scraper/resources/x/lists.rbs b/sig/x_twitter_scraper/resources/x/lists.rbs index 732d1ae..384354a 100644 --- a/sig/x_twitter_scraper/resources/x/lists.rbs +++ b/sig/x_twitter_scraper/resources/x/lists.rbs @@ -11,6 +11,7 @@ module XTwitterScraper def retrieve_members: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index c121db1..9f68fa6 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -8,12 +8,12 @@ module XTwitterScraper def create: ( account: String, - text: String, ?attachment_url: String, ?community_id: String, ?is_note_tweet: bool, - ?media_ids: ::Array[String], + ?media: ::Array[String], ?reply_to_tweet_id: String, + ?text: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::TweetCreateResponse diff --git a/sig/x_twitter_scraper/resources/x/users.rbs b/sig/x_twitter_scraper/resources/x/users.rbs index 9598320..cac3c4e 100644 --- a/sig/x_twitter_scraper/resources/x/users.rbs +++ b/sig/x_twitter_scraper/resources/x/users.rbs @@ -7,7 +7,7 @@ module XTwitterScraper def retrieve: ( String id, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::X::UserProfile + ) -> XTwitterScraper::UserProfile def retrieve_batch: ( ids: String, diff --git a/test/x_twitter_scraper/client_test.rb b/test/x_twitter_scraper/client_test.rb index 02bddfe..e6b0b1d 100644 --- a/test/x_twitter_scraper/client_test.rb +++ b/test/x_twitter_scraper/client_test.rb @@ -6,8 +6,6 @@ class XTwitterScraperTest < Minitest::Test extend Minitest::Serial include WebMock::API - TWEET_SEARCH_URL = "http://localhost/x/tweets/search?q=q" - def before_all super WebMock.enable! @@ -30,92 +28,67 @@ def after_all end def test_client_default_request_default_retry_attempts - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end assert_requested(:any, /./, times: 3) end def test_client_given_request_default_retry_attempts - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token", - max_retries: 3 - ) + XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end assert_requested(:any, /./, times: 4) end def test_client_default_request_given_retry_attempts - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q", request_options: {max_retries: 3}) + x_twitter_scraper.account.retrieve(request_options: {max_retries: 3}) end assert_requested(:any, /./, times: 4) end def test_client_given_request_given_retry_attempts - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token", - max_retries: 3 - ) + XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q", request_options: {max_retries: 4}) + x_twitter_scraper.account.retrieve(request_options: {max_retries: 4}) end assert_requested(:any, /./, times: 5) end def test_client_retry_after_seconds - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 500, headers: {"retry-after" => "1.3"}, body: {} ) x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token", - max_retries: 1 - ) + XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end assert_requested(:any, /./, times: 2) @@ -125,23 +98,18 @@ def test_client_retry_after_seconds def test_client_retry_after_date time_now = Time.now - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 500, headers: {"retry-after" => (time_now + 10).httpdate}, body: {} ) x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token", - max_retries: 1 - ) + XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) Thread.current.thread_variable_set(:time_now, time_now) assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end Thread.current.thread_variable_set(:time_now, nil) @@ -150,22 +118,17 @@ def test_client_retry_after_date end def test_client_retry_after_ms - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 500, headers: {"retry-after-ms" => "1300"}, body: {} ) x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token", - max_retries: 1 - ) + XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end assert_requested(:any, /./, times: 2) @@ -173,17 +136,12 @@ def test_client_retry_after_ms end def test_retry_count_header - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve end 3.times do @@ -192,20 +150,12 @@ def test_retry_count_header end def test_omit_retry_count_header - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search( - q: "q", - request_options: {extra_headers: {"x-stainless-retry-count" => nil}} - ) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) end assert_requested(:any, /./, times: 3) do @@ -214,27 +164,19 @@ def test_omit_retry_count_header end def test_overwrite_retry_count_header - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 500, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::InternalServerError) do - x_twitter_scraper.x.tweets.search( - q: "q", - request_options: {extra_headers: {"x-stainless-retry-count" => "42"}} - ) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) end assert_requested(:any, /./, headers: {"x-stainless-retry-count" => "42"}, times: 3) end def test_client_redirect_307 - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 307, headers: {"location" => "/redirected"}, body: {} @@ -244,15 +186,10 @@ def test_client_redirect_307 headers: {"location" => "/redirected"} ) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::APIConnectionError) do - x_twitter_scraper.x.tweets.search(q: "q", request_options: {extra_headers: {}}) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {}}) end recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first @@ -268,7 +205,7 @@ def test_client_redirect_307 end def test_client_redirect_303 - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 303, headers: {"location" => "/redirected"}, body: {} @@ -278,15 +215,10 @@ def test_client_redirect_303 headers: {"location" => "/redirected"} ) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::APIConnectionError) do - x_twitter_scraper.x.tweets.search(q: "q", request_options: {extra_headers: {}}) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {}}) end assert_requested(:get, "http://localhost/redirected", times: XTwitterScraper::Client::MAX_REDIRECTS) do @@ -297,7 +229,7 @@ def test_client_redirect_303 end def test_client_redirect_auth_keep_same_origin - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 307, headers: {"location" => "/redirected"}, body: {} @@ -307,18 +239,10 @@ def test_client_redirect_auth_keep_same_origin headers: {"location" => "/redirected"} ) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::APIConnectionError) do - x_twitter_scraper.x.tweets.search( - q: "q", - request_options: {extra_headers: {"authorization" => "Bearer xyz"}} - ) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) end recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first @@ -332,7 +256,7 @@ def test_client_redirect_auth_keep_same_origin end def test_client_redirect_auth_strip_cross_origin - stub_request(:get, TWEET_SEARCH_URL).to_return_json( + stub_request(:get, "http://localhost/account").to_return_json( status: 307, headers: {"location" => "https://example.com/redirected"}, body: {} @@ -342,18 +266,10 @@ def test_client_redirect_auth_strip_cross_origin headers: {"location" => "https://example.com/redirected"} ) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(XTwitterScraper::Errors::APIConnectionError) do - x_twitter_scraper.x.tweets.search( - q: "q", - request_options: {extra_headers: {"authorization" => "Bearer xyz"}} - ) + x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) end assert_requested(:any, "https://example.com/redirected", times: XTwitterScraper::Client::MAX_REDIRECTS) do @@ -363,16 +279,11 @@ def test_client_redirect_auth_strip_cross_origin end def test_default_headers - stub_request(:get, TWEET_SEARCH_URL).to_return_json(status: 200, body: {}) + stub_request(:get, "http://localhost/account").to_return_json(status: 200, body: {}) - x_twitter_scraper = - XTwitterScraper::Client.new( - base_url: "http://localhost", - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") - x_twitter_scraper.x.tweets.search(q: "q") + x_twitter_scraper.account.retrieve assert_requested(:any, /./) do |req| headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") diff --git a/test/x_twitter_scraper/resource_namespaces.rb b/test/x_twitter_scraper/resource_namespaces.rb index 382d24f..87cf0b2 100644 --- a/test/x_twitter_scraper/resource_namespaces.rb +++ b/test/x_twitter_scraper/resource_namespaces.rb @@ -3,9 +3,6 @@ module XTwitterScraper module Test module Resources - module Bot - end - module Communities end diff --git a/test/x_twitter_scraper/resources/account_test.rb b/test/x_twitter_scraper/resources/account_test.rb index b0fda96..09fc0c3 100644 --- a/test/x_twitter_scraper/resources/account_test.rb +++ b/test/x_twitter_scraper/resources/account_test.rb @@ -17,7 +17,8 @@ def test_retrieve monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::Plan, - current_period: XTwitterScraper::Models::AccountRetrieveResponse::CurrentPeriod | nil + credit_info: XTwitterScraper::Models::AccountRetrieveResponse::CreditInfo | nil, + x_username: String | nil } end end diff --git a/test/x_twitter_scraper/resources/bot/platform_links_test.rb b/test/x_twitter_scraper/resources/bot/platform_links_test.rb deleted file mode 100644 index 572e151..0000000 --- a/test/x_twitter_scraper/resources/bot/platform_links_test.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class XTwitterScraper::Test::Resources::Bot::PlatformLinksTest < XTwitterScraper::Test::ResourceTest -end diff --git a/test/x_twitter_scraper/resources/bot_test.rb b/test/x_twitter_scraper/resources/bot_test.rb deleted file mode 100644 index 7210fe3..0000000 --- a/test/x_twitter_scraper/resources/bot_test.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class XTwitterScraper::Test::Resources::BotTest < XTwitterScraper::Test::ResourceTest -end diff --git a/test/x_twitter_scraper/resources/extractions_test.rb b/test/x_twitter_scraper/resources/extractions_test.rb index 1d902d4..5a8677a 100644 --- a/test/x_twitter_scraper/resources/extractions_test.rb +++ b/test/x_twitter_scraper/resources/extractions_test.rb @@ -52,10 +52,11 @@ def test_estimate_cost_required_params assert_pattern do response => { allowed: XTwitterScraper::Internal::Type::Boolean, + credits_available: String, + credits_required: String, estimated_results: Integer, - projected_percent: Float, source: String, - usage_percent: Float + resolved_x_user_id: String | nil } end end diff --git a/test/x_twitter_scraper/resources/integrations_test.rb b/test/x_twitter_scraper/resources/integrations_test.rb deleted file mode 100644 index 537bf30..0000000 --- a/test/x_twitter_scraper/resources/integrations_test.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class XTwitterScraper::Test::Resources::IntegrationsTest < XTwitterScraper::Test::ResourceTest - def test_create_required_params - skip("Mock server tests are disabled") - - response = - @x_twitter_scraper.integrations.create( - config: {chatId: "-1001234567890"}, - event_types: [:"tweet.new", :"follower.gained"], - name: "My Telegram Bot", - type: :telegram - ) - - assert_pattern do - response => XTwitterScraper::Integration - end - - assert_pattern do - response => { - id: String, - config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), - created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), - is_active: XTwitterScraper::Internal::Type::Boolean, - name: String, - type: Symbol, - filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, - message_template: String | nil, - scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, - silent_push: XTwitterScraper::Internal::Type::Boolean | nil - } - end - end - - def test_retrieve - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.retrieve("id") - - assert_pattern do - response => XTwitterScraper::Integration - end - - assert_pattern do - response => { - id: String, - config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), - created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), - is_active: XTwitterScraper::Internal::Type::Boolean, - name: String, - type: Symbol, - filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, - message_template: String | nil, - scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, - silent_push: XTwitterScraper::Internal::Type::Boolean | nil - } - end - end - - def test_update - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.update("id") - - assert_pattern do - response => XTwitterScraper::Integration - end - - assert_pattern do - response => { - id: String, - config: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), - created_at: Time, - event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), - is_active: XTwitterScraper::Internal::Type::Boolean, - name: String, - type: Symbol, - filters: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, - message_template: String | nil, - scope_all_monitors: XTwitterScraper::Internal::Type::Boolean | nil, - silent_push: XTwitterScraper::Internal::Type::Boolean | nil - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.list - - assert_pattern do - response => XTwitterScraper::Models::IntegrationListResponse - end - - assert_pattern do - response => { - integrations: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Integration]) - } - end - end - - def test_delete - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.delete("id") - - assert_pattern do - response => XTwitterScraper::Models::IntegrationDeleteResponse - end - - assert_pattern do - response => { - success: true | false - } - end - end - - def test_list_deliveries - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.list_deliveries("id") - - assert_pattern do - response => XTwitterScraper::Models::IntegrationListDeliveriesResponse - end - - assert_pattern do - response => { - deliveries: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::IntegrationDelivery]) - } - end - end - - def test_send_test - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.integrations.send_test("id") - - assert_pattern do - response => XTwitterScraper::Models::IntegrationSendTestResponse - end - - assert_pattern do - response => { - success: true | false - } - end - end -end diff --git a/test/x_twitter_scraper/resources/monitors_test.rb b/test/x_twitter_scraper/resources/monitors_test.rb index 1b1f0d4..c756a87 100644 --- a/test/x_twitter_scraper/resources/monitors_test.rb +++ b/test/x_twitter_scraper/resources/monitors_test.rb @@ -7,10 +7,7 @@ def test_create_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.monitors.create( - event_types: [:"tweet.new", :"follower.gained"], - username: "elonmusk" - ) + @x_twitter_scraper.monitors.create(event_types: [:"tweet.new", :"tweet.reply"], username: "elonmusk") assert_pattern do response => XTwitterScraper::Models::MonitorCreateResponse diff --git a/test/x_twitter_scraper/resources/radar_test.rb b/test/x_twitter_scraper/resources/radar_test.rb index 9de3944..c30b150 100644 --- a/test/x_twitter_scraper/resources/radar_test.rb +++ b/test/x_twitter_scraper/resources/radar_test.rb @@ -14,8 +14,9 @@ def test_retrieve_trending_topics assert_pattern do response => { + has_more: XTwitterScraper::Internal::Type::Boolean, items: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::RadarItem]), - total: Integer + next_cursor: String | nil } end end diff --git a/test/x_twitter_scraper/resources/webhooks_test.rb b/test/x_twitter_scraper/resources/webhooks_test.rb index 9c9653a..0ea89cf 100644 --- a/test/x_twitter_scraper/resources/webhooks_test.rb +++ b/test/x_twitter_scraper/resources/webhooks_test.rb @@ -8,7 +8,7 @@ def test_create_required_params response = @x_twitter_scraper.webhooks.create( - event_types: [:"tweet.new", :"follower.gained"], + event_types: [:"tweet.new", :"tweet.reply"], url: "https://example.com/webhook" ) diff --git a/test/x_twitter_scraper/resources/x/accounts_test.rb b/test/x_twitter_scraper/resources/x/accounts_test.rb index 820e1b7..c725eb4 100644 --- a/test/x_twitter_scraper/resources/x/accounts_test.rb +++ b/test/x_twitter_scraper/resources/x/accounts_test.rb @@ -20,9 +20,12 @@ def test_create_required_params assert_pattern do response => { id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::Health, status: String, x_user_id: String, - x_username: String + x_username: String, + login_country: String | nil } end end @@ -40,6 +43,7 @@ def test_retrieve response => { id: String, created_at: Time, + health: XTwitterScraper::X::XAccountDetail::Health, status: String, x_user_id: String, x_username: String, @@ -110,8 +114,12 @@ def test_reauth_required_params assert_pattern do response => { id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountReauthResponse::Health, status: String, - x_username: String + x_user_id: String, + x_username: String, + login_country: String | nil } end end diff --git a/test/x_twitter_scraper/resources/x/bookmarks_test.rb b/test/x_twitter_scraper/resources/x/bookmarks_test.rb index 007889d..adf9b22 100644 --- a/test/x_twitter_scraper/resources/x/bookmarks_test.rb +++ b/test/x_twitter_scraper/resources/x/bookmarks_test.rb @@ -16,7 +16,7 @@ def test_list response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end 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 2f4119f..d34c475 100644 --- a/test/x_twitter_scraper/resources/x/communities/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/tweets_test.rb @@ -16,7 +16,7 @@ def test_list_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -34,7 +34,7 @@ def test_list_by_community response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } 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 781deb5..37c1e8e 100644 --- a/test/x_twitter_scraper/resources/x/communities_test.rb +++ b/test/x_twitter_scraper/resources/x/communities_test.rb @@ -67,7 +67,7 @@ def test_retrieve_members response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -85,7 +85,7 @@ def test_retrieve_moderators response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -103,7 +103,7 @@ def test_retrieve_search_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/resources/x/lists_test.rb b/test/x_twitter_scraper/resources/x/lists_test.rb index d3fe4b2..4212fec 100644 --- a/test/x_twitter_scraper/resources/x/lists_test.rb +++ b/test/x_twitter_scraper/resources/x/lists_test.rb @@ -16,7 +16,7 @@ def test_retrieve_followers response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -34,7 +34,7 @@ def test_retrieve_members response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -52,7 +52,7 @@ def test_retrieve_tweets response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/resources/x/tweets_test.rb b/test/x_twitter_scraper/resources/x/tweets_test.rb index ec69d9e..c443276 100644 --- a/test/x_twitter_scraper/resources/x/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets_test.rb @@ -6,8 +6,7 @@ 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: "@elonmusk", text: "Just launched our new feature!") + response = @x_twitter_scraper.x.tweets.create(account: "@elonmusk") assert_pattern do response => XTwitterScraper::Models::X::TweetCreateResponse @@ -51,7 +50,7 @@ def test_list_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -85,7 +84,7 @@ def test_get_favoriters response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -103,7 +102,7 @@ def test_get_quotes response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -121,7 +120,7 @@ def test_get_replies response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -139,7 +138,7 @@ def test_get_retweeters response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -157,7 +156,7 @@ def test_get_thread response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -175,7 +174,7 @@ def test_search_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/resources/x/users_test.rb b/test/x_twitter_scraper/resources/x/users_test.rb index 9dcf152..742cdf3 100644 --- a/test/x_twitter_scraper/resources/x/users_test.rb +++ b/test/x_twitter_scraper/resources/x/users_test.rb @@ -9,7 +9,7 @@ def test_retrieve response = @x_twitter_scraper.x.users.retrieve("id") assert_pattern do - response => XTwitterScraper::X::UserProfile + response => XTwitterScraper::UserProfile end assert_pattern do @@ -42,7 +42,7 @@ def test_retrieve_batch_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -60,7 +60,7 @@ def test_retrieve_followers response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -78,7 +78,7 @@ def test_retrieve_followers_you_know response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -96,7 +96,7 @@ def test_retrieve_following response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -114,7 +114,7 @@ def test_retrieve_likes response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -132,7 +132,7 @@ def test_retrieve_media response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -150,7 +150,7 @@ def test_retrieve_mentions response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -168,7 +168,7 @@ def test_retrieve_search_required_params response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end @@ -186,7 +186,7 @@ def test_retrieve_tweets response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end @@ -204,7 +204,7 @@ def test_retrieve_verified_followers response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::UserProfile]) + users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end end diff --git a/test/x_twitter_scraper/resources/x_test.rb b/test/x_twitter_scraper/resources/x_test.rb index 95b739a..33321b7 100644 --- a/test/x_twitter_scraper/resources/x_test.rb +++ b/test/x_twitter_scraper/resources/x_test.rb @@ -33,7 +33,7 @@ def test_get_home_timeline response => { has_next_page: XTwitterScraper::Internal::Type::Boolean, next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::SearchTweet]) + tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) } end end diff --git a/test/x_twitter_scraper/test_helper.rb b/test/x_twitter_scraper/test_helper.rb index e0ddca7..f1364bb 100644 --- a/test/x_twitter_scraper/test_helper.rb +++ b/test/x_twitter_scraper/test_helper.rb @@ -48,11 +48,7 @@ class XTwitterScraper::Test::SingletonClient < XTwitterScraper::Client TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") def initialize - super( - base_url: XTwitterScraper::Test::SingletonClient::TEST_API_BASE_URL, - api_key: "My API Key", - bearer_token: "My Bearer Token" - ) + super(base_url: XTwitterScraper::Test::SingletonClient::TEST_API_BASE_URL, api_key: "My API Key") end end diff --git a/x_twitter_scraper.gemspec b/x_twitter_scraper.gemspec index 242288a..6fa56ae 100644 --- a/x_twitter_scraper.gemspec +++ b/x_twitter_scraper.gemspec @@ -5,18 +5,13 @@ require_relative "lib/x_twitter_scraper/version" Gem::Specification.new do |s| s.name = "x-twitter-scraper" s.version = XTwitterScraper::VERSION - s.summary = "Xquik Ruby SDK for tweet search, profile tweets, followers, webhooks, and automation. Not affiliated with X Corp." + s.summary = "Ruby library to access the X Twitter Scraper API" s.authors = ["X Twitter Scraper"] s.email = "support@xquik.com" - s.licenses = ["Apache-2.0"] - s.homepage = "https://docs.xquik.com/sdks/ruby" + s.homepage = "https://gemdocs.org/gems/x-twitter-scraper" s.metadata["homepage_uri"] = s.homepage - s.metadata["bug_tracker_uri"] = "https://github.com/Xquik-dev/x-twitter-scraper-ruby/issues" - s.metadata["changelog_uri"] = "https://github.com/Xquik-dev/x-twitter-scraper-ruby/blob/main/CHANGELOG.md" - s.metadata["documentation_uri"] = "https://gemdocs.org/gems/x-twitter-scraper" - s.metadata["funding_uri"] = "https://xquik.com" - s.metadata["source_code_uri"] = "https://github.com/Xquik-dev/x-twitter-scraper-ruby" - s.metadata["rubygems_mfa_required"] = true.to_s + s.metadata["source_code_uri"] = "https://github.com/stainless-sdks/x-twitter-scraper-ruby" + s.metadata["rubygems_mfa_required"] = false.to_s s.required_ruby_version = ">= 3.2.0" s.files = Dir[ @@ -29,6 +24,6 @@ Gem::Specification.new do |s| ".ignore" ] s.extra_rdoc_files = ["README.md"] - s.add_dependency "cgi", "~> 0.5" - s.add_dependency "connection_pool", "~> 2.5" + s.add_dependency "cgi" + s.add_dependency "connection_pool" end From aa4d01037f1291a2e15ae7e7e9b119e33cc3a073 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 07:20:31 +0000 Subject: [PATCH 02/12] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 52f4e24..5a800ca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 110 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-fa5dce40b67286178b383dc78f45cf06031f3c78db04306630abc8d9d12ee03e.yml -openapi_spec_hash: 89dbd520dbea314871679a8321ce7f65 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-0ec75c61af54099cc219c0216c2fd1f585a6ff647d58803a775f0cc90496a463.yml +openapi_spec_hash: 94ffa4c398ff0a22c0eab3eae6536e36 config_hash: 0a29dafd3c416019a49430105808d7d4 From a0525b8b5cf1a2a8c5ef7c67aa69d41152439ff1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:42:10 +0000 Subject: [PATCH 03/12] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a800ca..804394a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 110 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-0ec75c61af54099cc219c0216c2fd1f585a6ff647d58803a775f0cc90496a463.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-448f3b69552e6515e1df3a34f7f299eb6313dd904b0f3840ea4228b047aa1b6f.yml openapi_spec_hash: 94ffa4c398ff0a22c0eab3eae6536e36 config_hash: 0a29dafd3c416019a49430105808d7d4 From 204e41e4a114e98706426ca7bfdb6c3694a179ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 02:21:03 +0000 Subject: [PATCH 04/12] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d112511..09237f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -39,7 +39,7 @@ jobs: github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -60,9 +60,9 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -76,9 +76,9 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- From b0186db54e9074f563ae6528506fbd12d607d607 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 02:34:15 +0000 Subject: [PATCH 05/12] fix(client): elide content type header on requests without body --- lib/x_twitter_scraper/internal/transport/base_client.rb | 2 ++ test/x_twitter_scraper/client_test.rb | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/x_twitter_scraper/internal/transport/base_client.rb b/lib/x_twitter_scraper/internal/transport/base_client.rb index aa3b191..5575ca6 100644 --- a/lib/x_twitter_scraper/internal/transport/base_client.rb +++ b/lib/x_twitter_scraper/internal/transport/base_client.rb @@ -306,6 +306,8 @@ def initialize( XTwitterScraper::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + headers.delete("content-type") if body.nil? + url = XTwitterScraper::Internal::Util.join_parsed_uri( @base_url_components, {**req, path: path, query: query} diff --git a/test/x_twitter_scraper/client_test.rb b/test/x_twitter_scraper/client_test.rb index e6b0b1d..18884d8 100644 --- a/test/x_twitter_scraper/client_test.rb +++ b/test/x_twitter_scraper/client_test.rb @@ -198,8 +198,8 @@ def test_client_redirect_307 assert_equal(recorded.method, _1.method) assert_equal(recorded.body, _1.body) assert_equal( - recorded.headers.transform_keys(&:downcase).fetch("content-type"), - _1.headers.transform_keys(&:downcase).fetch("content-type") + recorded.headers.transform_keys(&:downcase)["content-type"], + _1.headers.transform_keys(&:downcase)["content-type"] ) end end @@ -286,8 +286,9 @@ def test_default_headers x_twitter_scraper.account.retrieve assert_requested(:any, /./) do |req| - headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") - headers.each { refute_empty(_1) } + headers = req.headers.transform_keys(&:downcase) + expected = req.body.nil? ? ["accept"] : %w[accept content-type] + headers.fetch_values(*expected).each { refute_empty(_1) } end end end From d30969a0946c18bd17117466dc6ea4e22b1187e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 08:12:47 +0000 Subject: [PATCH 06/12] Regenerate SDKs from finalized API contract --- .github/workflows/publish-gem.yml | 31 + .github/workflows/release-doctor.yml | 22 + .release-please-manifest.json | 3 + .stats.yml | 8 +- CONTRIBUTING.md | 4 +- README.md | 31 +- Rakefile | 7 +- bin/check-release-environment | 21 + lib/x_twitter_scraper.rb | 50 +- lib/x_twitter_scraper/client.rb | 18 +- .../internal/transport/base_client.rb | 32 +- .../internal/type/base_model.rb | 7 +- lib/x_twitter_scraper/models.rb | 28 +- .../models/account_retrieve_response.rb | 122 ++- lib/x_twitter_scraper/models/api_key.rb | 47 - .../models/api_key_create_params.rb | 20 - .../models/api_key_create_response.rb | 40 - .../models/api_key_list_response.rb | 16 - .../models/api_key_revoke_response.rb | 16 - .../models/content_disclosure.rb | 66 ++ .../credit_redirect_topup_checkout_params.rb | 22 + .../credit_retrieve_balance_response.rb | 47 +- .../credit_retrieve_topup_status_params.rb | 22 + .../credit_retrieve_topup_status_response.rb | 45 + .../models/credit_topup_balance_params.rb | 18 +- .../models/credit_topup_balance_response.rb | 23 +- .../models/draft_list_params.rb | 10 +- lib/x_twitter_scraper/models/draw_detail.rb | 16 +- .../models/draw_export_params.rb | 6 +- .../models/draw_list_item.rb | 9 +- .../models/draw_list_params.rb | 20 +- .../models/draw_run_response.rb | 15 +- .../models/embedded_tweet.rb | 202 ++++ lib/x_twitter_scraper/models/error.rb | 238 ++++- lib/x_twitter_scraper/models/event.rb | 54 +- lib/x_twitter_scraper/models/event_detail.rb | 49 +- .../models/event_list_params.rb | 20 +- lib/x_twitter_scraper/models/event_type.rb | 17 + .../models/extraction_estimate_cost_params.rb | 315 +++++- .../extraction_estimate_cost_response.rb | 24 +- .../extraction_export_results_params.rb | 6 +- .../models/extraction_job.rb | 3 + .../models/extraction_list_params.rb | 23 +- .../models/extraction_retrieve_params.rb | 10 +- .../models/extraction_run_params.rb | 311 +++++- .../models/extraction_run_response.rb | 3 + .../models/guest_wallet_amount.rb | 25 + .../models/guest_wallet_create_params.rb | 36 + .../models/guest_wallet_create_response.rb | 161 +++ ...=> guest_wallet_retrieve_status_params.rb} | 4 +- .../guest_wallet_retrieve_status_response.rb | 196 ++++ .../models/guest_wallet_topup_params.rb | 36 + .../models/guest_wallet_topup_response.rb | 172 ++++ lib/x_twitter_scraper/models/monitor.rb | 10 +- .../models/monitor_create_response.rb | 17 +- .../models/monitors/keyword_create_params.rb | 34 + .../monitors/keyword_create_response.rb | 59 ++ .../monitors/keyword_deactivate_params.rb | 22 + .../monitors/keyword_deactivate_response.rb | 18 + .../models/monitors/keyword_list_params.rb | 16 + .../models/monitors/keyword_list_response.rb | 76 ++ .../monitors/keyword_retrieve_params.rb | 22 + .../monitors/keyword_retrieve_response.rb | 59 ++ .../models/monitors/keyword_update_params.rb | 40 + .../monitors/keyword_update_response.rb | 59 ++ .../models/paginated_tweets.rb | 6 +- .../models/paginated_users.rb | 6 +- lib/x_twitter_scraper/models/radar_item.rb | 4 +- .../radar_retrieve_trending_topics_params.rb | 8 +- lib/x_twitter_scraper/models/search_tweet.rb | 233 +++-- .../models/subscribe_create_params.rb | 22 +- .../models/subscribe_create_response.rb | 20 +- lib/x_twitter_scraper/models/tweet_media.rb | 77 ++ lib/x_twitter_scraper/models/user_profile.rb | 183 +++- lib/x_twitter_scraper/models/webhook.rb | 47 +- .../models/webhook_create_response.rb | 3 +- ...oke_params.rb => webhook_resume_params.rb} | 4 +- .../models/webhook_resume_response.rb | 31 + ...ount_connection_challenge_submit_params.rb | 31 + ...nt_connection_challenge_submit_response.rb | 66 ++ .../models/x/account_create_params.rb | 10 +- .../models/x/account_create_response.rb | 26 +- .../models/x/account_reauth_params.rb | 10 +- .../models/x/account_reauth_response.rb | 26 +- .../x/bookmark_retrieve_folders_response.rb | 8 +- .../x/communities/join_create_response.rb | 20 + .../x/communities/join_delete_all_response.rb | 20 + .../tweet_list_by_community_params.rb | 18 +- .../models/x/communities/tweet_list_params.rb | 52 +- .../models/x/community_action_result.rb | 31 - .../x/community_retrieve_info_response.rb | 70 +- .../x/community_retrieve_members_params.rb | 9 +- .../x/community_retrieve_search_params.rb | 42 +- .../models/x/dm_retrieve_history_params.rb | 14 +- .../models/x/dm_retrieve_history_response.rb | 35 +- .../models/x/dm_send_params.rb | 12 +- .../models/x/follower_check_params.rb | 8 +- .../x/list_retrieve_followers_params.rb | 16 +- .../models/x/list_retrieve_tweets_params.rb | 17 +- .../models/x/media_download_params.rb | 22 +- .../models/x/media_upload_params.rb | 23 +- .../models/x/media_upload_response.rb | 11 +- .../models/x/profile_update_avatar_params.rb | 16 +- .../models/x/profile_update_banner_params.rb | 16 +- .../models/x/tweet_author.rb | 25 +- .../models/x/tweet_create_params.rb | 7 +- .../models/x/tweet_create_response.rb | 29 +- .../models/x/tweet_detail.rb | 152 ++- .../models/x/tweet_get_favoriters_params.rb | 16 +- .../models/x/tweet_get_quotes_params.rb | 269 ++++- .../models/x/tweet_get_replies_params.rb | 269 ++++- .../models/x/tweet_get_retweeters_params.rb | 16 +- .../models/x/tweet_get_thread_params.rb | 17 +- .../models/x/tweet_retrieve_response.rb | 13 +- .../models/x/tweet_search_params.rb | 308 +++++- .../models/x/user_remove_follower_params.rb | 31 + .../models/x/user_remove_follower_response.rb | 18 + .../models/x/user_retrieve_batch_params.rb | 8 +- .../models/x/user_retrieve_batch_response.rb | 83 ++ .../x/user_retrieve_followers_params.rb | 28 +- ...user_retrieve_followers_you_know_params.rb | 17 +- .../x/user_retrieve_following_params.rb | 28 +- .../models/x/user_retrieve_likes_params.rb | 269 ++++- .../models/x/user_retrieve_media_params.rb | 269 ++++- .../models/x/user_retrieve_mentions_params.rb | 269 ++++- .../models/x/user_retrieve_replies_params.rb | 306 ++++++ .../models/x/user_retrieve_tweets_params.rb | 269 ++++- ...user_retrieve_verified_followers_params.rb | 17 +- .../models/x/write_action_retrieve_params.rb | 22 + .../x/write_action_retrieve_response.rb | 173 ++++ lib/x_twitter_scraper/models/x/x_account.rb | 18 +- .../models/x/x_account_detail.rb | 10 +- .../models/x_get_article_response.rb | 200 +++- .../models/x_get_home_timeline_params.rb | 4 +- .../models/x_get_notifications_params.rb | 6 +- lib/x_twitter_scraper/resources/api_keys.rb | 74 -- lib/x_twitter_scraper/resources/credits.rb | 56 +- lib/x_twitter_scraper/resources/drafts.rb | 9 +- lib/x_twitter_scraper/resources/draws.rb | 22 +- lib/x_twitter_scraper/resources/events.rb | 11 +- .../resources/extractions.rb | 165 ++- .../resources/guest_wallets.rb | 108 ++ lib/x_twitter_scraper/resources/monitors.rb | 18 +- .../resources/monitors/keywords.rb | 128 +++ lib/x_twitter_scraper/resources/radar.rb | 4 +- lib/x_twitter_scraper/resources/subscribe.rb | 11 +- .../resources/support/tickets.rb | 6 +- lib/x_twitter_scraper/resources/webhooks.rb | 28 +- lib/x_twitter_scraper/resources/x.rb | 24 +- .../x/account_connection_challenges.rb | 41 + lib/x_twitter_scraper/resources/x/accounts.rb | 14 +- .../resources/x/communities.rb | 26 +- .../resources/x/communities/join.rb | 12 +- .../resources/x/communities/tweets.rb | 33 +- lib/x_twitter_scraper/resources/x/dm.rb | 15 +- .../resources/x/followers.rb | 4 +- lib/x_twitter_scraper/resources/x/lists.rb | 17 +- lib/x_twitter_scraper/resources/x/media.rb | 16 +- lib/x_twitter_scraper/resources/x/profile.rb | 12 +- lib/x_twitter_scraper/resources/x/tweets.rb | 283 +++++- lib/x_twitter_scraper/resources/x/users.rb | 495 ++++++++- .../resources/x/write_actions.rb | 37 + rbi/x_twitter_scraper/client.rbi | 23 +- .../internal/transport/base_client.rbi | 9 +- rbi/x_twitter_scraper/models.rbi | 31 +- .../models/account_retrieve_response.rbi | 147 ++- rbi/x_twitter_scraper/models/api_key.rbi | 69 -- .../models/api_key_create_response.rbi | 56 -- .../models/api_key_list_response.rbi | 30 - .../models/api_key_revoke_response.rbi | 26 - .../models/content_disclosure.rbi | 149 +++ .../credit_redirect_topup_checkout_params.rbi | 46 + .../credit_retrieve_balance_response.rbi | 44 +- ...> credit_retrieve_topup_status_params.rbi} | 25 +- .../credit_retrieve_topup_status_response.rbi | 107 ++ .../models/credit_topup_balance_params.rbi | 26 +- .../models/credit_topup_balance_response.rbi | 24 +- .../models/draft_list_params.rbi | 10 +- rbi/x_twitter_scraper/models/draw_detail.rbi | 2 + .../models/draw_export_params.rbi | 15 +- .../models/draw_list_item.rbi | 2 + .../models/draw_list_params.rbi | 26 +- .../models/draw_run_response.rbi | 16 +- .../models/embedded_tweet.rbi | 255 +++++ rbi/x_twitter_scraper/models/error.rbi | 951 ++++++++++++++++-- rbi/x_twitter_scraper/models/event.rbi | 67 +- rbi/x_twitter_scraper/models/event_detail.rbi | 74 +- .../models/event_list_params.rbi | 26 +- rbi/x_twitter_scraper/models/event_type.rbi | 58 ++ .../extraction_estimate_cost_params.rbi | 582 ++++++++++- .../extraction_estimate_cost_response.rbi | 81 +- .../extraction_export_results_params.rbi | 16 +- .../models/extraction_job.rbi | 15 + .../models/extraction_list_params.rbi | 41 +- .../models/extraction_retrieve_params.rbi | 16 +- .../models/extraction_run_params.rbi | 548 +++++++++- .../models/extraction_run_response.rbi | 15 + .../models/guest_wallet_amount.rbi | 39 + .../models/guest_wallet_create_params.rbi | 58 ++ .../models/guest_wallet_create_response.rbi | 243 +++++ ...> guest_wallet_retrieve_status_params.rbi} | 4 +- .../guest_wallet_retrieve_status_response.rbi | 402 ++++++++ .../models/guest_wallet_topup_params.rbi | 58 ++ .../models/guest_wallet_topup_response.rbi | 293 ++++++ rbi/x_twitter_scraper/models/monitor.rbi | 8 + .../models/monitor_create_response.rbi | 14 + .../models/monitors/keyword_create_params.rbi | 56 ++ .../monitors/keyword_create_response.rbi | 75 ++ .../monitors/keyword_deactivate_params.rbi | 40 + .../monitors/keyword_deactivate_response.rbi | 28 + .../models/monitors/keyword_list_params.rbi | 34 + .../models/monitors/keyword_list_response.rbi | 123 +++ .../monitors/keyword_retrieve_params.rbi | 40 + .../monitors/keyword_retrieve_response.rbi | 75 ++ .../models/monitors/keyword_update_params.rbi | 72 ++ .../monitors/keyword_update_response.rbi | 75 ++ .../models/paginated_tweets.rbi | 6 +- .../models/paginated_users.rbi | 6 +- rbi/x_twitter_scraper/models/radar_item.rbi | 4 +- .../radar_retrieve_trending_topics_params.rbi | 8 +- rbi/x_twitter_scraper/models/search_tweet.rbi | 318 ++++-- .../models/subscribe_create_params.rbi | 64 +- .../models/subscribe_create_response.rbi | 33 +- rbi/x_twitter_scraper/models/tweet_media.rbi | 130 +++ rbi/x_twitter_scraper/models/user_profile.rbi | 229 ++++- rbi/x_twitter_scraper/models/webhook.rbi | 57 ++ .../models/webhook_create_response.rbi | 2 + ...e_params.rbi => webhook_resume_params.rbi} | 4 +- .../models/webhook_resume_response.rbi | 55 + ...unt_connection_challenge_submit_params.rbi | 54 + ...t_connection_challenge_submit_response.rbi | 131 +++ .../models/x/account_create_params.rbi | 11 - .../models/x/account_create_response.rbi | 27 +- .../models/x/account_reauth_params.rbi | 11 - .../models/x/account_reauth_response.rbi | 27 +- .../x/bookmark_retrieve_folders_response.rbi | 10 +- .../x/communities/join_create_response.rbi | 30 + .../communities/join_delete_all_response.rbi | 30 + .../tweet_list_by_community_params.rbi | 19 + .../x/communities/tweet_list_params.rbi | 95 +- .../models/x/community_action_result.rbi | 49 - .../x/community_retrieve_info_response.rbi | 115 +++ .../x/community_retrieve_members_params.rbi | 8 +- .../x/community_retrieve_search_params.rbi | 83 +- .../models/x/dm_retrieve_history_params.rbi | 10 + .../models/x/dm_retrieve_history_response.rbi | 33 +- .../models/x/dm_send_params.rbi | 11 +- .../models/x/follower_check_params.rbi | 8 +- .../x/list_retrieve_followers_params.rbi | 17 + .../models/x/list_retrieve_tweets_params.rbi | 19 + .../models/x/media_download_params.rbi | 26 +- .../models/x/media_upload_params.rbi | 27 +- .../models/x/media_upload_response.rbi | 25 +- .../models/x/profile_update_avatar_params.rbi | 18 +- .../models/x/profile_update_banner_params.rbi | 18 +- .../models/x/tweet_author.rbi | 47 +- .../models/x/tweet_create_params.rbi | 10 +- .../models/x/tweet_create_response.rbi | 46 +- .../models/x/tweet_detail.rbi | 271 ++--- .../models/x/tweet_get_favoriters_params.rbi | 17 + .../models/x/tweet_get_quotes_params.rbi | 508 ++++++++++ .../models/x/tweet_get_replies_params.rbi | 512 ++++++++++ .../models/x/tweet_get_retweeters_params.rbi | 17 + .../models/x/tweet_get_thread_params.rbi | 19 + .../models/x/tweet_retrieve_response.rbi | 12 +- .../models/x/tweet_search_params.rbi | 550 ++++++++++ .../models/x/user_remove_follower_params.rbi | 54 + .../x/user_remove_follower_response.rbi | 28 + .../models/x/user_retrieve_batch_params.rbi | 6 +- .../models/x/user_retrieve_batch_response.rbi | 102 ++ .../x/user_retrieve_followers_params.rbi | 32 +- ...ser_retrieve_followers_you_know_params.rbi | 17 + .../x/user_retrieve_following_params.rbi | 32 +- .../models/x/user_retrieve_likes_params.rbi | 520 ++++++++++ .../models/x/user_retrieve_media_params.rbi | 520 ++++++++++ .../x/user_retrieve_mentions_params.rbi | 523 ++++++++++ .../models/x/user_retrieve_replies_params.rbi | 591 +++++++++++ .../models/x/user_retrieve_tweets_params.rbi | 523 ++++++++++ ...ser_retrieve_verified_followers_params.rbi | 17 + .../models/x/write_action_retrieve_params.rbi | 40 + .../x/write_action_retrieve_response.rbi | 313 ++++++ rbi/x_twitter_scraper/models/x/x_account.rbi | 23 +- .../models/x/x_account_detail.rbi | 11 +- .../models/x_get_article_response.rbi | 320 +++++- .../models/x_get_home_timeline_params.rbi | 4 +- .../models/x_get_notifications_params.rbi | 6 +- rbi/x_twitter_scraper/resources/api_keys.rbi | 46 - rbi/x_twitter_scraper/resources/credits.rbi | 40 +- rbi/x_twitter_scraper/resources/drafts.rbi | 9 +- rbi/x_twitter_scraper/resources/draws.rbi | 22 +- rbi/x_twitter_scraper/resources/events.rbi | 13 +- .../resources/extractions.rbi | 221 +++- .../resources/guest_wallets.rbi | 76 ++ rbi/x_twitter_scraper/resources/monitors.rbi | 17 +- .../resources/monitors/keywords.rbi | 95 ++ rbi/x_twitter_scraper/resources/radar.rbi | 4 +- rbi/x_twitter_scraper/resources/subscribe.rbi | 10 +- .../resources/support/tickets.rbi | 6 +- rbi/x_twitter_scraper/resources/webhooks.rbi | 22 +- rbi/x_twitter_scraper/resources/x.rbi | 21 +- .../x/account_connection_challenges.rbi | 36 + .../resources/x/accounts.rbi | 12 +- .../resources/x/communities.rbi | 21 +- .../resources/x/communities/join.rbi | 12 +- .../resources/x/communities/tweets.rbi | 28 +- rbi/x_twitter_scraper/resources/x/dm.rbi | 7 +- .../resources/x/followers.rbi | 4 +- rbi/x_twitter_scraper/resources/x/lists.rbi | 13 + rbi/x_twitter_scraper/resources/x/media.rbi | 18 +- rbi/x_twitter_scraper/resources/x/profile.rbi | 16 +- rbi/x_twitter_scraper/resources/x/tweets.rbi | 300 +++++- rbi/x_twitter_scraper/resources/x/users.rbi | 516 +++++++++- .../resources/x/write_actions.rbi | 31 + release-please-config.json | 70 ++ sig/x_twitter_scraper/client.rbs | 8 +- .../internal/transport/base_client.rbs | 2 + sig/x_twitter_scraper/models.rbs | 28 +- .../models/account_retrieve_response.rbs | 86 +- sig/x_twitter_scraper/models/api_key.rbs | 47 - .../models/api_key_create_response.rbs | 40 - .../models/api_key_list_response.rbs | 13 - .../models/api_key_revoke_response.rbs | 13 - .../models/content_disclosure.rbs | 78 ++ .../credit_redirect_topup_checkout_params.rbs | 24 + .../credit_retrieve_balance_response.rbs | 34 +- ...> credit_retrieve_topup_status_params.rbs} | 15 +- .../credit_retrieve_topup_status_response.rbs | 45 + .../models/credit_topup_balance_params.rbs | 15 +- .../models/credit_topup_balance_response.rbs | 10 +- .../models/draw_export_params.rbs | 8 +- .../models/draw_list_params.rbs | 10 +- .../models/embedded_tweet.rbs | 187 ++++ sig/x_twitter_scraper/models/error.rbs | 397 ++++++-- sig/x_twitter_scraper/models/event.rbs | 36 +- sig/x_twitter_scraper/models/event_detail.rbs | 36 +- .../models/event_list_params.rbs | 10 +- sig/x_twitter_scraper/models/event_type.rbs | 39 +- .../extraction_estimate_cost_params.rbs | 270 ++++- .../extraction_estimate_cost_response.rbs | 35 +- .../extraction_export_results_params.rbs | 8 +- .../models/extraction_job.rbs | 6 + .../models/extraction_list_params.rbs | 16 +- .../models/extraction_retrieve_params.rbs | 10 +- .../models/extraction_run_params.rbs | 270 ++++- .../models/extraction_run_response.rbs | 6 + .../models/guest_wallet_amount.rbs | 15 + .../models/guest_wallet_create_params.rbs | 32 + .../models/guest_wallet_create_response.rbs | 125 +++ ...> guest_wallet_retrieve_status_params.rbs} | 4 +- .../guest_wallet_retrieve_status_response.rbs | 163 +++ .../models/guest_wallet_topup_params.rbs | 32 + .../models/guest_wallet_topup_response.rbs | 146 +++ sig/x_twitter_scraper/models/monitor.rbs | 5 + .../models/monitor_create_response.rbs | 10 + .../models/monitors/keyword_create_params.rbs | 33 + .../monitors/keyword_create_response.rbs | 47 + .../monitors/keyword_deactivate_params.rbs | 25 + .../monitors/keyword_deactivate_response.rbs | 15 + .../models/monitors/keyword_list_params.rbs | 19 + .../models/monitors/keyword_list_response.rbs | 69 ++ .../monitors/keyword_retrieve_params.rbs | 25 + .../monitors/keyword_retrieve_response.rbs | 47 + .../models/monitors/keyword_update_params.rbs | 44 + .../monitors/keyword_update_response.rbs | 47 + sig/x_twitter_scraper/models/search_tweet.rbs | 208 ++-- .../models/subscribe_create_params.rbs | 31 +- .../models/subscribe_create_response.rbs | 26 +- sig/x_twitter_scraper/models/tweet_media.rbs | 72 ++ sig/x_twitter_scraper/models/user_profile.rbs | 167 ++- sig/x_twitter_scraper/models/webhook.rbs | 27 + ...e_params.rbs => webhook_resume_params.rbs} | 4 +- .../models/webhook_resume_response.rbs | 26 + ...unt_connection_challenge_submit_params.rbs | 30 + ...t_connection_challenge_submit_response.rbs | 68 ++ .../models/x/account_create_params.rbs | 7 - .../models/x/account_create_response.rbs | 13 +- .../models/x/account_reauth_params.rbs | 14 +- .../models/x/account_reauth_response.rbs | 13 +- .../x/communities/join_create_response.rbs | 17 + .../communities/join_delete_all_response.rbs | 17 + .../tweet_list_by_community_params.rbs | 8 +- .../x/communities/tweet_list_params.rbs | 39 +- .../models/x/community_action_result.rbs | 28 - .../x/community_retrieve_info_response.rbs | 66 ++ .../x/community_retrieve_search_params.rbs | 39 +- .../models/x/dm_retrieve_history_params.rbs | 6 +- .../models/x/dm_retrieve_history_response.rbs | 23 +- .../models/x/dm_send_params.rbs | 9 +- .../x/list_retrieve_followers_params.rbs | 8 +- .../models/x/list_retrieve_tweets_params.rbs | 7 + .../models/x/media_download_params.rbs | 19 +- .../models/x/media_upload_params.rbs | 18 +- .../models/x/media_upload_response.rbs | 13 +- .../models/x/profile_update_avatar_params.rbs | 8 +- .../models/x/profile_update_banner_params.rbs | 8 +- .../models/x/tweet_author.rbs | 39 +- .../models/x/tweet_create_response.rbs | 33 +- .../models/x/tweet_detail.rbs | 160 +-- .../models/x/tweet_get_favoriters_params.rbs | 8 +- .../models/x/tweet_get_quotes_params.rbs | 243 ++++- .../models/x/tweet_get_replies_params.rbs | 248 ++++- .../models/x/tweet_get_retweeters_params.rbs | 8 +- .../models/x/tweet_get_thread_params.rbs | 8 +- .../models/x/tweet_search_params.rbs | 278 ++++- .../models/x/user_remove_follower_params.rbs | 30 + .../x/user_remove_follower_response.rbs | 15 + .../models/x/user_retrieve_batch_response.rbs | 57 ++ .../x/user_retrieve_followers_params.rbs | 20 +- ...ser_retrieve_followers_you_know_params.rbs | 8 +- .../x/user_retrieve_following_params.rbs | 20 +- .../models/x/user_retrieve_likes_params.rbs | 246 ++++- .../models/x/user_retrieve_media_params.rbs | 246 ++++- .../x/user_retrieve_mentions_params.rbs | 248 ++++- .../models/x/user_retrieve_replies_params.rbs | 283 ++++++ .../models/x/user_retrieve_tweets_params.rbs | 243 ++++- ...ser_retrieve_verified_followers_params.rbs | 8 +- .../models/x/write_action_retrieve_params.rbs | 25 + .../x/write_action_retrieve_response.rbs | 177 ++++ sig/x_twitter_scraper/models/x/x_account.rbs | 18 +- .../models/x/x_account_detail.rbs | 7 - .../models/x_get_article_response.rbs | 199 +++- sig/x_twitter_scraper/resources/api_keys.rbs | 21 - sig/x_twitter_scraper/resources/credits.rbs | 13 +- sig/x_twitter_scraper/resources/draws.rbs | 4 +- sig/x_twitter_scraper/resources/events.rbs | 2 +- .../resources/extractions.rbs | 64 +- .../resources/guest_wallets.rbs | 25 + sig/x_twitter_scraper/resources/monitors.rbs | 2 + .../resources/monitors/keywords.rbs | 36 + sig/x_twitter_scraper/resources/subscribe.rbs | 1 + sig/x_twitter_scraper/resources/webhooks.rbs | 5 + sig/x_twitter_scraper/resources/x.rbs | 4 + .../x/account_connection_challenges.rbs | 15 + .../resources/x/accounts.rbs | 2 - .../resources/x/communities.rbs | 4 +- .../resources/x/communities/join.rbs | 4 +- .../resources/x/communities/tweets.rbs | 5 +- sig/x_twitter_scraper/resources/x/dm.rbs | 2 +- sig/x_twitter_scraper/resources/x/lists.rbs | 2 + sig/x_twitter_scraper/resources/x/media.rbs | 5 +- sig/x_twitter_scraper/resources/x/profile.rbs | 4 +- sig/x_twitter_scraper/resources/x/tweets.rbs | 86 ++ sig/x_twitter_scraper/resources/x/users.rbs | 151 ++- .../resources/x/write_actions.rbs | 14 + test/x_twitter_scraper/client_test.rb | 105 +- test/x_twitter_scraper/resource_namespaces.rb | 3 + .../resources/account_test.rb | 1 + .../resources/api_keys_test.rb | 57 -- .../resources/credits_test.rb | 41 +- .../x_twitter_scraper/resources/draws_test.rb | 6 +- .../resources/events_test.rb | 5 +- .../resources/extractions_test.rb | 6 +- .../resources/guest_wallets_test.rb | 98 ++ .../resources/monitors/keywords_test.rb | 102 ++ .../resources/monitors_test.rb | 4 + .../resources/subscribe_test.rb | 6 +- .../resources/support/tickets_test.rb | 10 +- .../resources/webhooks_test.rb | 21 + .../x/account_connection_challenges_test.rb | 26 + .../resources/x/accounts_test.rb | 7 +- .../resources/x/communities/join_test.rb | 8 +- .../resources/x/communities/tweets_test.rb | 2 +- .../resources/x/communities_test.rb | 2 +- test/x_twitter_scraper/resources/x/dm_test.rb | 4 +- .../resources/x/media_test.rb | 3 +- .../resources/x/profile_test.rb | 4 +- .../resources/x/tweets_test.rb | 5 +- .../resources/x/users_test.rb | 68 +- .../resources/x/write_actions_test.rb | 38 + test/x_twitter_scraper/resources/x_test.rb | 2 +- test/x_twitter_scraper/test_helper.rb | 6 +- x_twitter_scraper.gemspec | 2 +- 472 files changed, 28809 insertions(+), 2780 deletions(-) create mode 100644 .github/workflows/publish-gem.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment delete mode 100644 lib/x_twitter_scraper/models/api_key.rb delete mode 100644 lib/x_twitter_scraper/models/api_key_create_params.rb delete mode 100644 lib/x_twitter_scraper/models/api_key_create_response.rb delete mode 100644 lib/x_twitter_scraper/models/api_key_list_response.rb delete mode 100644 lib/x_twitter_scraper/models/api_key_revoke_response.rb create mode 100644 lib/x_twitter_scraper/models/content_disclosure.rb create mode 100644 lib/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rb create mode 100644 lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb create mode 100644 lib/x_twitter_scraper/models/credit_retrieve_topup_status_response.rb create mode 100644 lib/x_twitter_scraper/models/embedded_tweet.rb create mode 100644 lib/x_twitter_scraper/models/guest_wallet_amount.rb create mode 100644 lib/x_twitter_scraper/models/guest_wallet_create_params.rb create mode 100644 lib/x_twitter_scraper/models/guest_wallet_create_response.rb rename lib/x_twitter_scraper/models/{api_key_list_params.rb => guest_wallet_retrieve_status_params.rb} (70%) create mode 100644 lib/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rb create mode 100644 lib/x_twitter_scraper/models/guest_wallet_topup_params.rb create mode 100644 lib/x_twitter_scraper/models/guest_wallet_topup_response.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_create_params.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_create_response.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_deactivate_params.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_deactivate_response.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_list_params.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_list_response.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_retrieve_params.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_retrieve_response.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_update_params.rb create mode 100644 lib/x_twitter_scraper/models/monitors/keyword_update_response.rb create mode 100644 lib/x_twitter_scraper/models/tweet_media.rb rename lib/x_twitter_scraper/models/{api_key_revoke_params.rb => webhook_resume_params.rb} (78%) create mode 100644 lib/x_twitter_scraper/models/webhook_resume_response.rb create mode 100644 lib/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rb create mode 100644 lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb create mode 100644 lib/x_twitter_scraper/models/x/communities/join_create_response.rb create mode 100644 lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb delete mode 100644 lib/x_twitter_scraper/models/x/community_action_result.rb create mode 100644 lib/x_twitter_scraper/models/x/user_remove_follower_params.rb create mode 100644 lib/x_twitter_scraper/models/x/user_remove_follower_response.rb create mode 100644 lib/x_twitter_scraper/models/x/user_retrieve_batch_response.rb create mode 100644 lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb create mode 100644 lib/x_twitter_scraper/models/x/write_action_retrieve_params.rb create mode 100644 lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb delete mode 100644 lib/x_twitter_scraper/resources/api_keys.rb create mode 100644 lib/x_twitter_scraper/resources/guest_wallets.rb create mode 100644 lib/x_twitter_scraper/resources/monitors/keywords.rb create mode 100644 lib/x_twitter_scraper/resources/x/account_connection_challenges.rb create mode 100644 lib/x_twitter_scraper/resources/x/write_actions.rb delete mode 100644 rbi/x_twitter_scraper/models/api_key.rbi delete mode 100644 rbi/x_twitter_scraper/models/api_key_create_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/api_key_list_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/api_key_revoke_response.rbi create mode 100644 rbi/x_twitter_scraper/models/content_disclosure.rbi create mode 100644 rbi/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbi rename rbi/x_twitter_scraper/models/{api_key_create_params.rbi => credit_retrieve_topup_status_params.rbi} (50%) create mode 100644 rbi/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbi create mode 100644 rbi/x_twitter_scraper/models/embedded_tweet.rbi create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_amount.rbi create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi rename rbi/x_twitter_scraper/models/{api_key_list_params.rbi => guest_wallet_retrieve_status_params.rbi} (81%) create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbi create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi create mode 100644 rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_create_params.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_create_response.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_list_params.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_list_response.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_update_params.rbi create mode 100644 rbi/x_twitter_scraper/models/monitors/keyword_update_response.rbi create mode 100644 rbi/x_twitter_scraper/models/tweet_media.rbi rename rbi/x_twitter_scraper/models/{api_key_revoke_params.rbi => webhook_resume_params.rbi} (86%) create mode 100644 rbi/x_twitter_scraper/models/webhook_resume_response.rbi create mode 100644 rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbi create mode 100644 rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi create mode 100644 rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi create mode 100644 rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi delete mode 100644 rbi/x_twitter_scraper/models/x/community_action_result.rbi create mode 100644 rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi create mode 100644 rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi create mode 100644 rbi/x_twitter_scraper/models/x/user_retrieve_batch_response.rbi create mode 100644 rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi create mode 100644 rbi/x_twitter_scraper/models/x/write_action_retrieve_params.rbi create mode 100644 rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi delete mode 100644 rbi/x_twitter_scraper/resources/api_keys.rbi create mode 100644 rbi/x_twitter_scraper/resources/guest_wallets.rbi create mode 100644 rbi/x_twitter_scraper/resources/monitors/keywords.rbi create mode 100644 rbi/x_twitter_scraper/resources/x/account_connection_challenges.rbi create mode 100644 rbi/x_twitter_scraper/resources/x/write_actions.rbi create mode 100644 release-please-config.json delete mode 100644 sig/x_twitter_scraper/models/api_key.rbs delete mode 100644 sig/x_twitter_scraper/models/api_key_create_response.rbs delete mode 100644 sig/x_twitter_scraper/models/api_key_list_response.rbs delete mode 100644 sig/x_twitter_scraper/models/api_key_revoke_response.rbs create mode 100644 sig/x_twitter_scraper/models/content_disclosure.rbs create mode 100644 sig/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbs rename sig/x_twitter_scraper/models/{api_key_create_params.rbs => credit_retrieve_topup_status_params.rbs} (54%) create mode 100644 sig/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbs create mode 100644 sig/x_twitter_scraper/models/embedded_tweet.rbs create mode 100644 sig/x_twitter_scraper/models/guest_wallet_amount.rbs create mode 100644 sig/x_twitter_scraper/models/guest_wallet_create_params.rbs create mode 100644 sig/x_twitter_scraper/models/guest_wallet_create_response.rbs rename sig/x_twitter_scraper/models/{api_key_list_params.rbs => guest_wallet_retrieve_status_params.rbs} (75%) create mode 100644 sig/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbs create mode 100644 sig/x_twitter_scraper/models/guest_wallet_topup_params.rbs create mode 100644 sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_create_params.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_create_response.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_list_params.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_list_response.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_update_params.rbs create mode 100644 sig/x_twitter_scraper/models/monitors/keyword_update_response.rbs create mode 100644 sig/x_twitter_scraper/models/tweet_media.rbs rename sig/x_twitter_scraper/models/{api_key_revoke_params.rbs => webhook_resume_params.rbs} (83%) create mode 100644 sig/x_twitter_scraper/models/webhook_resume_response.rbs create mode 100644 sig/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbs create mode 100644 sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs create mode 100644 sig/x_twitter_scraper/models/x/communities/join_create_response.rbs create mode 100644 sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs delete mode 100644 sig/x_twitter_scraper/models/x/community_action_result.rbs create mode 100644 sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs create mode 100644 sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs create mode 100644 sig/x_twitter_scraper/models/x/user_retrieve_batch_response.rbs create mode 100644 sig/x_twitter_scraper/models/x/user_retrieve_replies_params.rbs create mode 100644 sig/x_twitter_scraper/models/x/write_action_retrieve_params.rbs create mode 100644 sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs delete mode 100644 sig/x_twitter_scraper/resources/api_keys.rbs create mode 100644 sig/x_twitter_scraper/resources/guest_wallets.rbs create mode 100644 sig/x_twitter_scraper/resources/monitors/keywords.rbs create mode 100644 sig/x_twitter_scraper/resources/x/account_connection_challenges.rbs create mode 100644 sig/x_twitter_scraper/resources/x/write_actions.rbs delete mode 100644 test/x_twitter_scraper/resources/api_keys_test.rb create mode 100644 test/x_twitter_scraper/resources/guest_wallets_test.rb create mode 100644 test/x_twitter_scraper/resources/monitors/keywords_test.rb create mode 100644 test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb create mode 100644 test/x_twitter_scraper/resources/x/write_actions_test.rb diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 0000000..7654249 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/Xquik-dev/x-twitter-scraper-ruby/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Ruby + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + with: + bundler-cache: false + - run: |- + bundle install + + - 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/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..d4d5851 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'Xquik-dev/x-twitter-scraper-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + 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 new file mode 100644 index 0000000..da59f99 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.4.0" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 804394a..51d317a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 110 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-448f3b69552e6515e1df3a34f7f299eb6313dd904b0f3840ea4228b047aa1b6f.yml -openapi_spec_hash: 94ffa4c398ff0a22c0eab3eae6536e36 -config_hash: 0a29dafd3c416019a49430105808d7d4 +configured_endpoints: 122 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-4665e942135459ff435542ae46122294c910986fdf19a0d2d33bc301817cf36f.yml +openapi_spec_hash: 564b37a7cb3edf100a82799631e287d9 +config_hash: 7a9e1c37c84d207c5ee312091fffd2b0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11a69b8..39a1b67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g To install via git in your `Gemfile`: ```ruby -gem "x-twitter-scraper", git: "https://github.com/stainless-sdks/x-twitter-scraper-ruby" +gem "x-twitter-scraper", git: "https://github.com/Xquik-dev/x-twitter-scraper-ruby" ``` Alternatively, reference local copy of the repo: ```bash -$ git clone -- 'https://github.com/stainless-sdks/x-twitter-scraper-ruby' '' +$ git clone -- 'https://github.com/Xquik-dev/x-twitter-scraper-ruby' '' ``` ```ruby diff --git a/README.md b/README.md index 497c209..dabc76f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Xquik API library -The Xquik library provides convenient access to the X Twitter Scraper REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/stainless-sdks/x-twitter-scraper-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. +The Xquik library provides convenient access to the X Twitter Scraper REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/Xquik-dev/x-twitter-scraper-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. It is generated with [Stainless](https://www.stainless.com/). @@ -14,10 +14,14 @@ The REST API documentation can be found on [xquik.com](https://xquik.com). To use this gem, install via Bundler by adding the following to your application's `Gemfile`: + + ```ruby gem "x-twitter-scraper", "~> 0.4.0" ``` + + ## Usage ```ruby @@ -33,29 +37,6 @@ paginated_tweets = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: puts(paginated_tweets.has_next_page) ``` -### File uploads - -Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more. - -```ruby -require "pathname" - -# Use `Pathname` to send the filename and/or avoid paging a large file into memory: -response = x_twitter_scraper.x.media.upload(file: Pathname("/path/to/file")) - -# Alternatively, pass file contents or a `StringIO` directly: -response = x_twitter_scraper.x.media.upload(file: File.read("/path/to/file")) - -# Or, to control the filename and/or content type: -file = - XTwitterScraper::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…") -response = x_twitter_scraper.x.media.upload(file: file) - -puts(response.mediaId) -``` - -Note that you can also pass a raw `IO` descriptor, but this disables retries, as the library can't be sure if the descriptor is a file or pipe (which cannot be rewound). - ### Handling errors When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `XTwitterScraper::Errors::APIError` will be thrown: @@ -250,4 +231,4 @@ Ruby 3.2.0 or higher. ## Contributing -See [the contributing documentation](https://github.com/stainless-sdks/x-twitter-scraper-ruby/tree/main/CONTRIBUTING.md). +See [the contributing documentation](https://github.com/Xquik-dev/x-twitter-scraper-ruby/tree/main/CONTRIBUTING.md). diff --git a/Rakefile b/Rakefile index 9aff2ac..2383fc2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "etc" require "pathname" require "securerandom" require "shellwords" @@ -37,7 +38,11 @@ multitask(:test) do ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } end -xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] +# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per +# 300-file batch with no upper bound; on large SDKs (thousands of files) that +# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and +# slowing CI to the point of timing out. +xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --] ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")} filtered = ->(ext, dirs) do diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..c05436e --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${GEM_HOST_API_KEY}" ]; then + errors+=("The GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/lib/x_twitter_scraper.rb b/lib/x_twitter_scraper.rb index e587d1e..54e619b 100644 --- a/lib/x_twitter_scraper.rb +++ b/lib/x_twitter_scraper.rb @@ -52,23 +52,21 @@ require_relative "x_twitter_scraper/internal/transport/base_client" require_relative "x_twitter_scraper/internal/transport/pooled_net_requester" require_relative "x_twitter_scraper/client" +require_relative "x_twitter_scraper/models/user_profile" require_relative "x_twitter_scraper/models/account_retrieve_params" require_relative "x_twitter_scraper/models/account_retrieve_response" require_relative "x_twitter_scraper/models/account_set_x_username_params" require_relative "x_twitter_scraper/models/account_set_x_username_response" require_relative "x_twitter_scraper/models/account_update_locale_params" require_relative "x_twitter_scraper/models/account_update_locale_response" -require_relative "x_twitter_scraper/models/api_key" -require_relative "x_twitter_scraper/models/api_key_create_params" -require_relative "x_twitter_scraper/models/api_key_create_response" -require_relative "x_twitter_scraper/models/api_key_list_params" -require_relative "x_twitter_scraper/models/api_key_list_response" -require_relative "x_twitter_scraper/models/api_key_revoke_params" -require_relative "x_twitter_scraper/models/api_key_revoke_response" require_relative "x_twitter_scraper/models/compose_create_params" require_relative "x_twitter_scraper/models/compose_create_response" +require_relative "x_twitter_scraper/models/content_disclosure" +require_relative "x_twitter_scraper/models/credit_redirect_topup_checkout_params" require_relative "x_twitter_scraper/models/credit_retrieve_balance_params" require_relative "x_twitter_scraper/models/credit_retrieve_balance_response" +require_relative "x_twitter_scraper/models/credit_retrieve_topup_status_params" +require_relative "x_twitter_scraper/models/credit_retrieve_topup_status_response" require_relative "x_twitter_scraper/models/credit_topup_balance_params" require_relative "x_twitter_scraper/models/credit_topup_balance_response" require_relative "x_twitter_scraper/models/delivery" @@ -88,6 +86,7 @@ require_relative "x_twitter_scraper/models/draw_retrieve_response" require_relative "x_twitter_scraper/models/draw_run_params" require_relative "x_twitter_scraper/models/draw_run_response" +require_relative "x_twitter_scraper/models/embedded_tweet" require_relative "x_twitter_scraper/models/error" require_relative "x_twitter_scraper/models/event" require_relative "x_twitter_scraper/models/event_detail" @@ -105,6 +104,13 @@ require_relative "x_twitter_scraper/models/extraction_retrieve_response" require_relative "x_twitter_scraper/models/extraction_run_params" require_relative "x_twitter_scraper/models/extraction_run_response" +require_relative "x_twitter_scraper/models/guest_wallet_amount" +require_relative "x_twitter_scraper/models/guest_wallet_create_params" +require_relative "x_twitter_scraper/models/guest_wallet_create_response" +require_relative "x_twitter_scraper/models/guest_wallet_retrieve_status_params" +require_relative "x_twitter_scraper/models/guest_wallet_retrieve_status_response" +require_relative "x_twitter_scraper/models/guest_wallet_topup_params" +require_relative "x_twitter_scraper/models/guest_wallet_topup_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" @@ -113,6 +119,16 @@ 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/monitors/keyword_create_params" +require_relative "x_twitter_scraper/models/monitors/keyword_create_response" +require_relative "x_twitter_scraper/models/monitors/keyword_deactivate_params" +require_relative "x_twitter_scraper/models/monitors/keyword_deactivate_response" +require_relative "x_twitter_scraper/models/monitors/keyword_list_params" +require_relative "x_twitter_scraper/models/monitors/keyword_list_response" +require_relative "x_twitter_scraper/models/monitors/keyword_retrieve_params" +require_relative "x_twitter_scraper/models/monitors/keyword_retrieve_response" +require_relative "x_twitter_scraper/models/monitors/keyword_update_params" +require_relative "x_twitter_scraper/models/monitors/keyword_update_response" require_relative "x_twitter_scraper/models/monitor_update_params" require_relative "x_twitter_scraper/models/paginated_tweets" require_relative "x_twitter_scraper/models/paginated_users" @@ -146,7 +162,7 @@ require_relative "x_twitter_scraper/models/support/ticket_update_response" require_relative "x_twitter_scraper/models/trend_list_params" require_relative "x_twitter_scraper/models/trend_list_response" -require_relative "x_twitter_scraper/models/user_profile" +require_relative "x_twitter_scraper/models/tweet_media" require_relative "x_twitter_scraper/models/webhook" require_relative "x_twitter_scraper/models/webhook_create_params" require_relative "x_twitter_scraper/models/webhook_create_response" @@ -156,12 +172,16 @@ require_relative "x_twitter_scraper/models/webhook_list_deliveries_response" require_relative "x_twitter_scraper/models/webhook_list_params" require_relative "x_twitter_scraper/models/webhook_list_response" +require_relative "x_twitter_scraper/models/webhook_resume_params" +require_relative "x_twitter_scraper/models/webhook_resume_response" 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/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_connection_challenge_submit_params" +require_relative "x_twitter_scraper/models/x/account_connection_challenge_submit_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" @@ -175,10 +195,11 @@ 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" require_relative "x_twitter_scraper/models/x/community_create_response" require_relative "x_twitter_scraper/models/x/community_delete_params" @@ -230,7 +251,10 @@ 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/user_remove_follower_params" +require_relative "x_twitter_scraper/models/x/user_remove_follower_response" require_relative "x_twitter_scraper/models/x/user_retrieve_batch_params" +require_relative "x_twitter_scraper/models/x/user_retrieve_batch_response" 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_following_params" @@ -238,6 +262,7 @@ require_relative "x_twitter_scraper/models/x/user_retrieve_media_params" 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_replies_params" 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_verified_followers_params" @@ -245,6 +270,8 @@ require_relative "x_twitter_scraper/models/x/users/follow_create_response" require_relative "x_twitter_scraper/models/x/users/follow_delete_all_params" require_relative "x_twitter_scraper/models/x/users/follow_delete_all_response" +require_relative "x_twitter_scraper/models/x/write_action_retrieve_params" +require_relative "x_twitter_scraper/models/x/write_action_retrieve_response" require_relative "x_twitter_scraper/models/x/x_account" require_relative "x_twitter_scraper/models/x/x_account_detail" require_relative "x_twitter_scraper/models/x_get_article_params" @@ -256,14 +283,15 @@ 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" require_relative "x_twitter_scraper/resources/compose" require_relative "x_twitter_scraper/resources/credits" require_relative "x_twitter_scraper/resources/drafts" require_relative "x_twitter_scraper/resources/draws" require_relative "x_twitter_scraper/resources/events" require_relative "x_twitter_scraper/resources/extractions" +require_relative "x_twitter_scraper/resources/guest_wallets" require_relative "x_twitter_scraper/resources/monitors" +require_relative "x_twitter_scraper/resources/monitors/keywords" require_relative "x_twitter_scraper/resources/radar" require_relative "x_twitter_scraper/resources/styles" require_relative "x_twitter_scraper/resources/subscribe" @@ -272,6 +300,7 @@ require_relative "x_twitter_scraper/resources/trends" require_relative "x_twitter_scraper/resources/webhooks" require_relative "x_twitter_scraper/resources/x" +require_relative "x_twitter_scraper/resources/x/account_connection_challenges" require_relative "x_twitter_scraper/resources/x/accounts" require_relative "x_twitter_scraper/resources/x/bookmarks" require_relative "x_twitter_scraper/resources/x/communities" @@ -287,3 +316,4 @@ require_relative "x_twitter_scraper/resources/x/tweets/retweet" require_relative "x_twitter_scraper/resources/x/users" require_relative "x_twitter_scraper/resources/x/users/follow" +require_relative "x_twitter_scraper/resources/x/write_actions" diff --git a/lib/x_twitter_scraper/client.rb b/lib/x_twitter_scraper/client.rb index 78b9025..c307810 100644 --- a/lib/x_twitter_scraper/client.rb +++ b/lib/x_twitter_scraper/client.rb @@ -26,10 +26,6 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [XTwitterScraper::Resources::Account] attr_reader :account - # API key management (session auth only) - # @return [XTwitterScraper::Resources::APIKeys] - attr_reader :api_keys - # Subscription, billing, and credits # @return [XTwitterScraper::Resources::Subscribe] attr_reader :subscribe @@ -58,7 +54,7 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [XTwitterScraper::Resources::Events] attr_reader :events - # Bulk data extraction (20 tool types) + # Bulk data extraction (23 tool types) # @return [XTwitterScraper::Resources::Extractions] attr_reader :extractions @@ -84,11 +80,17 @@ class Client < XTwitterScraper::Internal::Transport::BaseClient # @return [XTwitterScraper::Resources::Credits] attr_reader :credits + # Accountless prepaid access for paid read endpoints + # @return [XTwitterScraper::Resources::GuestWallets] + attr_reader :guest_wallets + # @api private # + # @param security [Hash{Symbol=>Boolean}] + # # @return [Hash{String=>String}] - private def auth_headers - {**auth_api_key, **oauth_bearer} + private def auth_headers(security:) + {auth_api_key:, oauth_bearer:}.slice(*security.keys).values.reduce({}, :merge) end # @api private @@ -160,7 +162,6 @@ def initialize( ) @account = XTwitterScraper::Resources::Account.new(client: self) - @api_keys = XTwitterScraper::Resources::APIKeys.new(client: self) @subscribe = XTwitterScraper::Resources::Subscribe.new(client: self) @compose = XTwitterScraper::Resources::Compose.new(client: self) @drafts = XTwitterScraper::Resources::Drafts.new(client: self) @@ -175,6 +176,7 @@ def initialize( @trends = XTwitterScraper::Resources::Trends.new(client: self) @support = XTwitterScraper::Resources::Support.new(client: self) @credits = XTwitterScraper::Resources::Credits.new(client: self) + @guest_wallets = XTwitterScraper::Resources::GuestWallets.new(client: self) end end end diff --git a/lib/x_twitter_scraper/internal/transport/base_client.rb b/lib/x_twitter_scraper/internal/transport/base_client.rb index 5575ca6..0c2c2d2 100644 --- a/lib/x_twitter_scraper/internal/transport/base_client.rb +++ b/lib/x_twitter_scraper/internal/transport/base_client.rb @@ -31,7 +31,19 @@ class << self # # @raise [ArgumentError] def validate!(req) - keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] + keys = [ + :method, + :path, + :query, + :headers, + :body, + :unwrap, + :page, + :stream, + :model, + :security, + :options + ] case req in Hash req.each_key do |k| @@ -252,6 +264,8 @@ def initialize( # # @option req [XTwitterScraper::Internal::Type::Converter, Class, nil] :model # + # @option req [Hash{Symbol=>Boolean}, nil] :security + # # @param opts [Hash{Symbol=>Object}] . # # @option opts [String, nil] :idempotency_key @@ -276,7 +290,11 @@ def initialize( headers = XTwitterScraper::Internal::Util.normalized_headers( @headers, - auth_headers, + auth_headers( + security: req.fetch( + :security, {auth_api_key: true, oauth_bearer: true} + ) + ), req[:headers].to_h, opts[:extra_headers].to_h ) @@ -306,7 +324,10 @@ def initialize( XTwitterScraper::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end - headers.delete("content-type") if body.nil? + # Generated methods always pass `req[:body]` for operations that define a + # request body, so only elide the content-type header when the operation + # has no body at all, not when an optional body param was omitted. + headers.delete("content-type") if body.nil? && !req.key?(:body) url = XTwitterScraper::Internal::Util.join_parsed_uri( @base_url_components, @@ -445,7 +466,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # Execute the request specified by `req`. This is the method that all resource # methods call into. # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, options: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, security: {auth_api_key: true, oauth_bearer: true}, options: {}) # # @param method [Symbol] # @@ -465,6 +486,8 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) # # @param model [XTwitterScraper::Internal::Type::Converter, Class, nil] # + # @param security [Hash{Symbol=>Boolean}, nil] + # # @param options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] . # # @option options [String, nil] :idempotency_key @@ -557,6 +580,7 @@ def inspect page: T.nilable(T::Class[XTwitterScraper::Internal::Type::BasePage[XTwitterScraper::Internal::Type::BaseModel]]), stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), + security: T.nilable({auth_api_key: T::Boolean, oauth_bearer: T::Boolean}), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) } end diff --git a/lib/x_twitter_scraper/internal/type/base_model.rb b/lib/x_twitter_scraper/internal/type/base_model.rb index 56eeb77..9cdbcd2 100644 --- a/lib/x_twitter_scraper/internal/type/base_model.rb +++ b/lib/x_twitter_scraper/internal/type/base_model.rb @@ -443,9 +443,10 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false) # @return [Hash{Symbol=>Object}] # # @example - # # `error` is a `XTwitterScraper::Error` - # error => { - # error: error + # # `content_disclosure` is a `XTwitterScraper::ContentDisclosure` + # content_disclosure => { + # advertising: advertising, + # ai_generated: ai_generated # } def deconstruct_keys(keys) (keys || self.class.known_fields.keys) diff --git a/lib/x_twitter_scraper/models.rb b/lib/x_twitter_scraper/models.rb index 900e376..1db575f 100644 --- a/lib/x_twitter_scraper/models.rb +++ b/lib/x_twitter_scraper/models.rb @@ -48,18 +48,16 @@ module XTwitterScraper AccountUpdateLocaleParams = XTwitterScraper::Models::AccountUpdateLocaleParams - APIKey = XTwitterScraper::Models::APIKey - - APIKeyCreateParams = XTwitterScraper::Models::APIKeyCreateParams - - APIKeyListParams = XTwitterScraper::Models::APIKeyListParams + ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams - APIKeyRevokeParams = XTwitterScraper::Models::APIKeyRevokeParams + ContentDisclosure = XTwitterScraper::Models::ContentDisclosure - ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams + CreditRedirectTopupCheckoutParams = XTwitterScraper::Models::CreditRedirectTopupCheckoutParams CreditRetrieveBalanceParams = XTwitterScraper::Models::CreditRetrieveBalanceParams + CreditRetrieveTopupStatusParams = XTwitterScraper::Models::CreditRetrieveTopupStatusParams + CreditTopupBalanceParams = XTwitterScraper::Models::CreditTopupBalanceParams Delivery = XTwitterScraper::Models::Delivery @@ -88,6 +86,8 @@ module XTwitterScraper DrawRunParams = XTwitterScraper::Models::DrawRunParams + EmbeddedTweet = XTwitterScraper::Models::EmbeddedTweet + Error = XTwitterScraper::Models::Error Event = XTwitterScraper::Models::Event @@ -112,6 +112,14 @@ module XTwitterScraper ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams + GuestWalletAmount = XTwitterScraper::Models::GuestWalletAmount + + GuestWalletCreateParams = XTwitterScraper::Models::GuestWalletCreateParams + + GuestWalletRetrieveStatusParams = XTwitterScraper::Models::GuestWalletRetrieveStatusParams + + GuestWalletTopupParams = XTwitterScraper::Models::GuestWalletTopupParams + Monitor = XTwitterScraper::Models::Monitor MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -122,6 +130,8 @@ module XTwitterScraper MonitorRetrieveParams = XTwitterScraper::Models::MonitorRetrieveParams + Monitors = XTwitterScraper::Models::Monitors + MonitorUpdateParams = XTwitterScraper::Models::MonitorUpdateParams PaginatedTweets = XTwitterScraper::Models::PaginatedTweets @@ -158,6 +168,8 @@ module XTwitterScraper TrendListParams = XTwitterScraper::Models::TrendListParams + TweetMedia = XTwitterScraper::Models::TweetMedia + UserProfile = XTwitterScraper::Models::UserProfile Webhook = XTwitterScraper::Models::Webhook @@ -170,6 +182,8 @@ module XTwitterScraper WebhookListParams = XTwitterScraper::Models::WebhookListParams + WebhookResumeParams = XTwitterScraper::Models::WebhookResumeParams + WebhookTestParams = XTwitterScraper::Models::WebhookTestParams WebhookUpdateParams = XTwitterScraper::Models::WebhookUpdateParams diff --git a/lib/x_twitter_scraper/models/account_retrieve_response.rb b/lib/x_twitter_scraper/models/account_retrieve_response.rb index 95f4fe5..3e20f7c 100644 --- a/lib/x_twitter_scraper/models/account_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/account_retrieve_response.rb @@ -4,7 +4,18 @@ module XTwitterScraper module Models # @see XTwitterScraper::Resources::Account#retrieve class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute monitor_billing + # + # @return [XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling] + required :monitor_billing, + -> { XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling }, + api_name: :monitorBilling + # @!attribute monitors_allowed + # @deprecated Monitor slots are unlimited. Use monitorBilling.unlimitedSlots instead. + # + # Deprecated. Monitor slots are unlimited, so this is always + # Number.MAX_SAFE_INTEGER. # # @return [Integer] required :monitors_allowed, Integer, api_name: :monitorsAllowed @@ -32,8 +43,13 @@ class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :x_username, String, api_name: :xUsername - # @!method initialize(monitors_allowed:, monitors_used:, plan:, credit_info: nil, x_username: nil) - # @param monitors_allowed [Integer] + # @!method initialize(monitor_billing:, monitors_allowed:, monitors_used:, plan:, credit_info: nil, x_username: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::AccountRetrieveResponse} for more details. + # + # @param monitor_billing [XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling] + # + # @param monitors_allowed [Integer] Deprecated. Monitor slots are unlimited, so this is always Number.MAX_SAFE_INTEG # # @param monitors_used [Integer] # @@ -43,6 +59,66 @@ class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # # @param x_username [String] Linked X username, omitted when no X account is connected. + # @see XTwitterScraper::Models::AccountRetrieveResponse#monitor_billing + class MonitorBilling < XTwitterScraper::Internal::Type::BaseModel + # @!attribute active_daily_estimate + # Estimated daily credits for currently active monitors. + # + # @return [String] + required :active_daily_estimate, String, api_name: :activeDailyEstimate + + # @!attribute active_hourly_burn + # Credits charged each hour for currently active monitors. + # + # @return [String] + required :active_hourly_burn, String, api_name: :activeHourlyBurn + + # @!attribute credits_per_active_monitor_day + # Estimated daily credits for 1 active instant monitor. + # + # @return [String] + required :credits_per_active_monitor_day, String, api_name: :creditsPerActiveMonitorDay + + # @!attribute credits_per_active_monitor_hour + # Hourly credits charged for 1 active instant monitor. + # + # @return [String] + required :credits_per_active_monitor_hour, String, api_name: :creditsPerActiveMonitorHour + + # @!attribute events_included + # Webhook and event deliveries are included in monitor billing. + # + # @return [Boolean] + required :events_included, XTwitterScraper::Internal::Type::Boolean, api_name: :eventsIncluded + + # @!attribute instant_check_interval_seconds + # Active monitors check every 1 second. + # + # @return [Integer] + required :instant_check_interval_seconds, Integer, api_name: :instantCheckIntervalSeconds + + # @!attribute unlimited_slots + # Monitor slot count is unlimited. + # + # @return [Boolean] + required :unlimited_slots, XTwitterScraper::Internal::Type::Boolean, api_name: :unlimitedSlots + + # @!method initialize(active_daily_estimate:, active_hourly_burn:, credits_per_active_monitor_day:, credits_per_active_monitor_hour:, events_included:, instant_check_interval_seconds:, unlimited_slots:) + # @param active_daily_estimate [String] Estimated daily credits for currently active monitors. + # + # @param active_hourly_burn [String] Credits charged each hour for currently active monitors. + # + # @param credits_per_active_monitor_day [String] Estimated daily credits for 1 active instant monitor. + # + # @param credits_per_active_monitor_hour [String] Hourly credits charged for 1 active instant monitor. + # + # @param events_included [Boolean] Webhook and event deliveries are included in monitor billing. + # + # @param instant_check_interval_seconds [Integer] Active monitors check every 1 second. + # + # @param unlimited_slots [Boolean] Monitor slot count is unlimited. + end + # @see XTwitterScraper::Models::AccountRetrieveResponse#plan module Plan extend XTwitterScraper::Internal::Type::Enum @@ -56,31 +132,53 @@ module Plan # @see XTwitterScraper::Models::AccountRetrieveResponse#credit_info class CreditInfo < XTwitterScraper::Internal::Type::BaseModel + # @!attribute auto_topup_amount_dollars + # Dollar amount charged when automatic top-up runs. + # + # @return [Float] + required :auto_topup_amount_dollars, Float, api_name: :autoTopupAmountDollars + # @!attribute auto_topup_enabled # # @return [Boolean] required :auto_topup_enabled, XTwitterScraper::Internal::Type::Boolean, api_name: :autoTopupEnabled + # @!attribute auto_topup_threshold + # Bigint string threshold that triggers automatic top-up when enabled. + # + # @return [String] + required :auto_topup_threshold, String, api_name: :autoTopupThreshold + # @!attribute balance + # Bigint string to preserve precision above Number.MAX_SAFE_INTEGER. # - # @return [Integer] - required :balance, Integer + # @return [String] + required :balance, String # @!attribute lifetime_purchased + # Total purchased credits as a bigint string. # - # @return [Integer] - required :lifetime_purchased, Integer, api_name: :lifetimePurchased + # @return [String] + required :lifetime_purchased, String, api_name: :lifetimePurchased # @!attribute lifetime_used + # Total consumed credits as a bigint string. # - # @return [Integer] - required :lifetime_used, Integer, api_name: :lifetimeUsed + # @return [String] + required :lifetime_used, String, api_name: :lifetimeUsed - # @!method initialize(auto_topup_enabled:, balance:, lifetime_purchased:, lifetime_used:) + # @!method initialize(auto_topup_amount_dollars:, auto_topup_enabled:, auto_topup_threshold:, balance:, lifetime_purchased:, lifetime_used:) + # @param auto_topup_amount_dollars [Float] Dollar amount charged when automatic top-up runs. + # # @param auto_topup_enabled [Boolean] - # @param balance [Integer] - # @param lifetime_purchased [Integer] - # @param lifetime_used [Integer] + # + # @param auto_topup_threshold [String] Bigint string threshold that triggers automatic top-up when enabled. + # + # @param balance [String] Bigint string to preserve precision above Number.MAX_SAFE_INTEGER. + # + # @param lifetime_purchased [String] Total purchased credits as a bigint string. + # + # @param lifetime_used [String] Total consumed credits as a bigint string. end end end diff --git a/lib/x_twitter_scraper/models/api_key.rb b/lib/x_twitter_scraper/models/api_key.rb deleted file mode 100644 index 6334482..0000000 --- a/lib/x_twitter_scraper/models/api_key.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - class APIKey < 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) - # API key metadata returned when listing keys. - # - # @param id [String] - # @param created_at [Time] - # @param is_active [Boolean] - # @param name [String] - # @param prefix [String] - # @param last_used_at [Time] - end - end -end diff --git a/lib/x_twitter_scraper/models/api_key_create_params.rb b/lib/x_twitter_scraper/models/api_key_create_params.rb deleted file mode 100644 index f3c82cf..0000000 --- a/lib/x_twitter_scraper/models/api_key_create_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::APIKeys#create - class APIKeyCreateParams < XTwitterScraper::Internal::Type::BaseModel - extend XTwitterScraper::Internal::Type::RequestParameters::Converter - include XTwitterScraper::Internal::Type::RequestParameters - - # @!attribute name - # - # @return [String, nil] - optional :name, String - - # @!method initialize(name: nil, request_options: {}) - # @param name [String] - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/x_twitter_scraper/models/api_key_create_response.rb b/lib/x_twitter_scraper/models/api_key_create_response.rb deleted file mode 100644 index 2b20951..0000000 --- a/lib/x_twitter_scraper/models/api_key_create_response.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::APIKeys#create - class APIKeyCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute created_at - # - # @return [Time] - required :created_at, Time, api_name: :createdAt - - # @!attribute full_key - # - # @return [String] - required :full_key, String, api_name: :fullKey - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute prefix - # - # @return [String] - required :prefix, String - - # @!method initialize(id:, created_at:, full_key:, name:, prefix:) - # @param id [String] - # @param created_at [Time] - # @param full_key [String] - # @param name [String] - # @param prefix [String] - end - end -end diff --git a/lib/x_twitter_scraper/models/api_key_list_response.rb b/lib/x_twitter_scraper/models/api_key_list_response.rb deleted file mode 100644 index 9c3a710..0000000 --- a/lib/x_twitter_scraper/models/api_key_list_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::APIKeys#list - class APIKeyListResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute keys - # - # @return [Array] - required :keys, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::APIKey] } - - # @!method initialize(keys:) - # @param keys [Array] - end - end -end diff --git a/lib/x_twitter_scraper/models/api_key_revoke_response.rb b/lib/x_twitter_scraper/models/api_key_revoke_response.rb deleted file mode 100644 index 2786c05..0000000 --- a/lib/x_twitter_scraper/models/api_key_revoke_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - # @see XTwitterScraper::Resources::APIKeys#revoke - class APIKeyRevokeResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute success - # - # @return [Boolean, true] - required :success, const: true - - # @!method initialize(success: true) - # @param success [Boolean, true] - end - end -end diff --git a/lib/x_twitter_scraper/models/content_disclosure.rb b/lib/x_twitter_scraper/models/content_disclosure.rb new file mode 100644 index 0000000..45daf75 --- /dev/null +++ b/lib/x_twitter_scraper/models/content_disclosure.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class ContentDisclosure < XTwitterScraper::Internal::Type::BaseModel + # @!attribute advertising + # + # @return [XTwitterScraper::Models::ContentDisclosure::Advertising, nil] + optional :advertising, -> { XTwitterScraper::ContentDisclosure::Advertising } + + # @!attribute ai_generated + # + # @return [XTwitterScraper::Models::ContentDisclosure::AIGenerated, nil] + optional :ai_generated, -> { XTwitterScraper::ContentDisclosure::AIGenerated }, api_name: :aiGenerated + + # @!method initialize(advertising: nil, ai_generated: nil) + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + # + # @param advertising [XTwitterScraper::Models::ContentDisclosure::Advertising] + # @param ai_generated [XTwitterScraper::Models::ContentDisclosure::AIGenerated] + + # @see XTwitterScraper::Models::ContentDisclosure#advertising + class Advertising < XTwitterScraper::Internal::Type::BaseModel + # @!attribute is_paid_promotion + # True when X labels the tweet as paid promotion content. + # + # @return [Boolean, nil] + optional :is_paid_promotion, XTwitterScraper::Internal::Type::Boolean, api_name: :isPaidPromotion + + # @!method initialize(is_paid_promotion: nil) + # @param is_paid_promotion [Boolean] True when X labels the tweet as paid promotion content. + end + + # @see XTwitterScraper::Models::ContentDisclosure#ai_generated + class AIGenerated < XTwitterScraper::Internal::Type::BaseModel + # @!attribute can_edit + # Whether the disclosure can be edited on X. + # + # @return [Boolean, nil] + optional :can_edit, XTwitterScraper::Internal::Type::Boolean, api_name: :canEdit + + # @!attribute detection_source + # Source of the AI-generated media disclosure. + # + # @return [String, nil] + optional :detection_source, String, api_name: :detectionSource + + # @!attribute has_ai_generated_media + # True when X labels the tweet as containing AI-generated media. + # + # @return [Boolean, nil] + optional :has_ai_generated_media, + XTwitterScraper::Internal::Type::Boolean, + api_name: :hasAiGeneratedMedia + + # @!method initialize(can_edit: nil, detection_source: nil, has_ai_generated_media: nil) + # @param can_edit [Boolean] Whether the disclosure can be edited on X. + # + # @param detection_source [String] Source of the AI-generated media disclosure. + # + # @param has_ai_generated_media [Boolean] True when X labels the tweet as containing AI-generated media. + end + end + end +end diff --git a/lib/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rb b/lib/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rb new file mode 100644 index 0000000..a2d9c10 --- /dev/null +++ b/lib/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::Credits#redirect_topup_checkout + class CreditRedirectTopupCheckoutParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute session_id + # Billing session ID returned by the top-up billing flow. + # + # @return [String] + required :session_id, String + + # @!method initialize(session_id:, request_options: {}) + # @param session_id [String] Billing session ID returned by the top-up billing flow. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/x_twitter_scraper/models/credit_retrieve_balance_response.rb b/lib/x_twitter_scraper/models/credit_retrieve_balance_response.rb index fb2dbca..10a96f4 100644 --- a/lib/x_twitter_scraper/models/credit_retrieve_balance_response.rb +++ b/lib/x_twitter_scraper/models/credit_retrieve_balance_response.rb @@ -4,31 +4,58 @@ module XTwitterScraper module Models # @see XTwitterScraper::Resources::Credits#retrieve_balance class CreditRetrieveBalanceResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute auto_topup_amount_dollars + # Configured dollar amount for each automatic top-up. + # + # @return [Float] + required :auto_topup_amount_dollars, Float + # @!attribute auto_topup_enabled # # @return [Boolean] required :auto_topup_enabled, XTwitterScraper::Internal::Type::Boolean + # @!attribute auto_topup_threshold + # Credit balance threshold that triggers automatic top-up when enabled, + # represented as a bigint string. + # + # @return [String] + required :auto_topup_threshold, String + # @!attribute balance + # Current credit balance as a bigint string to preserve precision above + # Number.MAX_SAFE_INTEGER. # - # @return [Integer] - required :balance, Integer + # @return [String] + required :balance, String # @!attribute lifetime_purchased + # Lifetime purchased credits as a bigint string. # - # @return [Integer] - required :lifetime_purchased, Integer + # @return [String] + required :lifetime_purchased, String # @!attribute lifetime_used + # Lifetime consumed credits as a bigint string. # - # @return [Integer] - required :lifetime_used, Integer + # @return [String] + required :lifetime_used, String - # @!method initialize(auto_topup_enabled:, balance:, lifetime_purchased:, lifetime_used:) + # @!method initialize(auto_topup_amount_dollars:, auto_topup_enabled:, auto_topup_threshold:, balance:, lifetime_purchased:, lifetime_used:) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::CreditRetrieveBalanceResponse} for more details. + # + # @param auto_topup_amount_dollars [Float] Configured dollar amount for each automatic top-up. + # # @param auto_topup_enabled [Boolean] - # @param balance [Integer] - # @param lifetime_purchased [Integer] - # @param lifetime_used [Integer] + # + # @param auto_topup_threshold [String] Credit balance threshold that triggers automatic top-up when enabled, represente + # + # @param balance [String] Current credit balance as a bigint string to preserve precision above Number.MAX + # + # @param lifetime_purchased [String] Lifetime purchased credits as a bigint string. + # + # @param lifetime_used [String] Lifetime consumed credits as a bigint string. end end end diff --git a/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb new file mode 100644 index 0000000..455db92 --- /dev/null +++ b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::Credits#retrieve_topup_status + class CreditRetrieveTopupStatusParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute session_id + # Billing session ID returned by the top-up billing flow. + # + # @return [String] + required :session_id, String + + # @!method initialize(session_id:, request_options: {}) + # @param session_id [String] Billing session ID returned by the top-up billing flow. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/x_twitter_scraper/models/credit_retrieve_topup_status_response.rb b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_response.rb new file mode 100644 index 0000000..fa69b88 --- /dev/null +++ b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::Credits#retrieve_topup_status + class CreditRetrieveTopupStatusResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status } + + # @!attribute amount_dollars + # Dollar amount requested for the top-up. + # + # @return [Integer, nil] + optional :amount_dollars, Integer, nil?: true + + # @!attribute credits + # Bigint string credit amount granted or pending. + # + # @return [String, nil] + optional :credits, String + + # @!method initialize(status:, amount_dollars: nil, credits: nil) + # @param status [Symbol, XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status] + # + # @param amount_dollars [Integer, nil] Dollar amount requested for the top-up. + # + # @param credits [String] Bigint string credit amount granted or pending. + + # @see XTwitterScraper::Models::CreditRetrieveTopupStatusResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + PAID = :paid + PROCESSING = :processing + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/credit_topup_balance_params.rb b/lib/x_twitter_scraper/models/credit_topup_balance_params.rb index 5b610a9..c389d4d 100644 --- a/lib/x_twitter_scraper/models/credit_topup_balance_params.rb +++ b/lib/x_twitter_scraper/models/credit_topup_balance_params.rb @@ -7,14 +7,22 @@ class CreditTopupBalanceParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute amount - # Amount to top up in credits + # @!attribute dollars + # Amount to top up in US dollars. Minimum 10. # # @return [Integer] - required :amount, Integer + required :dollars, Integer - # @!method initialize(amount:, request_options: {}) - # @param amount [Integer] Amount to top up in credits + # @!attribute locale + # Optional checkout locale. Defaults to en. + # + # @return [String, nil] + optional :locale, String + + # @!method initialize(dollars:, locale: nil, request_options: {}) + # @param dollars [Integer] Amount to top up in US dollars. Minimum 10. + # + # @param locale [String] Optional checkout locale. Defaults to en. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/credit_topup_balance_response.rb b/lib/x_twitter_scraper/models/credit_topup_balance_response.rb index 427608b..01441f5 100644 --- a/lib/x_twitter_scraper/models/credit_topup_balance_response.rb +++ b/lib/x_twitter_scraper/models/credit_topup_balance_response.rb @@ -4,13 +4,26 @@ module XTwitterScraper module Models # @see XTwitterScraper::Resources::Credits#topup_balance class CreditTopupBalanceResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute success + # @!attribute redirect_url + # Stable first-party Xquik redirect URL for the active Stripe Checkout session. # - # @return [Boolean, true] - required :success, const: true + # @return [String] + required :redirect_url, String - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!attribute url + # Same stable first-party Xquik redirect URL as redirect_url. The response never + # exposes a raw Stripe Checkout URL. + # + # @return [String] + required :url, String + + # @!method initialize(redirect_url:, url:) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::CreditTopupBalanceResponse} for more details. + # + # @param redirect_url [String] Stable first-party Xquik redirect URL for the active Stripe Checkout session. + # + # @param url [String] Same stable first-party Xquik redirect URL as redirect_url. The response never e end end end diff --git a/lib/x_twitter_scraper/models/draft_list_params.rb b/lib/x_twitter_scraper/models/draft_list_params.rb index 2dfbeb3..da11e9c 100644 --- a/lib/x_twitter_scraper/models/draft_list_params.rb +++ b/lib/x_twitter_scraper/models/draft_list_params.rb @@ -14,15 +14,21 @@ class DraftListParams < XTwitterScraper::Internal::Type::BaseModel optional :after_cursor, String # @!attribute limit - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. # # @return [Integer, nil] optional :limit, Integer # @!method initialize(after_cursor: nil, limit: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::DraftListParams} for more details. + # # @param after_cursor [String] Cursor for pagination # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/draw_detail.rb b/lib/x_twitter_scraper/models/draw_detail.rb index bbadc13..499445c 100644 --- a/lib/x_twitter_scraper/models/draw_detail.rb +++ b/lib/x_twitter_scraper/models/draw_detail.rb @@ -4,6 +4,7 @@ module XTwitterScraper module Models class DrawDetail < XTwitterScraper::Internal::Type::BaseModel # @!attribute id + # Draw public ID. # # @return [String] required :id, String @@ -76,19 +77,32 @@ class DrawDetail < XTwitterScraper::Internal::Type::BaseModel # @!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 id [String] Draw public ID. + # # @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 end diff --git a/lib/x_twitter_scraper/models/draw_export_params.rb b/lib/x_twitter_scraper/models/draw_export_params.rb index b5e8200..2473c3e 100644 --- a/lib/x_twitter_scraper/models/draw_export_params.rb +++ b/lib/x_twitter_scraper/models/draw_export_params.rb @@ -15,8 +15,8 @@ class DrawExportParams < XTwitterScraper::Internal::Type::BaseModel # @!attribute format_ # Export output format # - # @return [Symbol, XTwitterScraper::Models::DrawExportParams::Format, nil] - optional :format_, enum: -> { XTwitterScraper::DrawExportParams::Format } + # @return [Symbol, XTwitterScraper::Models::DrawExportParams::Format] + required :format_, enum: -> { XTwitterScraper::DrawExportParams::Format } # @!attribute type # Export winners or all entries @@ -24,7 +24,7 @@ class DrawExportParams < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::DrawExportParams::Type, nil] optional :type, enum: -> { XTwitterScraper::DrawExportParams::Type } - # @!method initialize(id:, format_: nil, type: nil, request_options: {}) + # @!method initialize(id:, format_:, type: nil, request_options: {}) # @param id [String] # # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] Export output format diff --git a/lib/x_twitter_scraper/models/draw_list_item.rb b/lib/x_twitter_scraper/models/draw_list_item.rb index a33f06d..2a7cdca 100644 --- a/lib/x_twitter_scraper/models/draw_list_item.rb +++ b/lib/x_twitter_scraper/models/draw_list_item.rb @@ -4,6 +4,7 @@ module XTwitterScraper module Models class DrawListItem < XTwitterScraper::Internal::Type::BaseModel # @!attribute id + # Draw public ID for detail responses. # # @return [String] required :id, String @@ -41,12 +42,18 @@ class DrawListItem < XTwitterScraper::Internal::Type::BaseModel # @!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 id [String] Draw public ID for detail responses. + # # @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 diff --git a/lib/x_twitter_scraper/models/draw_list_params.rb b/lib/x_twitter_scraper/models/draw_list_params.rb index 41cf8af..c6535b7 100644 --- a/lib/x_twitter_scraper/models/draw_list_params.rb +++ b/lib/x_twitter_scraper/models/draw_list_params.rb @@ -7,22 +7,28 @@ class DrawListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute after - # Cursor for keyset pagination + # @!attribute cursor + # Cursor for keyset pagination from prior response next_cursor # # @return [String, nil] - optional :after, String + optional :cursor, String # @!attribute limit - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. # # @return [Integer, nil] optional :limit, Integer - # @!method initialize(after: nil, limit: nil, request_options: {}) - # @param after [String] Cursor for keyset pagination + # @!method initialize(cursor: nil, limit: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::DrawListParams} for more details. # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor + # + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/draw_run_response.rb b/lib/x_twitter_scraper/models/draw_run_response.rb index 5935b2e..4fcc1b3 100644 --- a/lib/x_twitter_scraper/models/draw_run_response.rb +++ b/lib/x_twitter_scraper/models/draw_run_response.rb @@ -10,6 +10,8 @@ class DrawRunResponse < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute total_entries + # Candidate entries inspected for this draw after the credit-derived cap. This may + # be lower than the source tweet's full reply count. # # @return [Integer] required :total_entries, Integer, api_name: :totalEntries @@ -20,6 +22,8 @@ class DrawRunResponse < XTwitterScraper::Internal::Type::BaseModel required :tweet_id, String, api_name: :tweetId # @!attribute valid_entries + # Entries from the inspected candidate set that passed all filters. This is not + # necessarily every valid reply on the source tweet when credits cap inspection. # # @return [Integer] required :valid_entries, Integer, api_name: :validEntries @@ -30,10 +34,17 @@ class DrawRunResponse < XTwitterScraper::Internal::Type::BaseModel required :winners, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Winner] } # @!method initialize(id:, total_entries:, tweet_id:, valid_entries:, winners:) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::DrawRunResponse} for more details. + # # @param id [String] - # @param total_entries [Integer] + # + # @param total_entries [Integer] Candidate entries inspected for this draw after the credit-derived cap. This may + # # @param tweet_id [String] - # @param valid_entries [Integer] + # + # @param valid_entries [Integer] Entries from the inspected candidate set that passed all filters. This is not ne + # # @param winners [Array] end end diff --git a/lib/x_twitter_scraper/models/embedded_tweet.rb b/lib/x_twitter_scraper/models/embedded_tweet.rb new file mode 100644 index 0000000..b154042 --- /dev/null +++ b/lib/x_twitter_scraper/models/embedded_tweet.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class EmbeddedTweet < 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 author + # X user profile with bio, follower counts, and verification status. + # + # @return [XTwitterScraper::Models::UserProfile, nil] + optional :author, -> { XTwitterScraper::UserProfile } + + # @!attribute content_disclosure + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + # + # @return [XTwitterScraper::Models::ContentDisclosure, nil] + optional :content_disclosure, -> { XTwitterScraper::ContentDisclosure }, api_name: :contentDisclosure + + # @!attribute conversation_id + # + # @return [String, nil] + optional :conversation_id, String, api_name: :conversationId + + # @!attribute created_at + # + # @return [String, nil] + optional :created_at, String, api_name: :createdAt + + # @!attribute display_text_range + # + # @return [Array, nil] + optional :display_text_range, + XTwitterScraper::Internal::Type::ArrayOf[Integer], + api_name: :displayTextRange + + # @!attribute entities + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute in_reply_to_id + # + # @return [String, nil] + optional :in_reply_to_id, String, api_name: :inReplyToId + + # @!attribute in_reply_to_user_id + # + # @return [String, nil] + optional :in_reply_to_user_id, String, api_name: :inReplyToUserId + + # @!attribute in_reply_to_username + # + # @return [String, nil] + optional :in_reply_to_username, String, api_name: :inReplyToUsername + + # @!attribute is_limited_reply + # + # @return [Boolean, nil] + optional :is_limited_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isLimitedReply + + # @!attribute is_note_tweet + # + # @return [Boolean, nil] + optional :is_note_tweet, XTwitterScraper::Internal::Type::Boolean, api_name: :isNoteTweet + + # @!attribute is_quote_status + # + # @return [Boolean, nil] + optional :is_quote_status, XTwitterScraper::Internal::Type::Boolean, api_name: :isQuoteStatus + + # @!attribute is_reply + # + # @return [Boolean, nil] + optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + + # @!attribute lang + # + # @return [String, nil] + optional :lang, String + + # @!attribute media + # + # @return [Array, nil] + optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } + + # @!attribute source + # + # @return [String, nil] + optional :source, String + + # @!attribute type + # + # @return [String, nil] + optional :type, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, source: nil, type: nil, url: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::EmbeddedTweet} for more details. + # + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + # + # @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 author [XTwitterScraper::Models::UserProfile] X user profile with bio, follower counts, and verification status. + # + # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh + # + # @param conversation_id [String] + # + # @param created_at [String] + # + # @param display_text_range [Array] + # + # @param entities [Hash{Symbol=>Object}] + # + # @param in_reply_to_id [String] + # + # @param in_reply_to_user_id [String] + # + # @param in_reply_to_username [String] + # + # @param is_limited_reply [Boolean] + # + # @param is_note_tweet [Boolean] + # + # @param is_quote_status [Boolean] + # + # @param is_reply [Boolean] + # + # @param lang [String] + # + # @param media [Array] + # + # @param source [String] + # + # @param type [String] + # + # @param url [String] + end + end +end diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index fda7eac..eb1aa4d 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -5,47 +5,215 @@ module Models class Error < XTwitterScraper::Internal::Type::BaseModel # @!attribute error # - # @return [Symbol, XTwitterScraper::Models::Error::Error] - required :error, enum: -> { XTwitterScraper::Error::Error } + # @return [Symbol, XTwitterScraper::Models::Error::Error::LegacyErrorCode, XTwitterScraper::Models::Error::Error::StructuredError] + required :error, union: -> { XTwitterScraper::Error::Error } # @!method initialize(error:) - # Error response containing a machine-readable error code. + # Error response. Default v1 returns a legacy string error code. Send + # `xquik-api-contract: 2026-04-29` to receive the structured best-practice error + # object. # - # @param error [Symbol, XTwitterScraper::Models::Error::Error] + # @param error [Symbol, XTwitterScraper::Models::Error::Error::LegacyErrorCode, XTwitterScraper::Models::Error::Error::StructuredError] # @see XTwitterScraper::Models::Error#error module Error - extend XTwitterScraper::Internal::Type::Enum - - INTERNAL_ERROR = :internal_error - INVALID_FORMAT = :invalid_format - INVALID_ID = :invalid_id - INVALID_INPUT = :invalid_input - INVALID_PARAMS = :invalid_params - INVALID_TOOL_TYPE = :invalid_tool_type - INVALID_TWEET_ID = :invalid_tweet_id - INVALID_TWEET_URL = :invalid_tweet_url - INVALID_USERNAME = :invalid_username - INSUFFICIENT_CREDITS = :insufficient_credits - MISSING_PARAMS = :missing_params - MISSING_QUERY = :missing_query - MONITOR_ALREADY_EXISTS = :monitor_already_exists - MONITOR_LIMIT_REACHED = :monitor_limit_reached - NO_CREDITS = :no_credits - NO_SUBSCRIPTION = :no_subscription - NOT_FOUND = :not_found - SUBSCRIPTION_INACTIVE = :subscription_inactive - TWEET_NOT_FOUND = :tweet_not_found - UNAUTHENTICATED = :unauthenticated - UNSUPPORTED_FIELD = :unsupported_field - USER_NOT_FOUND = :user_not_found - WEBHOOK_INACTIVE = :webhook_inactive - X_API_RATE_LIMITED = :x_api_rate_limited - X_API_UNAVAILABLE = :x_api_unavailable - X_API_UNAUTHORIZED = :x_api_unauthorized - - # @!method self.values - # @return [Array] + extend XTwitterScraper::Internal::Type::Union + + variant enum: -> { XTwitterScraper::Error::Error::LegacyErrorCode } + + variant -> { XTwitterScraper::Error::Error::StructuredError } + + module LegacyErrorCode + extend XTwitterScraper::Internal::Type::Enum + + INTERNAL_ERROR = :internal_error + ACCOUNT_ALREADY_CONNECTED = :account_already_connected + ACCOUNT_NEEDS_REAUTH = :account_needs_reauth + ACCOUNT_NOT_FOUND = :account_not_found + ACCOUNT_REQUIRED = :account_required + ACCOUNT_RESTRICTED = :account_restricted + API_KEY_LIMIT_REACHED = :api_key_limit_reached + ARTICLE_NOT_FOUND = :article_not_found + DM_NOT_PERMITTED = :dm_not_permitted + INVALID_FORMAT = :invalid_format + INVALID_ID = :invalid_id + INVALID_INPUT = :invalid_input + INVALID_PARAMS = :invalid_params + INVALID_TOOL_TYPE = :invalid_tool_type + INVALID_TWEET_ID = :invalid_tweet_id + INVALID_TWEET_URL = :invalid_tweet_url + INVALID_USER_ID = :invalid_user_id + INVALID_USER_IDS = :invalid_user_ids + INVALID_USERNAME = :invalid_username + INVALID_JSON = :invalid_json + INSUFFICIENT_CREDITS = :insufficient_credits + LOGIN_COOLDOWN = :login_cooldown + LOGIN_FAILED = :login_failed + MEDIA_DOWNLOAD_FAILED = :media_download_failed + MISSING_PARAMS = :missing_params + MISSING_QUERY = :missing_query + MONITOR_ALREADY_EXISTS = :monitor_already_exists + NO_MEDIA = :no_media + NO_CREDITS = :no_credits + NO_SUBSCRIPTION = :no_subscription + NOT_FOUND = :not_found + PAYMENT_FAILED = :payment_failed + RATE_LIMIT_EXCEEDED = :rate_limit_exceeded + SERVICE_UNAVAILABLE = :service_unavailable + STYLE_NOT_FOUND = :style_not_found + SUBSCRIPTION_INACTIVE = :subscription_inactive + TWEET_NOT_FOUND = :tweet_not_found + UNAUTHENTICATED = :unauthenticated + UNSUPPORTED_FIELD = :unsupported_field + USER_NOT_FOUND = :user_not_found + X_ACCOUNT_FEATURE_REQUIRED = :x_account_feature_required + X_ACCOUNT_PROTECTED = :x_account_protected + X_ACCOUNT_SUSPENDED = :x_account_suspended + X_API_RATE_LIMITED = :x_api_rate_limited + X_API_UNAVAILABLE = :x_api_unavailable + X_API_UNAUTHORIZED = :x_api_unauthorized + X_AUTH_FAILURE = :x_auth_failure + X_CONTENT_TOO_LONG = :x_content_too_long + X_DAILY_LIMIT = :x_daily_limit + X_DM_NOT_ALLOWED = :x_dm_not_allowed + X_DUPLICATE_ACTION = :x_duplicate_action + X_LOGIN_AUTH_FAILED = :x_login_auth_failed + X_LOGIN_CHALLENGE = :x_login_challenge + X_LOGIN_DENIED = :x_login_denied + X_LOGIN_FAILED = :x_login_failed + X_LOGIN_PROXY_ERROR = :x_login_proxy_error + X_LOGIN_RATE_LIMITED = :x_login_rate_limited + X_LOGIN_SERVICE_UNAVAILABLE = :x_login_service_unavailable + X_LOGIN_SUSPENDED = :x_login_suspended + X_RATE_LIMITED = :x_rate_limited + X_REJECTED = :x_rejected + X_TARGET_NOT_FOUND = :x_target_not_found + X_TRANSIENT_ERROR = :x_transient_error + X_USER_LOOKUP_FAILED = :x_user_lookup_failed + X_WRITE_AMBIGUOUS = :x_write_ambiguous + X_WRITE_FAILED = :x_write_failed + X_WRITE_UNCONFIRMED = :x_write_unconfirmed + + # @!method self.values + # @return [Array] + end + + class StructuredError < XTwitterScraper::Internal::Type::BaseModel + # @!attribute code + # + # @return [Symbol, XTwitterScraper::Models::Error::Error::StructuredError::Code] + required :code, enum: -> { XTwitterScraper::Error::Error::StructuredError::Code } + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::Error::Error::StructuredError::Type] + required :type, enum: -> { XTwitterScraper::Error::Error::StructuredError::Type } + + # @!method initialize(code:, message:, type:) + # @param code [Symbol, XTwitterScraper::Models::Error::Error::StructuredError::Code] + # @param message [String] + # @param type [Symbol, XTwitterScraper::Models::Error::Error::StructuredError::Type] + + # @see XTwitterScraper::Models::Error::Error::StructuredError#code + module Code + extend XTwitterScraper::Internal::Type::Enum + + INTERNAL_ERROR = :internal_error + ACCOUNT_ALREADY_CONNECTED = :account_already_connected + ACCOUNT_NEEDS_REAUTH = :account_needs_reauth + ACCOUNT_NOT_FOUND = :account_not_found + ACCOUNT_REQUIRED = :account_required + ACCOUNT_RESTRICTED = :account_restricted + API_KEY_LIMIT_REACHED = :api_key_limit_reached + ARTICLE_NOT_FOUND = :article_not_found + DM_NOT_PERMITTED = :dm_not_permitted + INVALID_FORMAT = :invalid_format + INVALID_ID = :invalid_id + INVALID_INPUT = :invalid_input + INVALID_PARAMS = :invalid_params + INVALID_TOOL_TYPE = :invalid_tool_type + INVALID_TWEET_ID = :invalid_tweet_id + INVALID_TWEET_URL = :invalid_tweet_url + INVALID_USER_ID = :invalid_user_id + INVALID_USER_IDS = :invalid_user_ids + INVALID_USERNAME = :invalid_username + INVALID_JSON = :invalid_json + INSUFFICIENT_CREDITS = :insufficient_credits + LOGIN_COOLDOWN = :login_cooldown + LOGIN_FAILED = :login_failed + MEDIA_DOWNLOAD_FAILED = :media_download_failed + MISSING_PARAMS = :missing_params + MISSING_QUERY = :missing_query + MONITOR_ALREADY_EXISTS = :monitor_already_exists + NO_MEDIA = :no_media + NO_CREDITS = :no_credits + NO_SUBSCRIPTION = :no_subscription + NOT_FOUND = :not_found + PAYMENT_FAILED = :payment_failed + RATE_LIMIT_EXCEEDED = :rate_limit_exceeded + SERVICE_UNAVAILABLE = :service_unavailable + STYLE_NOT_FOUND = :style_not_found + SUBSCRIPTION_INACTIVE = :subscription_inactive + TWEET_NOT_FOUND = :tweet_not_found + UNAUTHENTICATED = :unauthenticated + UNSUPPORTED_FIELD = :unsupported_field + USER_NOT_FOUND = :user_not_found + X_ACCOUNT_FEATURE_REQUIRED = :x_account_feature_required + X_ACCOUNT_PROTECTED = :x_account_protected + X_ACCOUNT_SUSPENDED = :x_account_suspended + X_API_RATE_LIMITED = :x_api_rate_limited + X_API_UNAVAILABLE = :x_api_unavailable + X_API_UNAUTHORIZED = :x_api_unauthorized + X_AUTH_FAILURE = :x_auth_failure + X_CONTENT_TOO_LONG = :x_content_too_long + X_DAILY_LIMIT = :x_daily_limit + X_DM_NOT_ALLOWED = :x_dm_not_allowed + X_DUPLICATE_ACTION = :x_duplicate_action + X_LOGIN_AUTH_FAILED = :x_login_auth_failed + X_LOGIN_CHALLENGE = :x_login_challenge + X_LOGIN_DENIED = :x_login_denied + X_LOGIN_FAILED = :x_login_failed + X_LOGIN_PROXY_ERROR = :x_login_proxy_error + X_LOGIN_RATE_LIMITED = :x_login_rate_limited + X_LOGIN_SERVICE_UNAVAILABLE = :x_login_service_unavailable + X_LOGIN_SUSPENDED = :x_login_suspended + X_RATE_LIMITED = :x_rate_limited + X_REJECTED = :x_rejected + X_TARGET_NOT_FOUND = :x_target_not_found + X_TRANSIENT_ERROR = :x_transient_error + X_USER_LOOKUP_FAILED = :x_user_lookup_failed + X_WRITE_AMBIGUOUS = :x_write_ambiguous + X_WRITE_FAILED = :x_write_failed + X_WRITE_UNCONFIRMED = :x_write_unconfirmed + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::Error::Error::StructuredError#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + API_ERROR = :api_error + AUTHENTICATION_ERROR = :authentication_error + BILLING_ERROR = :billing_error + DEPENDENCY_ERROR = :dependency_error + INVALID_REQUEST_ERROR = :invalid_request_error + PERMISSION_ERROR = :permission_error + RATE_LIMIT_ERROR = :rate_limit_error + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Symbol, XTwitterScraper::Models::Error::Error::LegacyErrorCode, XTwitterScraper::Models::Error::Error::StructuredError)] end end end diff --git a/lib/x_twitter_scraper/models/event.rb b/lib/x_twitter_scraper/models/event.rb index 99818db..7db661a 100644 --- a/lib/x_twitter_scraper/models/event.rb +++ b/lib/x_twitter_scraper/models/event.rb @@ -14,10 +14,17 @@ class Event < XTwitterScraper::Internal::Type::BaseModel required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] # @!attribute monitor_id + # Account monitor ID for account events, or keyword monitor ID for keyword events. # # @return [String] required :monitor_id, String, api_name: :monitorId + # @!attribute monitor_type + # Source monitor type. + # + # @return [Symbol, XTwitterScraper::Models::Event::MonitorType] + required :monitor_type, enum: -> { XTwitterScraper::Event::MonitorType }, api_name: :monitorType + # @!attribute occurred_at # # @return [Time] @@ -29,25 +36,60 @@ class Event < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::EventType] required :type, enum: -> { XTwitterScraper::EventType } + # @!attribute keyword_monitor_id + # Keyword monitor ID, present for keyword monitor events. + # + # @return [String, nil] + optional :keyword_monitor_id, String, api_name: :keywordMonitorId + + # @!attribute query + # Keyword query, present for keyword monitor events. + # + # @return [String, nil] + optional :query, String + # @!attribute username + # Account username, present for account monitor events. # - # @return [String] - required :username, String + # @return [String, nil] + optional :username, String - # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:) - # Monitor event summary with type, username, and occurrence time. + # @!method initialize(id:, data:, monitor_id:, monitor_type:, occurred_at:, type:, keyword_monitor_id: nil, query: nil, username: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::Event} for more details. + # + # Monitor event summary with source metadata and occurrence time. # # @param id [String] # # @param data [Hash{Symbol=>Object}] # - # @param monitor_id [String] + # @param monitor_id [String] Account monitor ID for account events, or keyword monitor ID for keyword events. + # + # @param monitor_type [Symbol, XTwitterScraper::Models::Event::MonitorType] Source monitor type. # # @param occurred_at [Time] # # @param type [Symbol, XTwitterScraper::Models::EventType] Type of monitor event fired when account activity occurs. # - # @param username [String] + # @param keyword_monitor_id [String] Keyword monitor ID, present for keyword monitor events. + # + # @param query [String] Keyword query, present for keyword monitor events. + # + # @param username [String] Account username, present for account monitor events. + + # Source monitor type. + # + # @see XTwitterScraper::Models::Event#monitor_type + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + ACCOUNT = :account + KEYWORD = :keyword + + # @!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 ab9a93a..7e60430 100644 --- a/lib/x_twitter_scraper/models/event_detail.rb +++ b/lib/x_twitter_scraper/models/event_detail.rb @@ -16,10 +16,17 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] # @!attribute monitor_id + # Monitor ID associated with this detailed event payload. # # @return [String] required :monitor_id, String, api_name: :monitorId + # @!attribute monitor_type + # Source monitor type for this detailed event. + # + # @return [Symbol, XTwitterScraper::Models::EventDetail::MonitorType] + required :monitor_type, enum: -> { XTwitterScraper::EventDetail::MonitorType }, api_name: :monitorType + # @!attribute occurred_at # # @return [Time] @@ -31,32 +38,64 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::EventType] required :type, enum: -> { XTwitterScraper::EventType } + # @!attribute keyword_monitor_id + # Keyword monitor ID included on detailed keyword events. + # + # @return [String, nil] + optional :keyword_monitor_id, String, api_name: :keywordMonitorId + + # @!attribute query + # Keyword query for this detailed monitor event. + # + # @return [String, nil] + optional :query, String + # @!attribute username + # Account username for this detailed monitor event. # - # @return [String] - required :username, String + # @return [String, nil] + optional :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) + # @!method initialize(id:, data:, monitor_id:, monitor_type:, occurred_at:, type:, keyword_monitor_id: nil, query: nil, username: nil, 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) # - # @param monitor_id [String] + # @param monitor_id [String] Monitor ID associated with this detailed event payload. + # + # @param monitor_type [Symbol, XTwitterScraper::Models::EventDetail::MonitorType] Source monitor type for this detailed event. # # @param occurred_at [Time] # # @param type [Symbol, XTwitterScraper::Models::EventType] Type of monitor event fired when account activity occurs. # - # @param username [String] + # @param keyword_monitor_id [String] Keyword monitor ID included on detailed keyword events. + # + # @param query [String] Keyword query for this detailed monitor event. + # + # @param username [String] Account username for this detailed monitor event. # # @param x_event_id [String] + + # Source monitor type for this detailed event. + # + # @see XTwitterScraper::Models::EventDetail#monitor_type + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + ACCOUNT = :account + KEYWORD = :keyword + + # @!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 13d18f0..ce52144 100644 --- a/lib/x_twitter_scraper/models/event_list_params.rb +++ b/lib/x_twitter_scraper/models/event_list_params.rb @@ -7,11 +7,11 @@ class EventListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute after - # Cursor for keyset pagination + # @!attribute cursor + # Cursor for keyset pagination from prior response next_cursor # # @return [String, nil] - optional :after, String + optional :cursor, String # @!attribute event_type # Filter events by type @@ -20,7 +20,10 @@ class EventListParams < XTwitterScraper::Internal::Type::BaseModel optional :event_type, enum: -> { XTwitterScraper::EventType } # @!attribute limit - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. # # @return [Integer, nil] optional :limit, Integer @@ -31,12 +34,15 @@ class EventListParams < XTwitterScraper::Internal::Type::BaseModel # @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 keyset pagination + # @!method initialize(cursor: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::EventListParams} for more details. + # + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # # @param event_type [Symbol, XTwitterScraper::Models::EventType] Filter events by type # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param monitor_id [String] Filter events by monitor ID # diff --git a/lib/x_twitter_scraper/models/event_type.rb b/lib/x_twitter_scraper/models/event_type.rb index f41fff8..d155cb4 100644 --- a/lib/x_twitter_scraper/models/event_type.rb +++ b/lib/x_twitter_scraper/models/event_type.rb @@ -10,6 +10,23 @@ module EventType TWEET_REPLY = :"tweet.reply" TWEET_RETWEET = :"tweet.retweet" TWEET_QUOTE = :"tweet.quote" + TWEET_MEDIA = :"tweet.media" + TWEET_LINK = :"tweet.link" + TWEET_POLL = :"tweet.poll" + TWEET_MENTION = :"tweet.mention" + TWEET_HASHTAG = :"tweet.hashtag" + TWEET_LONGFORM = :"tweet.longform" + PROFILE_AVATAR_CHANGED = :"profile.avatar.changed" + PROFILE_BANNER_CHANGED = :"profile.banner.changed" + PROFILE_NAME_CHANGED = :"profile.name.changed" + PROFILE_USERNAME_CHANGED = :"profile.username.changed" + PROFILE_BIO_CHANGED = :"profile.bio.changed" + PROFILE_LOCATION_CHANGED = :"profile.location.changed" + PROFILE_URL_CHANGED = :"profile.url.changed" + PROFILE_VERIFIED_CHANGED = :"profile.verified.changed" + PROFILE_PROTECTED_CHANGED = :"profile.protected.changed" + PROFILE_PINNED_TWEET_CHANGED = :"profile.pinned_tweet.changed" + PROFILE_UNAVAILABLE_CHANGED = :"profile.unavailable.changed" # @!method self.values # @return [Array] 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 9e89691..6f142fc 100644 --- a/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +++ b/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb @@ -21,6 +21,32 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :advanced_query, String, api_name: :advancedQuery + # @!attribute any_words + # Alternative words or quoted phrases for estimated results. Separate with spaces, + # commas, or lines. + # + # @return [String, nil] + optional :any_words, String, api_name: :anyWords + + # @!attribute bounding_box + # Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 + # (tweet_search_extractor) + # + # @return [String, nil] + optional :bounding_box, String, api_name: :boundingBox + + # @!attribute cashtags + # Cashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter used for estimation (tweet_search_extractor) + # + # @return [String, nil] + optional :conversation_id, String, api_name: :conversationId + # @!attribute exact_phrase # Exact phrase filter for search estimation # @@ -28,27 +54,163 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel optional :exact_phrase, String, api_name: :exactPhrase # @!attribute exclude_words - # Words excluded from estimated search results + # Words or quoted phrases excluded from estimated results. Separate with spaces, + # commas, or lines. # # @return [String, nil] optional :exclude_words, String, api_name: :excludeWords + # @!attribute from_user + # Estimate only tweets from this author username (tweet_search_extractor) + # + # @return [String, nil] + optional :from_user, String, api_name: :fromUser + + # @!attribute hashtags + # Hashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Estimate only replies to this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String, api_name: :inReplyToTweetId + + # @!attribute language + # Language code used for estimate filtering (tweet_search_extractor) + # + # @return [String, nil] + optional :language, String + + # @!attribute list_id + # Estimate search results within this list ID (tweet_search_extractor) + # + # @return [String, nil] + optional :list_id, String, api_name: :listId + + # @!attribute media_type + # Media type used for estimate filtering (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::MediaType, nil] + optional :media_type, + enum: -> { XTwitterScraper::ExtractionEstimateCostParams::MediaType }, + api_name: :mediaType + + # @!attribute mentioning + # Estimate tweets mentioning this username (tweet_search_extractor) + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold for estimated results (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_faves, Integer, api_name: :minFaves + + # @!attribute min_quotes + # Minimum quote count threshold for estimated results (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_quotes, Integer, api_name: :minQuotes + + # @!attribute min_replies + # Minimum replies threshold for estimated results (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_replies, Integer, api_name: :minReplies + + # @!attribute min_retweets + # Minimum retweets threshold for estimated results (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_retweets, Integer, api_name: :minRetweets + + # @!attribute place + # Estimate search results within this place ID (tweet_search_extractor) + # + # @return [String, nil] + optional :place, String + + # @!attribute place_country + # Estimate search results within this country code (tweet_search_extractor) + # + # @return [String, nil] + optional :place_country, String, api_name: :placeCountry + + # @!attribute point_radius + # Geo point radius used for estimation, e.g. -73.99 40.73 25mi + # (tweet_search_extractor) + # + # @return [String, nil] + optional :point_radius, String, api_name: :pointRadius + + # @!attribute quotes + # Quote mode used for estimation (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::ExtractionEstimateCostParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Estimate only quotes of this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :quotes_of_tweet_id, String, api_name: :quotesOfTweetId + + # @!attribute replies + # Reply mode used for estimation (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::ExtractionEstimateCostParams::Replies } + + # @!attribute results_limit + # Maximum number of results to estimate. When set, the estimate caps projected + # results to this value. + # + # @return [Integer, nil] + optional :results_limit, Integer, api_name: :resultsLimit + + # @!attribute retweets + # Retweet mode used for estimation (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::ExtractionEstimateCostParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Estimate only retweets of this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :retweets_of_tweet_id, String, api_name: :retweetsOfTweetId + # @!attribute search_query + # Required for tweet_search_extractor & community_search. # # @return [String, nil] optional :search_query, String, api_name: :searchQuery + # @!attribute since_date + # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) + # + # @return [Date, nil] + optional :since_date, Date, api_name: :sinceDate + # @!attribute target_community_id + # Required for community_post_extractor & community_search. # # @return [String, nil] optional :target_community_id, String, api_name: :targetCommunityId # @!attribute target_list_id + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. # # @return [String, nil] optional :target_list_id, String, api_name: :targetListId # @!attribute target_space_id + # Required for space_explorer. # # @return [String, nil] optional :target_space_id, String, api_name: :targetSpaceId @@ -63,27 +225,112 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] 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: {}) + # @!attribute to_user + # Estimate replies sent to this username (tweet_search_extractor) + # + # @return [String, nil] + optional :to_user, String, api_name: :toUser + + # @!attribute until_date + # Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + # + # @return [Date, nil] + optional :until_date, Date, api_name: :untilDate + + # @!attribute url + # URL substring or domain filter used for estimation (tweet_search_extractor) + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Estimate only verified authors (tweet_search_extractor) + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean, api_name: :verifiedOnly + + # @!method initialize(tool_type:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, results_limit: nil, retweets: nil, retweets_of_tweet_id: nil, search_query: nil, since_date: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionEstimateCostParams} for more details. + # # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] Identifier for the extraction tool used to run a job. # # @param advanced_query [String] Raw advanced query string appended to the estimate (tweet_search_extractor) # + # @param any_words [String] Alternative words or quoted phrases for estimated results. Separate with spaces, + # + # @param bounding_box [String] Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_e + # + # @param cashtags [String] Cashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter used for estimation (tweet_search_extractor) + # # @param exact_phrase [String] Exact phrase filter for search estimation # - # @param exclude_words [String] Words excluded from estimated search results + # @param exclude_words [String] Words or quoted phrases excluded from estimated results. Separate with spaces, c + # + # @param from_user [String] Estimate only tweets from this author username (tweet_search_extractor) + # + # @param hashtags [String] Hashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Estimate only replies to this tweet ID (tweet_search_extractor) + # + # @param language [String] Language code used for estimate filtering (tweet_search_extractor) + # + # @param list_id [String] Estimate search results within this list ID (tweet_search_extractor) + # + # @param media_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::MediaType] Media type used for estimate filtering (tweet_search_extractor) + # + # @param mentioning [String] Estimate tweets mentioning this username (tweet_search_extractor) + # + # @param min_faves [Integer] Minimum likes threshold for estimated results (tweet_search_extractor) + # + # @param min_quotes [Integer] Minimum quote count threshold for estimated results (tweet_search_extractor) + # + # @param min_replies [Integer] Minimum replies threshold for estimated results (tweet_search_extractor) + # + # @param min_retweets [Integer] Minimum retweets threshold for estimated results (tweet_search_extractor) + # + # @param place [String] Estimate search results within this place ID (tweet_search_extractor) + # + # @param place_country [String] Estimate search results within this country code (tweet_search_extractor) + # + # @param point_radius [String] Geo point radius used for estimation, e.g. -73.99 40.73 25mi (tweet_search_extra + # + # @param quotes [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Quotes] Quote mode used for estimation (tweet_search_extractor) + # + # @param quotes_of_tweet_id [String] Estimate only quotes of this tweet ID (tweet_search_extractor) + # + # @param replies [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Replies] Reply mode used for estimation (tweet_search_extractor) + # + # @param results_limit [Integer] Maximum number of results to estimate. When set, the estimate caps projected res + # + # @param retweets [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Retweets] Retweet mode used for estimation (tweet_search_extractor) + # + # @param retweets_of_tweet_id [String] Estimate only retweets of this tweet ID (tweet_search_extractor) # - # @param search_query [String] + # @param search_query [String] Required for tweet_search_extractor & community_search. # - # @param target_community_id [String] + # @param since_date [Date] Estimate start date in YYYY-MM-DD format (tweet_search_extractor) # - # @param target_list_id [String] + # @param target_community_id [String] Required for community_post_extractor & community_search. # - # @param target_space_id [String] + # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # + # @param target_space_id [String] Required for space_explorer. # # @param target_tweet_id [String] # # @param target_username [String] # + # @param to_user [String] Estimate replies sent to this username (tweet_search_extractor) + # + # @param until_date [Date] Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + # + # @param url [String] URL substring or domain filter used for estimation (tweet_search_extractor) + # + # @param verified_only [Boolean] Estimate only verified authors (tweet_search_extractor) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] # Identifier for the extraction tool used to run a job. @@ -95,6 +342,7 @@ module ToolType COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer COMMUNITY_POST_EXTRACTOR = :community_post_extractor COMMUNITY_SEARCH = :community_search + FAVORITERS = :favoriters FOLLOWER_EXPLORER = :follower_explorer FOLLOWING_EXPLORER = :following_explorer LIST_FOLLOWER_EXPLORER = :list_follower_explorer @@ -109,11 +357,64 @@ module ToolType SPACE_EXPLORER = :space_explorer THREAD_EXTRACTOR = :thread_extractor TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor + USER_LIKES = :user_likes + USER_MEDIA = :user_media VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer # @!method self.values # @return [Array] end + + # Media type used for estimate filtering (tweet_search_extractor) + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode used for estimation (tweet_search_extractor) + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode used for estimation (tweet_search_extractor) + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode used for estimation (tweet_search_extractor) + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb b/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb index dcf0903..1d81e25 100644 --- a/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb +++ b/lib/x_twitter_scraper/models/extraction_estimate_cost_response.rb @@ -26,8 +26,8 @@ class ExtractionEstimateCostResponse < XTwitterScraper::Internal::Type::BaseMode # @!attribute source # - # @return [String] - required :source, String + # @return [Symbol, XTwitterScraper::Models::ExtractionEstimateCostResponse::Source] + required :source, enum: -> { XTwitterScraper::Models::ExtractionEstimateCostResponse::Source } # @!attribute resolved_x_user_id # @@ -39,8 +39,26 @@ class ExtractionEstimateCostResponse < XTwitterScraper::Internal::Type::BaseMode # @param credits_available [String] # @param credits_required [String] # @param estimated_results [Integer] - # @param source [String] + # @param source [Symbol, XTwitterScraper::Models::ExtractionEstimateCostResponse::Source] # @param resolved_x_user_id [String] + + # @see XTwitterScraper::Models::ExtractionEstimateCostResponse#source + module Source + extend XTwitterScraper::Internal::Type::Enum + + FOLLOWERS = :followers + FOLLOWING = :following + PAGINATION_CAP = :paginationCap + POSTS = :posts + QUOTE_COUNT = :quoteCount + REPLY_COUNT = :replyCount + RESULTS_LIMIT = :resultsLimit + RETWEET_COUNT = :retweetCount + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end end end end 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 4b0ac77..360e50b 100644 --- a/lib/x_twitter_scraper/models/extraction_export_results_params.rb +++ b/lib/x_twitter_scraper/models/extraction_export_results_params.rb @@ -15,10 +15,10 @@ class ExtractionExportResultsParams < XTwitterScraper::Internal::Type::BaseModel # @!attribute format_ # Export file format # - # @return [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format, nil] - optional :format_, enum: -> { XTwitterScraper::ExtractionExportResultsParams::Format } + # @return [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] + required :format_, enum: -> { XTwitterScraper::ExtractionExportResultsParams::Format } - # @!method initialize(id:, format_: nil, request_options: {}) + # @!method initialize(id:, format_:, request_options: {}) # @param id [String] # # @param format_ [Symbol, XTwitterScraper::Models::ExtractionExportResultsParams::Format] Export file format diff --git a/lib/x_twitter_scraper/models/extraction_job.rb b/lib/x_twitter_scraper/models/extraction_job.rb index f899fe0..718b793 100644 --- a/lib/x_twitter_scraper/models/extraction_job.rb +++ b/lib/x_twitter_scraper/models/extraction_job.rb @@ -72,6 +72,7 @@ module ToolType COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer COMMUNITY_POST_EXTRACTOR = :community_post_extractor COMMUNITY_SEARCH = :community_search + FAVORITERS = :favoriters FOLLOWER_EXPLORER = :follower_explorer FOLLOWING_EXPLORER = :following_explorer LIST_FOLLOWER_EXPLORER = :list_follower_explorer @@ -86,6 +87,8 @@ module ToolType SPACE_EXPLORER = :space_explorer THREAD_EXTRACTOR = :thread_extractor TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor + USER_LIKES = :user_likes + USER_MEDIA = :user_media VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer # @!method self.values diff --git a/lib/x_twitter_scraper/models/extraction_list_params.rb b/lib/x_twitter_scraper/models/extraction_list_params.rb index 940f521..7208518 100644 --- a/lib/x_twitter_scraper/models/extraction_list_params.rb +++ b/lib/x_twitter_scraper/models/extraction_list_params.rb @@ -7,14 +7,17 @@ class ExtractionListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!attribute after - # Cursor for keyset pagination + # @!attribute cursor + # Cursor for keyset pagination from prior response next_cursor # # @return [String, nil] - optional :after, String + optional :cursor, String # @!attribute limit - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. # # @return [Integer, nil] optional :limit, Integer @@ -31,10 +34,13 @@ class ExtractionListParams < XTwitterScraper::Internal::Type::BaseModel # @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 keyset pagination + # @!method initialize(cursor: nil, limit: nil, status: nil, tool_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionListParams} for more details. # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor + # + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] Filter by job status # @@ -63,6 +69,7 @@ module ToolType COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer COMMUNITY_POST_EXTRACTOR = :community_post_extractor COMMUNITY_SEARCH = :community_search + FAVORITERS = :favoriters FOLLOWER_EXPLORER = :follower_explorer FOLLOWING_EXPLORER = :following_explorer LIST_FOLLOWER_EXPLORER = :list_follower_explorer @@ -77,6 +84,8 @@ module ToolType SPACE_EXPLORER = :space_explorer THREAD_EXTRACTOR = :thread_extractor TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor + USER_LIKES = :user_likes + USER_MEDIA = :user_media VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer # @!method self.values diff --git a/lib/x_twitter_scraper/models/extraction_retrieve_params.rb b/lib/x_twitter_scraper/models/extraction_retrieve_params.rb index c0fdd21..dba9f8b 100644 --- a/lib/x_twitter_scraper/models/extraction_retrieve_params.rb +++ b/lib/x_twitter_scraper/models/extraction_retrieve_params.rb @@ -12,11 +12,11 @@ class ExtractionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute after - # Cursor for keyset pagination + # @!attribute cursor + # Cursor for keyset pagination from prior response next_cursor # # @return [String, nil] - optional :after, String + optional :cursor, String # @!attribute limit # Maximum number of results to return (1-1000, default 100) @@ -24,10 +24,10 @@ class ExtractionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :limit, Integer - # @!method initialize(id:, after: nil, limit: nil, request_options: {}) + # @!method initialize(id:, cursor: nil, limit: nil, request_options: {}) # @param id [String] # - # @param after [String] Cursor for keyset pagination + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # # @param limit [Integer] Maximum number of results to return (1-1000, default 100) # diff --git a/lib/x_twitter_scraper/models/extraction_run_params.rb b/lib/x_twitter_scraper/models/extraction_run_params.rb index 9026fbf..9854b56 100644 --- a/lib/x_twitter_scraper/models/extraction_run_params.rb +++ b/lib/x_twitter_scraper/models/extraction_run_params.rb @@ -19,6 +19,31 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :advanced_query, String, api_name: :advancedQuery + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. (tweet_search_extractor) + # + # @return [String, nil] + optional :any_words, String, api_name: :anyWords + + # @!attribute bounding_box + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + # + # @return [String, nil] + optional :bounding_box, String, api_name: :boundingBox + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter (tweet_search_extractor) + # + # @return [String, nil] + optional :conversation_id, String, api_name: :conversationId + # @!attribute exact_phrase # Exact phrase to match (tweet_search_extractor) # @@ -26,27 +51,160 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel optional :exact_phrase, String, api_name: :exactPhrase # @!attribute exclude_words - # Words to exclude from results (tweet_search_extractor) + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # (tweet_search_extractor) # # @return [String, nil] optional :exclude_words, String, api_name: :excludeWords + # @!attribute from_user + # Filter by author username (tweet_search_extractor) + # + # @return [String, nil] + optional :from_user, String, api_name: :fromUser + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String, api_name: :inReplyToTweetId + + # @!attribute language + # Language code filter (tweet_search_extractor) + # + # @return [String, nil] + optional :language, String + + # @!attribute list_id + # Search within a list ID (tweet_search_extractor) + # + # @return [String, nil] + optional :list_id, String, api_name: :listId + + # @!attribute media_type + # Media type filter (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionRunParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::ExtractionRunParams::MediaType }, api_name: :mediaType + + # @!attribute mentioning + # Filter tweets mentioning a username (tweet_search_extractor) + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_faves, Integer, api_name: :minFaves + + # @!attribute min_quotes + # Minimum quote count threshold (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_quotes, Integer, api_name: :minQuotes + + # @!attribute min_replies + # Minimum replies threshold (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_replies, Integer, api_name: :minReplies + + # @!attribute min_retweets + # Minimum retweets threshold (tweet_search_extractor) + # + # @return [Integer, nil] + optional :min_retweets, Integer, api_name: :minRetweets + + # @!attribute place + # Search within a place ID (tweet_search_extractor) + # + # @return [String, nil] + optional :place, String + + # @!attribute place_country + # Search within a country code (tweet_search_extractor) + # + # @return [String, nil] + optional :place_country, String, api_name: :placeCountry + + # @!attribute point_radius + # Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + # + # @return [String, nil] + optional :point_radius, String, api_name: :pointRadius + + # @!attribute quotes + # Quote mode (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionRunParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::ExtractionRunParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :quotes_of_tweet_id, String, api_name: :quotesOfTweetId + + # @!attribute replies + # Reply mode (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionRunParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::ExtractionRunParams::Replies } + + # @!attribute results_limit + # Maximum number of results to extract. When set, the extraction stops after + # reaching this limit. + # + # @return [Integer, nil] + optional :results_limit, Integer, api_name: :resultsLimit + + # @!attribute retweets + # Retweet mode (tweet_search_extractor) + # + # @return [Symbol, XTwitterScraper::Models::ExtractionRunParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::ExtractionRunParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID (tweet_search_extractor) + # + # @return [String, nil] + optional :retweets_of_tweet_id, String, api_name: :retweetsOfTweetId + # @!attribute search_query + # Required for tweet_search_extractor & community_search. # # @return [String, nil] optional :search_query, String, api_name: :searchQuery + # @!attribute since_date + # Start date YYYY-MM-DD (tweet_search_extractor) + # + # @return [Date, nil] + optional :since_date, Date, api_name: :sinceDate + # @!attribute target_community_id + # Required for community_post_extractor & community_search. # # @return [String, nil] optional :target_community_id, String, api_name: :targetCommunityId # @!attribute target_list_id + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. # # @return [String, nil] optional :target_list_id, String, api_name: :targetListId # @!attribute target_space_id + # Required for space_explorer. # # @return [String, nil] optional :target_space_id, String, api_name: :targetSpaceId @@ -61,27 +219,112 @@ class ExtractionRunParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] 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: {}) + # @!attribute to_user + # Filter replies sent to a username (tweet_search_extractor) + # + # @return [String, nil] + optional :to_user, String, api_name: :toUser + + # @!attribute until_date + # End date YYYY-MM-DD (tweet_search_extractor) + # + # @return [Date, nil] + optional :until_date, Date, api_name: :untilDate + + # @!attribute url + # URL substring or domain filter (tweet_search_extractor) + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only verified authors (tweet_search_extractor) + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean, api_name: :verifiedOnly + + # @!method initialize(tool_type:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, results_limit: nil, retweets: nil, retweets_of_tweet_id: nil, search_query: nil, since_date: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionRunParams} for more details. + # # @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) # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param bounding_box [String] Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @param conversation_id [String] Conversation ID filter (tweet_search_extractor) + # # @param exact_phrase [String] Exact phrase to match (tweet_search_extractor) # - # @param exclude_words [String] Words to exclude from results (tweet_search_extractor) + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. (twe + # + # @param from_user [String] Filter by author username (tweet_search_extractor) + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID (tweet_search_extractor) + # + # @param language [String] Language code filter (tweet_search_extractor) + # + # @param list_id [String] Search within a list ID (tweet_search_extractor) + # + # @param media_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::MediaType] Media type filter (tweet_search_extractor) + # + # @param mentioning [String] Filter tweets mentioning a username (tweet_search_extractor) + # + # @param min_faves [Integer] Minimum likes threshold (tweet_search_extractor) + # + # @param min_quotes [Integer] Minimum quote count threshold (tweet_search_extractor) + # + # @param min_replies [Integer] Minimum replies threshold (tweet_search_extractor) + # + # @param min_retweets [Integer] Minimum retweets threshold (tweet_search_extractor) + # + # @param place [String] Search within a place ID (tweet_search_extractor) + # + # @param place_country [String] Search within a country code (tweet_search_extractor) + # + # @param point_radius [String] Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + # + # @param quotes [Symbol, XTwitterScraper::Models::ExtractionRunParams::Quotes] Quote mode (tweet_search_extractor) + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID (tweet_search_extractor) + # + # @param replies [Symbol, XTwitterScraper::Models::ExtractionRunParams::Replies] Reply mode (tweet_search_extractor) + # + # @param results_limit [Integer] Maximum number of results to extract. When set, the extraction stops after reach + # + # @param retweets [Symbol, XTwitterScraper::Models::ExtractionRunParams::Retweets] Retweet mode (tweet_search_extractor) + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID (tweet_search_extractor) # - # @param search_query [String] + # @param search_query [String] Required for tweet_search_extractor & community_search. # - # @param target_community_id [String] + # @param since_date [Date] Start date YYYY-MM-DD (tweet_search_extractor) # - # @param target_list_id [String] + # @param target_community_id [String] Required for community_post_extractor & community_search. # - # @param target_space_id [String] + # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # + # @param target_space_id [String] Required for space_explorer. # # @param target_tweet_id [String] # # @param target_username [String] # + # @param to_user [String] Filter replies sent to a username (tweet_search_extractor) + # + # @param until_date [Date] End date YYYY-MM-DD (tweet_search_extractor) + # + # @param url [String] URL substring or domain filter (tweet_search_extractor) + # + # @param verified_only [Boolean] Only verified authors (tweet_search_extractor) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] # Identifier for the extraction tool used to run a job. @@ -93,6 +336,7 @@ module ToolType COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer COMMUNITY_POST_EXTRACTOR = :community_post_extractor COMMUNITY_SEARCH = :community_search + FAVORITERS = :favoriters FOLLOWER_EXPLORER = :follower_explorer FOLLOWING_EXPLORER = :following_explorer LIST_FOLLOWER_EXPLORER = :list_follower_explorer @@ -107,11 +351,64 @@ module ToolType SPACE_EXPLORER = :space_explorer THREAD_EXTRACTOR = :thread_extractor TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor + USER_LIKES = :user_likes + USER_MEDIA = :user_media VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer # @!method self.values # @return [Array] end + + # Media type filter (tweet_search_extractor) + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode (tweet_search_extractor) + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode (tweet_search_extractor) + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode (tweet_search_extractor) + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/extraction_run_response.rb b/lib/x_twitter_scraper/models/extraction_run_response.rb index c5b10c6..d4b3c60 100644 --- a/lib/x_twitter_scraper/models/extraction_run_response.rb +++ b/lib/x_twitter_scraper/models/extraction_run_response.rb @@ -40,6 +40,7 @@ module ToolType COMMUNITY_MODERATOR_EXPLORER = :community_moderator_explorer COMMUNITY_POST_EXTRACTOR = :community_post_extractor COMMUNITY_SEARCH = :community_search + FAVORITERS = :favoriters FOLLOWER_EXPLORER = :follower_explorer FOLLOWING_EXPLORER = :following_explorer LIST_FOLLOWER_EXPLORER = :list_follower_explorer @@ -54,6 +55,8 @@ module ToolType SPACE_EXPLORER = :space_explorer THREAD_EXTRACTOR = :thread_extractor TWEET_SEARCH_EXTRACTOR = :tweet_search_extractor + USER_LIKES = :user_likes + USER_MEDIA = :user_media VERIFIED_FOLLOWER_EXPLORER = :verified_follower_explorer # @!method self.values diff --git a/lib/x_twitter_scraper/models/guest_wallet_amount.rb b/lib/x_twitter_scraper/models/guest_wallet_amount.rb new file mode 100644 index 0000000..5e81e73 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_amount.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class GuestWalletAmount < XTwitterScraper::Internal::Type::BaseModel + # @!attribute amount_minor + # USD amount in cents. Accepted range is $10-$250. + # + # @return [Integer] + required :amount_minor, Integer + + # @!attribute currency + # + # @return [Symbol, :usd] + required :currency, const: :usd + + # @!method initialize(amount_minor:, currency: :usd) + # Confirmed USD amount for a guest wallet purchase. + # + # @param amount_minor [Integer] USD amount in cents. Accepted range is $10-$250. + # + # @param currency [Symbol, :usd] + end + end +end diff --git a/lib/x_twitter_scraper/models/guest_wallet_create_params.rb b/lib/x_twitter_scraper/models/guest_wallet_create_params.rb new file mode 100644 index 0000000..d32fab8 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_create_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::GuestWallets#create + class GuestWalletCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute amount_minor + # Confirmed USD amount in cents. + # + # @return [Integer] + required :amount_minor, Integer + + # @!attribute currency + # + # @return [Symbol, :usd] + required :currency, const: :usd + + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) + # @param amount_minor [Integer] Confirmed USD amount in cents. + # + # @param idempotency_key [String] + # + # @param currency [Symbol, :usd] + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/x_twitter_scraper/models/guest_wallet_create_response.rb b/lib/x_twitter_scraper/models/guest_wallet_create_response.rb new file mode 100644 index 0000000..59d6786 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_create_response.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::GuestWallets#create + class GuestWalletCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute account_required + # + # @return [Boolean, false] + required :account_required, const: false + + # @!attribute amount + # Confirmed USD amount for a guest wallet purchase. + # + # @return [XTwitterScraper::Models::GuestWalletAmount] + required :amount, -> { XTwitterScraper::GuestWalletAmount } + + # @!attribute api_key + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + # + # @return [String] + required :api_key, String + + # @!attribute authorization + # + # @return [XTwitterScraper::Models::GuestWalletCreateResponse::Authorization] + required :authorization, -> { XTwitterScraper::Models::GuestWalletCreateResponse::Authorization } + + # @!attribute checkout_url + # Raw Stripe-hosted checkout URL for user interaction. + # + # @return [String] + required :checkout_url, String + + # @!attribute credential_notice + # + # @return [Symbol, :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available."] + required :credential_notice, + const: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available." + + # @!attribute credits + # Credits granted after verified payment. + # + # @return [String] + required :credits, String + + # @!attribute expires_at + # Time when the pending checkout expires. + # + # @return [Time] + required :expires_at, Time + + # @!attribute instructions + # + # @return [Symbol, :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending."] + required :instructions, + const: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending." + + # @!attribute poll_after_seconds + # Wait at least this long before polling status_url. + # + # @return [Integer, 2] + required :poll_after_seconds, const: 2 + + # @!attribute purchase_id + # + # @return [String] + required :purchase_id, String + + # @!attribute requires_user_interaction + # + # @return [Boolean, true] + required :requires_user_interaction, const: true + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::GuestWalletCreateResponse::Status } + + # @!attribute status_url + # + # @return [Symbol, :"https://xquik.com/api/v1/guest-wallets/status"] + required :status_url, const: :"https://xquik.com/api/v1/guest-wallets/status" + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!method initialize(amount:, api_key:, authorization:, checkout_url:, credits:, expires_at:, purchase_id:, status:, wallet_id:, account_required: false, credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", poll_after_seconds: 2, requires_user_interaction: true, status_url: :"https://xquik.com/api/v1/guest-wallets/status") + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::GuestWalletCreateResponse} for more details. + # + # Initial guest wallet response containing the one-time key. + # + # @param amount [XTwitterScraper::Models::GuestWalletAmount] Confirmed USD amount for a guest wallet purchase. + # + # @param api_key [String] Paid-read bearer credential returned only by initial creation. Store it as a sec + # + # @param authorization [XTwitterScraper::Models::GuestWalletCreateResponse::Authorization] + # + # @param checkout_url [String] Raw Stripe-hosted checkout URL for user interaction. + # + # @param credits [String] Credits granted after verified payment. + # + # @param expires_at [Time] Time when the pending checkout expires. + # + # @param purchase_id [String] + # + # @param status [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Status] + # + # @param wallet_id [String] + # + # @param account_required [Boolean, false] + # + # @param credential_notice [Symbol, :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available."] + # + # @param instructions [Symbol, :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending."] + # + # @param poll_after_seconds [Integer, 2] Wait at least this long before polling status_url. + # + # @param requires_user_interaction [Boolean, true] + # + # @param status_url [Symbol, :"https://xquik.com/api/v1/guest-wallets/status"] + + # @see XTwitterScraper::Models::GuestWalletCreateResponse#authorization + class Authorization < XTwitterScraper::Internal::Type::BaseModel + # @!attribute header + # + # @return [Symbol, :Authorization] + required :header, const: :Authorization + + # @!attribute scheme + # + # @return [Symbol, :Bearer] + required :scheme, const: :Bearer + + # @!method initialize(header: :Authorization, scheme: :Bearer) + # @param header [Symbol, :Authorization] + # @param scheme [Symbol, :Bearer] + end + + # @see XTwitterScraper::Models::GuestWalletCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING = :creating + PENDING = :pending + PAID = :paid + EXPIRED = :expired + FAILED = :failed + REFUNDED = :refunded + DISPUTED = :disputed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/api_key_list_params.rb b/lib/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rb similarity index 70% rename from lib/x_twitter_scraper/models/api_key_list_params.rb rename to lib/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rb index 4a3b977..447974e 100644 --- a/lib/x_twitter_scraper/models/api_key_list_params.rb +++ b/lib/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rb @@ -2,8 +2,8 @@ module XTwitterScraper module Models - # @see XTwitterScraper::Resources::APIKeys#list - class APIKeyListParams < XTwitterScraper::Internal::Type::BaseModel + # @see XTwitterScraper::Resources::GuestWallets#retrieve_status + class GuestWalletRetrieveStatusParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters diff --git a/lib/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rb b/lib/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rb new file mode 100644 index 0000000..ebf70e2 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rb @@ -0,0 +1,196 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::GuestWallets#retrieve_status + class GuestWalletRetrieveStatusResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute balance + # + # @return [String] + required :balance, String + + # @!attribute latest_purchase + # Latest guest wallet purchase fulfillment state. + # + # @return [XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase, nil] + required :latest_purchase, + -> { XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase }, + nil?: true + + # @!attribute poll_after_seconds + # Polling delay while payment is pending. Null means stop. + # + # @return [Integer, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds, nil] + required :poll_after_seconds, + enum: -> { XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds }, + nil?: true + + # @!attribute scope + # + # @return [Symbol, :paid_reads] + required :scope, const: :paid_reads + + # @!attribute status + # Combined wallet and pending-checkout state. A pending top-up can coexist with + # usable true. Terminal expired or failed states require a new guest wallet. + # + # @return [Symbol, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status } + + # @!attribute top_up + # Top-up action when usable and no checkout is pending. + # + # @return [XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp, nil] + required :top_up, -> { XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp }, nil?: true + + # @!attribute usable + # Authoritative paid-read readiness. Use instead of status. + # + # @return [Boolean] + required :usable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!method initialize(balance:, latest_purchase:, poll_after_seconds:, status:, top_up:, usable:, wallet_id:, scope: :paid_reads) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::GuestWalletRetrieveStatusResponse} for more details. + # + # Current balance, usability, and latest guest purchase state. + # + # @param balance [String] + # + # @param latest_purchase [XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase, nil] Latest guest wallet purchase fulfillment state. + # + # @param poll_after_seconds [Integer, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds, nil] Polling delay while payment is pending. Null means stop. + # + # @param status [Symbol, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status] Combined wallet and pending-checkout state. A pending top-up can coexist with us + # + # @param top_up [XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp, nil] Top-up action when usable and no checkout is pending. + # + # @param usable [Boolean] Authoritative paid-read readiness. Use instead of status. + # + # @param wallet_id [String] + # + # @param scope [Symbol, :paid_reads] + + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusResponse#latest_purchase + class LatestPurchase < XTwitterScraper::Internal::Type::BaseModel + # @!attribute amount + # Confirmed USD amount for a guest wallet purchase. + # + # @return [XTwitterScraper::Models::GuestWalletAmount] + required :amount, -> { XTwitterScraper::GuestWalletAmount } + + # @!attribute checkout_url + # Present only while the purchase is pending. + # + # @return [String, nil] + required :checkout_url, String, nil?: true + + # @!attribute credits + # + # @return [String] + required :credits, String + + # @!attribute expires_at + # + # @return [Time] + required :expires_at, Time + + # @!attribute purchase_id + # + # @return [String] + required :purchase_id, String + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status] + required :status, + enum: -> { XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status } + + # @!method initialize(amount:, checkout_url:, credits:, expires_at:, purchase_id:, status:) + # Latest guest wallet purchase fulfillment state. + # + # @param amount [XTwitterScraper::Models::GuestWalletAmount] Confirmed USD amount for a guest wallet purchase. + # + # @param checkout_url [String, nil] Present only while the purchase is pending. + # + # @param credits [String] + # + # @param expires_at [Time] + # + # @param purchase_id [String] + # + # @param status [Symbol, XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status] + + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING = :creating + PENDING = :pending + PAID = :paid + EXPIRED = :expired + FAILED = :failed + REFUNDED = :refunded + DISPUTED = :disputed + + # @!method self.values + # @return [Array] + end + end + + # Polling delay while payment is pending. Null means stop. + # + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusResponse#poll_after_seconds + module PollAfterSeconds + extend XTwitterScraper::Internal::Type::Enum + + POLL_AFTER_SECONDS_2 = 2 + + # @!method self.values + # @return [Array] + end + + # Combined wallet and pending-checkout state. A pending top-up can coexist with + # usable true. Terminal expired or failed states require a new guest wallet. + # + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACTIVE = :active + PENDING = :pending + EXPIRED = :expired + FAILED = :failed + FROZEN = :frozen + CLOSED = :closed + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusResponse#top_up + class TopUp < XTwitterScraper::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, :POST] + required :method_, const: :POST, api_name: :method + + # @!attribute path + # + # @return [Symbol, :"/api/v1/guest-wallets/topups"] + required :path, const: :"/api/v1/guest-wallets/topups" + + # @!method initialize(method_: :POST, path: :"/api/v1/guest-wallets/topups") + # Top-up action when usable and no checkout is pending. + # + # @param method_ [Symbol, :POST] + # @param path [Symbol, :"/api/v1/guest-wallets/topups"] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb b/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb new file mode 100644 index 0000000..9479302 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::GuestWallets#topup + class GuestWalletTopupParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute amount_minor + # Confirmed USD amount in cents. + # + # @return [Integer] + required :amount_minor, Integer + + # @!attribute currency + # + # @return [Symbol, :usd] + required :currency, const: :usd + + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) + # @param amount_minor [Integer] Confirmed USD amount in cents. + # + # @param idempotency_key [String] + # + # @param currency [Symbol, :usd] + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb b/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb new file mode 100644 index 0000000..b368469 --- /dev/null +++ b/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::GuestWallets#topup + class GuestWalletTopupResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute account_required + # + # @return [Boolean, false] + required :account_required, const: false + + # @!attribute amount + # Confirmed USD amount for a guest wallet purchase. + # + # @return [XTwitterScraper::Models::GuestWalletAmount] + required :amount, -> { XTwitterScraper::GuestWalletAmount } + + # @!attribute checkout_url + # Raw Stripe-hosted checkout URL for user interaction. + # + # @return [String] + required :checkout_url, String + + # @!attribute credits + # Credits granted after verified payment. + # + # @return [String] + required :credits, String + + # @!attribute expires_at + # Time when the pending checkout expires. + # + # @return [Time] + required :expires_at, Time + + # @!attribute instructions + # + # @return [Symbol, :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending."] + required :instructions, + const: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending." + + # @!attribute poll_after_seconds + # Wait at least this long before polling status_url. + # + # @return [Integer, 2] + required :poll_after_seconds, const: 2 + + # @!attribute purchase_id + # + # @return [String] + required :purchase_id, String + + # @!attribute requires_user_interaction + # + # @return [Boolean, true] + required :requires_user_interaction, const: true + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::GuestWalletTopupResponse::Status } + + # @!attribute status_url + # + # @return [Symbol, :"https://xquik.com/api/v1/guest-wallets/status"] + required :status_url, const: :"https://xquik.com/api/v1/guest-wallets/status" + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!attribute api_key + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + # + # @return [String, nil] + optional :api_key, String + + # @!attribute authorization + # + # @return [XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, nil] + optional :authorization, -> { XTwitterScraper::Models::GuestWalletTopupResponse::Authorization } + + # @!attribute credential_notice + # + # @return [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice, nil] + optional :credential_notice, + enum: -> { XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice } + + # @!method initialize(amount:, checkout_url:, credits:, expires_at:, purchase_id:, status:, wallet_id:, api_key: nil, authorization: nil, credential_notice: nil, account_required: false, instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", poll_after_seconds: 2, requires_user_interaction: true, status_url: :"https://xquik.com/api/v1/guest-wallets/status") + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::GuestWalletTopupResponse} for more details. + # + # Pending Stripe checkout and guest wallet purchase details. + # + # @param amount [XTwitterScraper::Models::GuestWalletAmount] Confirmed USD amount for a guest wallet purchase. + # + # @param checkout_url [String] Raw Stripe-hosted checkout URL for user interaction. + # + # @param credits [String] Credits granted after verified payment. + # + # @param expires_at [Time] Time when the pending checkout expires. + # + # @param purchase_id [String] + # + # @param status [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Status] + # + # @param wallet_id [String] + # + # @param api_key [String] Paid-read bearer credential returned only by initial creation. Store it as a sec + # + # @param authorization [XTwitterScraper::Models::GuestWalletTopupResponse::Authorization] + # + # @param credential_notice [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice] + # + # @param account_required [Boolean, false] + # + # @param instructions [Symbol, :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending."] + # + # @param poll_after_seconds [Integer, 2] Wait at least this long before polling status_url. + # + # @param requires_user_interaction [Boolean, true] + # + # @param status_url [Symbol, :"https://xquik.com/api/v1/guest-wallets/status"] + + # @see XTwitterScraper::Models::GuestWalletTopupResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING = :creating + PENDING = :pending + PAID = :paid + EXPIRED = :expired + FAILED = :failed + REFUNDED = :refunded + DISPUTED = :disputed + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::GuestWalletTopupResponse#authorization + class Authorization < XTwitterScraper::Internal::Type::BaseModel + # @!attribute header + # + # @return [Symbol, :Authorization] + required :header, const: :Authorization + + # @!attribute scheme + # + # @return [Symbol, :Bearer] + required :scheme, const: :Bearer + + # @!method initialize(header: :Authorization, scheme: :Bearer) + # @param header [Symbol, :Authorization] + # @param scheme [Symbol, :Bearer] + end + + # @see XTwitterScraper::Models::GuestWalletTopupResponse#credential_notice + module CredentialNotice + extend XTwitterScraper::Internal::Type::Enum + + STORE_API_KEY_AND_THE_IDEMPOTENCY_KEY_SECURELY_BEFORE_SHARING_CHECKOUT_URL_NO_EMAIL_RECOVERY_IS_AVAILABLE = + :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available." + + # @!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 6bb73e8..8930ab5 100644 --- a/lib/x_twitter_scraper/models/monitor.rb +++ b/lib/x_twitter_scraper/models/monitor.rb @@ -27,6 +27,12 @@ class Monitor < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean] required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + # @!attribute next_billing_at + # Next hourly credit charge time for this account monitor. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + # @!attribute username # # @return [String] @@ -37,7 +43,7 @@ class Monitor < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_user_id, String, api_name: :xUserId - # @!method initialize(id:, created_at:, event_types:, is_active:, username:, x_user_id:) + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, username:, x_user_id:) # Account monitor that tracks activity for a given X user. # # @param id [String] @@ -48,6 +54,8 @@ class Monitor < XTwitterScraper::Internal::Type::BaseModel # # @param is_active [Boolean] # + # @param next_billing_at [Time] Next hourly credit charge time for this account monitor. + # # @param username [String] # # @param x_user_id [String] diff --git a/lib/x_twitter_scraper/models/monitor_create_response.rb b/lib/x_twitter_scraper/models/monitor_create_response.rb index 0545213..3beba4a 100644 --- a/lib/x_twitter_scraper/models/monitor_create_response.rb +++ b/lib/x_twitter_scraper/models/monitor_create_response.rb @@ -22,6 +22,17 @@ class MonitorCreateResponse < XTwitterScraper::Internal::Type::BaseModel -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes + # @!attribute is_active + # + # @return [Boolean] + required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!attribute next_billing_at + # Next hourly credit charge time. New active monitors are due immediately. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + # @!attribute username # # @return [String] @@ -32,13 +43,17 @@ class MonitorCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_user_id, String, api_name: :xUserId - # @!method initialize(id:, created_at:, event_types:, username:, x_user_id:) + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, username:, x_user_id:) # @param id [String] # # @param created_at [Time] # # @param event_types [Array] Array of event types to subscribe to. # + # @param is_active [Boolean] + # + # @param next_billing_at [Time] Next hourly credit charge time. New active monitors are due immediately. + # # @param username [String] # # @param x_user_id [String] diff --git a/lib/x_twitter_scraper/models/monitors/keyword_create_params.rb b/lib/x_twitter_scraper/models/monitors/keyword_create_params.rb new file mode 100644 index 0000000..04f0254 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_create_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#create + class KeywordCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute event_types + # Array of event types to subscribe to. + # + # @return [Array] + required :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute query + # X search query to monitor. Whitespace is normalized. + # + # @return [String] + required :query, String + + # @!method initialize(event_types:, query:, request_options: {}) + # @param event_types [Array] Array of event types to subscribe to. + # + # @param query [String] X search query to monitor. Whitespace is normalized. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_create_response.rb b/lib/x_twitter_scraper/models/monitors/keyword_create_response.rb new file mode 100644 index 0000000..b5d4b71 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_create_response.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#create + class KeywordCreateResponse < 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 + # Array of event types to subscribe to. + # + # @return [Array] + required :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute is_active + # + # @return [Boolean] + required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!attribute next_billing_at + # Next hourly credit charge time for this keyword query monitor. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + + # @!attribute query + # + # @return [String] + required :query, String + + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, query:) + # Keyword monitor that tracks matching public X activity. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param is_active [Boolean] + # + # @param next_billing_at [Time] Next hourly credit charge time for this keyword query monitor. + # + # @param query [String] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_deactivate_params.rb b/lib/x_twitter_scraper/models/monitors/keyword_deactivate_params.rb new file mode 100644 index 0000000..fe5a064 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_deactivate_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#deactivate + class KeywordDeactivateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_deactivate_response.rb b/lib/x_twitter_scraper/models/monitors/keyword_deactivate_response.rb new file mode 100644 index 0000000..b4baac1 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_deactivate_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#deactivate + class KeywordDeactivateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute success + # + # @return [Boolean, true] + required :success, const: true + + # @!method initialize(success: true) + # @param success [Boolean, true] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_list_params.rb b/lib/x_twitter_scraper/models/monitors/keyword_list_params.rb new file mode 100644 index 0000000..294f8c6 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_list_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#list + class KeywordListParams < 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/monitors/keyword_list_response.rb b/lib/x_twitter_scraper/models/monitors/keyword_list_response.rb new file mode 100644 index 0000000..23d18cb --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_list_response.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#list + class KeywordListResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute monitors + # + # @return [Array] + required :monitors, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor] } + + # @!attribute total + # + # @return [Integer] + required :total, Integer + + # @!method initialize(monitors:, total:) + # @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 + # Array of event types to subscribe to. + # + # @return [Array] + required :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute is_active + # + # @return [Boolean] + required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!attribute next_billing_at + # Next hourly credit charge time for this keyword query monitor. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + + # @!attribute query + # + # @return [String] + required :query, String + + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, query:) + # Keyword monitor that tracks matching public X activity. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param is_active [Boolean] + # + # @param next_billing_at [Time] Next hourly credit charge time for this keyword query monitor. + # + # @param query [String] + end + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_retrieve_params.rb b/lib/x_twitter_scraper/models/monitors/keyword_retrieve_params.rb new file mode 100644 index 0000000..3eb65f1 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#retrieve + class KeywordRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_retrieve_response.rb b/lib/x_twitter_scraper/models/monitors/keyword_retrieve_response.rb new file mode 100644 index 0000000..af0585a --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_retrieve_response.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#retrieve + class KeywordRetrieveResponse < 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 + # Array of event types to subscribe to. + # + # @return [Array] + required :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute is_active + # + # @return [Boolean] + required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!attribute next_billing_at + # Next hourly credit charge time for this keyword query monitor. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + + # @!attribute query + # + # @return [String] + required :query, String + + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, query:) + # Keyword monitor that tracks matching public X activity. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param is_active [Boolean] + # + # @param next_billing_at [Time] Next hourly credit charge time for this keyword query monitor. + # + # @param query [String] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_update_params.rb b/lib/x_twitter_scraper/models/monitors/keyword_update_params.rb new file mode 100644 index 0000000..5a3fadc --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_update_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#update + class KeywordUpdateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute event_types + # Array of event types to subscribe to. + # + # @return [Array, nil] + optional :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute is_active + # + # @return [Boolean, nil] + optional :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!method initialize(id:, event_types: nil, is_active: nil, request_options: {}) + # @param id [String] + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param is_active [Boolean] + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/monitors/keyword_update_response.rb b/lib/x_twitter_scraper/models/monitors/keyword_update_response.rb new file mode 100644 index 0000000..9fa55b3 --- /dev/null +++ b/lib/x_twitter_scraper/models/monitors/keyword_update_response.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module Monitors + # @see XTwitterScraper::Resources::Monitors::Keywords#update + class KeywordUpdateResponse < 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 + # Array of event types to subscribe to. + # + # @return [Array] + required :event_types, + -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, + api_name: :eventTypes + + # @!attribute is_active + # + # @return [Boolean] + required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive + + # @!attribute next_billing_at + # Next hourly credit charge time for this keyword query monitor. + # + # @return [Time] + required :next_billing_at, Time, api_name: :nextBillingAt + + # @!attribute query + # + # @return [String] + required :query, String + + # @!method initialize(id:, created_at:, event_types:, is_active:, next_billing_at:, query:) + # Keyword monitor that tracks matching public X activity. + # + # @param id [String] + # + # @param created_at [Time] + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param is_active [Boolean] + # + # @param next_billing_at [Time] Next hourly credit charge time for this keyword query monitor. + # + # @param query [String] + 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 d4551ed..004978c 100644 --- a/lib/x_twitter_scraper/models/paginated_tweets.rb +++ b/lib/x_twitter_scraper/models/paginated_tweets.rb @@ -19,7 +19,11 @@ class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet] } # @!method initialize(has_next_page:, next_cursor:, tweets:) - # Paginated list of tweets with cursor-based navigation. + # Paginated tweet results. The item count can be lower than pageSize when the + # source returns fewer tweets, filters remove tweets, or remaining credits cover + # fewer results. Follow next_cursor while has_next_page is true. An empty page can + # still have has_next_page true after filtering. Zero affordable results returns + # 402 insufficient_credits. # # @param has_next_page [Boolean] # @param next_cursor [String] diff --git a/lib/x_twitter_scraper/models/paginated_users.rb b/lib/x_twitter_scraper/models/paginated_users.rb index cab7caa..9dac70f 100644 --- a/lib/x_twitter_scraper/models/paginated_users.rb +++ b/lib/x_twitter_scraper/models/paginated_users.rb @@ -19,7 +19,11 @@ class PaginatedUsers < XTwitterScraper::Internal::Type::BaseModel required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile] } # @!method initialize(has_next_page:, next_cursor:, users:) - # Paginated list of user profiles with cursor-based navigation. + # Paginated user profiles. The item count can be lower than pageSize when the + # source returns fewer profiles or remaining credits cover fewer results. Follow + # next_cursor while has_next_page is true. A relationship can naturally contain + # fewer profiles than requested. Zero affordable results returns 402 + # insufficient_credits. # # @param has_next_page [Boolean] # @param next_cursor [String] diff --git a/lib/x_twitter_scraper/models/radar_item.rb b/lib/x_twitter_scraper/models/radar_item.rb index 71c2832..2a388f0 100644 --- a/lib/x_twitter_scraper/models/radar_item.rb +++ b/lib/x_twitter_scraper/models/radar_item.rb @@ -4,7 +4,7 @@ module XTwitterScraper module Models class RadarItem < XTwitterScraper::Internal::Type::BaseModel # @!attribute id - # Internal numeric identifier (stringified bigint). + # Radar item identifier. # # @return [String] required :id, String @@ -93,7 +93,7 @@ class RadarItem < XTwitterScraper::Internal::Type::BaseModel # Trending topic with score, category, source, region, language, and # source-specific metadata. # - # @param id [String] Internal numeric identifier (stringified bigint). + # @param id [String] Radar item identifier. # # @param category [Symbol, XTwitterScraper::Models::RadarItem::Category] # 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 1b337c2..35d9452 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 @@ -20,7 +20,7 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM optional :category, enum: -> { XTwitterScraper::RadarRetrieveTrendingTopicsParams::Category } # @!attribute hours - # Lookback window in hours (1-168, default 24). + # Lookback window in hours (1-72, default 6). # # @return [Integer, nil] optional :hours, Integer @@ -32,7 +32,7 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM optional :limit, Integer # @!attribute region - # Region filter (us, global, etc.) + # Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. # # @return [String, nil] optional :region, String @@ -52,11 +52,11 @@ class RadarRetrieveTrendingTopicsParams < XTwitterScraper::Internal::Type::BaseM # # @param category [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Category] Filter by category. # - # @param hours [Integer] Lookback window in hours (1-168, default 24). + # @param hours [Integer] Lookback window in hours (1-72, default 6). # # @param limit [Integer] Number of items to return (1-100, default 50). # - # @param region [String] Region filter (us, global, etc.) + # @param region [String] Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. # # @param source [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Source] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t # diff --git a/lib/x_twitter_scraper/models/search_tweet.rb b/lib/x_twitter_scraper/models/search_tweet.rb index 04fb0ae..88b9a7c 100644 --- a/lib/x_twitter_scraper/models/search_tweet.rb +++ b/lib/x_twitter_scraper/models/search_tweet.rb @@ -8,71 +8,177 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @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 author + # X user profile with bio, follower counts, and verification status. # - # @return [XTwitterScraper::Models::SearchTweet::Author, nil] - optional :author, -> { XTwitterScraper::SearchTweet::Author } + # @return [XTwitterScraper::Models::UserProfile, nil] + optional :author, -> { XTwitterScraper::UserProfile } - # @!attribute bookmark_count + # @!attribute content_disclosure + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. # - # @return [Integer, nil] - optional :bookmark_count, Integer, api_name: :bookmarkCount + # @return [XTwitterScraper::Models::ContentDisclosure, nil] + optional :content_disclosure, -> { XTwitterScraper::ContentDisclosure }, api_name: :contentDisclosure + + # @!attribute conversation_id + # Root tweet ID for the search result conversation + # + # @return [String, nil] + optional :conversation_id, String, api_name: :conversationId # @!attribute created_at # # @return [String, nil] optional :created_at, String, api_name: :createdAt + # @!attribute display_text_range + # Start and end offsets for rendered tweet text + # + # @return [Array, nil] + optional :display_text_range, + XTwitterScraper::Internal::Type::ArrayOf[Integer], + api_name: :displayTextRange + + # @!attribute entities + # Parsed search-result entities including URLs, mentions, hashtags, and media + # markers + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute in_reply_to_id + # Tweet ID being replied to + # + # @return [String, nil] + optional :in_reply_to_id, String, api_name: :inReplyToId + + # @!attribute in_reply_to_user_id + # User ID being replied to + # + # @return [String, nil] + optional :in_reply_to_user_id, String, api_name: :inReplyToUserId + + # @!attribute in_reply_to_username + # Username being replied to + # + # @return [String, nil] + optional :in_reply_to_username, String, api_name: :inReplyToUsername + + # @!attribute is_limited_reply + # Whether the tweet has limited reply permissions + # + # @return [Boolean, nil] + optional :is_limited_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isLimitedReply + # @!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 + # @!attribute is_quote_status + # True when this search result quotes another tweet # - # @return [Integer, nil] - optional :like_count, Integer, api_name: :likeCount + # @return [Boolean, nil] + optional :is_quote_status, XTwitterScraper::Internal::Type::Boolean, api_name: :isQuoteStatus - # @!attribute quote_count + # @!attribute is_reply + # True when this search result is a reply # - # @return [Integer, nil] - optional :quote_count, Integer, api_name: :quoteCount + # @return [Boolean, nil] + optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply - # @!attribute reply_count + # @!attribute lang + # Tweet language code # - # @return [Integer, nil] - optional :reply_count, Integer, api_name: :replyCount + # @return [String, nil] + optional :lang, String - # @!attribute retweet_count + # @!attribute media + # Search-result media attachments, omitted when no media is present # - # @return [Integer, nil] - optional :retweet_count, Integer, api_name: :retweetCount + # @return [Array, nil] + optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } - # @!attribute view_count + # @!attribute quoted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. # - # @return [Integer, nil] - optional :view_count, Integer, api_name: :viewCount + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :quoted_tweet, -> { XTwitterScraper::EmbeddedTweet } - # @!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. + # @!attribute retweeted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. # - # @param id [String] + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :retweeted_tweet, -> { XTwitterScraper::EmbeddedTweet } + + # @!attribute source + # Client application used to post the tweet # - # @param text [String] + # @return [String, nil] + optional :source, String + + # @!attribute type # - # @param author [XTwitterScraper::Models::SearchTweet::Author] + # @return [String, nil] + optional :type, String + + # @!attribute url + # Tweet permalink URL # - # @param bookmark_count [Integer] + # @return [String, nil] + optional :url, String + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::SearchTweet} for more details. # - # @param created_at [String] + # Tweet returned from search results with inline author info. A zero metric can + # mean X did not report the count. # - # @param is_note_tweet [Boolean] True for Note Tweets (long-form content, up to 25,000 characters) + # @param id [String] + # + # @param bookmark_count [Integer] # # @param like_count [Integer] # @@ -82,36 +188,49 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param retweet_count [Integer] # + # @param text [String] + # # @param view_count [Integer] - - # @see XTwitterScraper::Models::SearchTweet#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 + # + # @param author [XTwitterScraper::Models::UserProfile] X user profile with bio, follower counts, and verification status. + # + # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh + # + # @param conversation_id [String] Root tweet ID for the search result conversation + # + # @param created_at [String] + # + # @param display_text_range [Array] Start and end offsets for rendered tweet text + # + # @param entities [Hash{Symbol=>Object}] Parsed search-result entities including URLs, mentions, hashtags, and media mark + # + # @param in_reply_to_id [String] Tweet ID being replied to + # + # @param in_reply_to_user_id [String] User ID being replied to + # + # @param in_reply_to_username [String] Username being replied to + # + # @param is_limited_reply [Boolean] Whether the tweet has limited reply permissions + # + # @param is_note_tweet [Boolean] True for Note Tweets (long-form content, up to 25,000 characters) + # + # @param is_quote_status [Boolean] True when this search result quotes another tweet + # + # @param is_reply [Boolean] True when this search result is a reply + # + # @param lang [String] Tweet language code + # + # @param media [Array] Search-result media attachments, omitted when no media is present + # + # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen + # + # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen + # + # @param source [String] Client application used to post the tweet + # + # @param type [String] + # + # @param url [String] Tweet permalink URL end end end diff --git a/lib/x_twitter_scraper/models/subscribe_create_params.rb b/lib/x_twitter_scraper/models/subscribe_create_params.rb index e0011aa..aa730b9 100644 --- a/lib/x_twitter_scraper/models/subscribe_create_params.rb +++ b/lib/x_twitter_scraper/models/subscribe_create_params.rb @@ -7,8 +7,28 @@ class SubscribeCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - # @!method initialize(request_options: {}) + # @!attribute tier + # Subscription tier to pre-select. + # + # @return [Symbol, XTwitterScraper::Models::SubscribeCreateParams::Tier, nil] + optional :tier, enum: -> { XTwitterScraper::SubscribeCreateParams::Tier } + + # @!method initialize(tier: nil, request_options: {}) + # @param tier [Symbol, XTwitterScraper::Models::SubscribeCreateParams::Tier] Subscription tier to pre-select. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Subscription tier to pre-select. + module Tier + extend XTwitterScraper::Internal::Type::Enum + + STARTER = :starter + PRO = :pro + BUSINESS = :business + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/subscribe_create_response.rb b/lib/x_twitter_scraper/models/subscribe_create_response.rb index f7b2d9b..4b1ae60 100644 --- a/lib/x_twitter_scraper/models/subscribe_create_response.rb +++ b/lib/x_twitter_scraper/models/subscribe_create_response.rb @@ -4,25 +4,25 @@ module XTwitterScraper module Models # @see XTwitterScraper::Resources::Subscribe#create class SubscribeCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute url + # @!attribute message # # @return [String] - required :url, String + required :message, String - # @!attribute message + # @!attribute status # - # @return [String, nil] - optional :message, String + # @return [Symbol, XTwitterScraper::Models::SubscribeCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::SubscribeCreateResponse::Status } - # @!attribute status + # @!attribute url # - # @return [Symbol, XTwitterScraper::Models::SubscribeCreateResponse::Status, nil] - optional :status, enum: -> { XTwitterScraper::Models::SubscribeCreateResponse::Status } + # @return [String] + required :url, String - # @!method initialize(url:, message: nil, status: nil) - # @param url [String] + # @!method initialize(message:, status:, url:) # @param message [String] # @param status [Symbol, XTwitterScraper::Models::SubscribeCreateResponse::Status] + # @param url [String] # @see XTwitterScraper::Models::SubscribeCreateResponse#status module Status diff --git a/lib/x_twitter_scraper/models/tweet_media.rb b/lib/x_twitter_scraper/models/tweet_media.rb new file mode 100644 index 0000000..8e32643 --- /dev/null +++ b/lib/x_twitter_scraper/models/tweet_media.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + class TweetMedia < XTwitterScraper::Internal::Type::BaseModel + # @!attribute media_url + # Media preview URL + # + # @return [String] + required :media_url, String, api_name: :mediaUrl + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::TweetMedia::Type] + required :type, enum: -> { XTwitterScraper::TweetMedia::Type } + + # @!attribute url + # X media link from the tweet + # + # @return [String] + required :url, String + + # @!attribute video_variants + # Available video encodings, ordered as returned + # + # @return [Array, nil] + optional :video_variants, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia::VideoVariant] }, + api_name: :videoVariants + + # @!method initialize(media_url:, type:, url:, video_variants: nil) + # Normalized media attached to a tweet. + # + # @param media_url [String] Media preview URL + # + # @param type [Symbol, XTwitterScraper::Models::TweetMedia::Type] + # + # @param url [String] X media link from the tweet + # + # @param video_variants [Array] Available video encodings, ordered as returned + + # @see XTwitterScraper::Models::TweetMedia#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + PHOTO = :photo + VIDEO = :video + ANIMATED_GIF = :animated_gif + + # @!method self.values + # @return [Array] + end + + class VideoVariant < XTwitterScraper::Internal::Type::BaseModel + # @!attribute content_type + # + # @return [String] + required :content_type, String, api_name: :contentType + + # @!attribute url + # + # @return [String] + required :url, String + + # @!attribute bitrate + # + # @return [Integer, nil] + optional :bitrate, Integer + + # @!method initialize(content_type:, url:, bitrate: nil) + # @param content_type [String] + # @param url [String] + # @param bitrate [Integer] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/user_profile.rb b/lib/x_twitter_scraper/models/user_profile.rb index 1e5ec2d..244fe9c 100644 --- a/lib/x_twitter_scraper/models/user_profile.rb +++ b/lib/x_twitter_scraper/models/user_profile.rb @@ -18,6 +18,27 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :username, String + # @!attribute automated_by + # + # @return [String, nil] + optional :automated_by, String, api_name: :automatedBy + + # @!attribute can_dm + # + # @return [Boolean, nil] + optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm + + # @!attribute community_role + # Community role when returned by community member reads + # + # @return [String, nil] + optional :community_role, String, api_name: :communityRole + + # @!attribute cover_picture + # + # @return [String, nil] + optional :cover_picture, String, api_name: :coverPicture + # @!attribute created_at # # @return [String, nil] @@ -28,6 +49,11 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :description, String + # @!attribute favourites_count + # + # @return [Integer, nil] + optional :favourites_count, Integer, api_name: :favouritesCount + # @!attribute followers # # @return [Integer, nil] @@ -38,40 +64,195 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :following, Integer + # @!attribute has_custom_timelines + # + # @return [Boolean, nil] + optional :has_custom_timelines, XTwitterScraper::Internal::Type::Boolean, api_name: :hasCustomTimelines + + # @!attribute is_automated + # + # @return [Boolean, nil] + optional :is_automated, XTwitterScraper::Internal::Type::Boolean, api_name: :isAutomated + + # @!attribute is_blue_verified + # Whether X shows a blue verification badge + # + # @return [Boolean, nil] + optional :is_blue_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isBlueVerified + + # @!attribute is_translator + # + # @return [Boolean, nil] + optional :is_translator, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslator + + # @!attribute is_verified + # Whether X marks the profile as verified + # + # @return [Boolean, nil] + optional :is_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isVerified + # @!attribute location # # @return [String, nil] optional :location, String + # @!attribute media_count + # + # @return [Integer, nil] + optional :media_count, Integer, api_name: :mediaCount + + # @!attribute pinned_tweet_ids + # + # @return [Array, nil] + optional :pinned_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :pinnedTweetIds + + # @!attribute possibly_sensitive + # + # @return [Boolean, nil] + optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive + + # @!attribute profile_bio + # Structured profile bio with entity annotations + # + # @return [Hash{Symbol=>Object}, nil] + optional :profile_bio, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute profile_banner_url + # Original X profile banner field when available + # + # @return [String, nil] + optional :profile_banner_url, String, api_name: :profileBannerUrl + # @!attribute profile_picture # # @return [String, nil] optional :profile_picture, String, api_name: :profilePicture + # @!attribute protected + # Whether the profile protects its posts + # + # @return [Boolean, nil] + optional :protected, XTwitterScraper::Internal::Type::Boolean + # @!attribute statuses_count # # @return [Integer, nil] optional :statuses_count, Integer, api_name: :statusesCount + # @!attribute unavailable + # + # @return [Boolean, nil] + optional :unavailable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute unavailable_reason + # + # @return [String, nil] + optional :unavailable_reason, String, api_name: :unavailableReason + + # @!attribute url + # + # @return [String, nil] + optional :url, String + # @!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) + # @!attribute verified_type + # + # @return [String, nil] + optional :verified_type, String, api_name: :verifiedType + + # @!attribute viewer_followed_by + # Whether this profile follows the authenticated viewer + # + # @return [Boolean, nil] + optional :viewer_followed_by, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowedBy + + # @!attribute viewer_following + # Whether the authenticated viewer follows this profile + # + # @return [Boolean, nil] + optional :viewer_following, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowing + + # @!attribute withheld_in_countries + # + # @return [Array, nil] + optional :withheld_in_countries, + XTwitterScraper::Internal::Type::ArrayOf[String], + api_name: :withheldInCountries + + # @!method initialize(id:, name:, username:, automated_by: nil, can_dm: nil, community_role: nil, cover_picture: nil, created_at: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, is_automated: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, viewer_followed_by: nil, viewer_following: nil, withheld_in_countries: nil) # X user profile with bio, follower counts, and verification status. # # @param id [String] + # # @param name [String] + # # @param username [String] + # + # @param automated_by [String] + # + # @param can_dm [Boolean] + # + # @param community_role [String] Community role when returned by community member reads + # + # @param cover_picture [String] + # # @param created_at [String] + # # @param description [String] + # + # @param favourites_count [Integer] + # # @param followers [Integer] + # # @param following [Integer] + # + # @param has_custom_timelines [Boolean] + # + # @param is_automated [Boolean] + # + # @param is_blue_verified [Boolean] Whether X shows a blue verification badge + # + # @param is_translator [Boolean] + # + # @param is_verified [Boolean] Whether X marks the profile as verified + # # @param location [String] + # + # @param media_count [Integer] + # + # @param pinned_tweet_ids [Array] + # + # @param possibly_sensitive [Boolean] + # + # @param profile_bio [Hash{Symbol=>Object}] Structured profile bio with entity annotations + # + # @param profile_banner_url [String] Original X profile banner field when available + # # @param profile_picture [String] + # + # @param protected [Boolean] Whether the profile protects its posts + # # @param statuses_count [Integer] + # + # @param unavailable [Boolean] + # + # @param unavailable_reason [String] + # + # @param url [String] + # # @param verified [Boolean] + # + # @param verified_type [String] + # + # @param viewer_followed_by [Boolean] Whether this profile follows the authenticated viewer + # + # @param viewer_following [Boolean] Whether the authenticated viewer follows this profile + # + # @param withheld_in_countries [Array] end end end diff --git a/lib/x_twitter_scraper/models/webhook.rb b/lib/x_twitter_scraper/models/webhook.rb index b56312a..ae4b9ac 100644 --- a/lib/x_twitter_scraper/models/webhook.rb +++ b/lib/x_twitter_scraper/models/webhook.rb @@ -9,11 +9,26 @@ class Webhook < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute consecutive_failures + # Consecutive failed delivery attempts since the last success. + # + # @return [Integer] + required :consecutive_failures, Integer, api_name: :consecutiveFailures + # @!attribute created_at # # @return [Time] required :created_at, Time, api_name: :createdAt + # @!attribute delivery_status + # Endpoint delivery state. needs_attention means delivery stopped after repeated + # failures. + # + # @return [Symbol, XTwitterScraper::Models::Webhook::DeliveryStatus] + required :delivery_status, + enum: -> { XTwitterScraper::Webhook::DeliveryStatus }, + api_name: :deliveryStatus + # @!attribute event_types # Array of event types to subscribe to. # @@ -22,6 +37,12 @@ class Webhook < XTwitterScraper::Internal::Type::BaseModel -> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] }, api_name: :eventTypes + # @!attribute failure_hard_cap + # Consecutive delivery failures that pause the endpoint. + # + # @return [Integer] + required :failure_hard_cap, Integer, api_name: :failureHardCap + # @!attribute is_active # # @return [Boolean] @@ -32,18 +53,42 @@ class Webhook < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :url, String - # @!method initialize(id:, created_at:, event_types:, is_active:, url:) + # @!method initialize(id:, consecutive_failures:, created_at:, delivery_status:, event_types:, failure_hard_cap:, is_active:, url:) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::Webhook} for more details. + # # Webhook endpoint registered to receive event deliveries. # # @param id [String] # + # @param consecutive_failures [Integer] Consecutive failed delivery attempts since the last success. + # # @param created_at [Time] # + # @param delivery_status [Symbol, XTwitterScraper::Models::Webhook::DeliveryStatus] Endpoint delivery state. needs_attention means delivery stopped after repeated f + # # @param event_types [Array] Array of event types to subscribe to. # + # @param failure_hard_cap [Integer] Consecutive delivery failures that pause the endpoint. + # # @param is_active [Boolean] # # @param url [String] + + # Endpoint delivery state. needs_attention means delivery stopped after repeated + # failures. + # + # @see XTwitterScraper::Models::Webhook#delivery_status + module DeliveryStatus + extend XTwitterScraper::Internal::Type::Enum + + ACTIVE = :active + PAUSED = :paused + NEEDS_ATTENTION = :needs_attention + + # @!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 b867425..6a87994 100644 --- a/lib/x_twitter_scraper/models/webhook_create_response.rb +++ b/lib/x_twitter_scraper/models/webhook_create_response.rb @@ -23,6 +23,7 @@ class WebhookCreateResponse < XTwitterScraper::Internal::Type::BaseModel api_name: :eventTypes # @!attribute secret + # Plaintext HMAC signing secret returned only at creation. # # @return [String] required :secret, String @@ -39,7 +40,7 @@ class WebhookCreateResponse < XTwitterScraper::Internal::Type::BaseModel # # @param event_types [Array] Array of event types to subscribe to. # - # @param secret [String] + # @param secret [String] Plaintext HMAC signing secret returned only at creation. # # @param url [String] end diff --git a/lib/x_twitter_scraper/models/api_key_revoke_params.rb b/lib/x_twitter_scraper/models/webhook_resume_params.rb similarity index 78% rename from lib/x_twitter_scraper/models/api_key_revoke_params.rb rename to lib/x_twitter_scraper/models/webhook_resume_params.rb index cb476f5..5e98495 100644 --- a/lib/x_twitter_scraper/models/api_key_revoke_params.rb +++ b/lib/x_twitter_scraper/models/webhook_resume_params.rb @@ -2,8 +2,8 @@ module XTwitterScraper module Models - # @see XTwitterScraper::Resources::APIKeys#revoke - class APIKeyRevokeParams < XTwitterScraper::Internal::Type::BaseModel + # @see XTwitterScraper::Resources::Webhooks#resume + class WebhookResumeParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters diff --git a/lib/x_twitter_scraper/models/webhook_resume_response.rb b/lib/x_twitter_scraper/models/webhook_resume_response.rb new file mode 100644 index 0000000..912b018 --- /dev/null +++ b/lib/x_twitter_scraper/models/webhook_resume_response.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + # @see XTwitterScraper::Resources::Webhooks#resume + class WebhookResumeResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute status_code + # + # @return [Integer] + required :status_code, Integer, api_name: :statusCode + + # @!attribute success + # + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute webhook + # Webhook endpoint registered to receive event deliveries. + # + # @return [XTwitterScraper::Models::Webhook] + required :webhook, -> { XTwitterScraper::Webhook } + + # @!method initialize(status_code:, success:, webhook:) + # @param status_code [Integer] + # + # @param success [Boolean] + # + # @param webhook [XTwitterScraper::Models::Webhook] Webhook endpoint registered to receive event deliveries. + end + end +end diff --git a/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rb b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rb new file mode 100644 index 0000000..62c1dea --- /dev/null +++ b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::AccountConnectionChallenges#submit + class AccountConnectionChallengeSubmitParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute email_code + # Code sent to the account email. + # + # @return [String] + required :email_code, String + + # @!method initialize(id:, email_code:, request_options: {}) + # @param id [String] + # + # @param email_code [String] Code sent to the account email. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb new file mode 100644 index 0000000..e28c1bd --- /dev/null +++ b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::AccountConnectionChallenges#submit + class AccountConnectionChallengeSubmitResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute health + # + # @return [Symbol, XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health] + required :health, + enum: -> { XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health } + + # @!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:, health:, status:, x_user_id:, x_username:) + # Sanitized X account summary returned by connect and reauth. + # + # @param id [String] + # @param created_at [Time] + # @param health [Symbol, XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health] + # @param status [String] + # @param x_user_id [String] + # @param x_username [String] + + # @see XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/account_create_params.rb b/lib/x_twitter_scraper/models/x/account_create_params.rb index 32ce013..39d2780 100644 --- a/lib/x_twitter_scraper/models/x/account_create_params.rb +++ b/lib/x_twitter_scraper/models/x/account_create_params.rb @@ -26,27 +26,19 @@ class AccountCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :username, String - # @!attribute proxy_country - # Proxy country code - # - # @return [String, nil] - optional :proxy_country, String - # @!attribute totp_secret # TOTP secret for 2FA # # @return [String, nil] optional :totp_secret, String - # @!method initialize(email:, password:, username:, proxy_country: nil, totp_secret: nil, request_options: {}) + # @!method initialize(email:, password:, username:, totp_secret: nil, request_options: {}) # @param email [String] Account email # # @param password [String] Account password # # @param username [String] X username # - # @param proxy_country [String] Proxy country code - # # @param totp_secret [String] TOTP secret for 2FA # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/x_twitter_scraper/models/x/account_create_response.rb b/lib/x_twitter_scraper/models/x/account_create_response.rb index 783e6be..d19738f 100644 --- a/lib/x_twitter_scraper/models/x/account_create_response.rb +++ b/lib/x_twitter_scraper/models/x/account_create_response.rb @@ -35,37 +35,15 @@ class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!attribute login_country - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - # - # @return [String, nil] - optional :login_country, String, api_name: :loginCountry - - # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, login_country: nil) - # Some parameter documentations has been truncated, see - # {XTwitterScraper::Models::X::AccountCreateResponse} for more details. - # - # Sanitized X account summary returned by connect and reauth. Includes an optional - # `loginCountry` field surfaced only when the declared proxy region had no Driver - # capacity and the login fell back to a single US consumer device for this - # one-time action. Future activity continues to use the selected `proxy_country`; - # the field is omitted on normal logins. + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # Sanitized X account summary returned by connect and reauth. # # @param id [String] - # # @param created_at [Time] - # # @param health [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::Health] - # # @param status [String] - # # @param x_user_id [String] - # # @param x_username [String] - # - # @param login_country [String] ISO-3166-1 alpha-2 country code of the Driver consumer device used for this logi # @see XTwitterScraper::Models::X::AccountCreateResponse#health module Health 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 1db8565..578bb9b 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_params.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_params.rb @@ -25,27 +25,19 @@ class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :email, String - # @!attribute proxy_country - # Two-letter country code for login proxy region - # - # @return [String, nil] - optional :proxy_country, String - # @!attribute totp_secret # TOTP secret for 2FA re-authentication # # @return [String, nil] optional :totp_secret, String - # @!method initialize(id:, password:, email: nil, proxy_country: nil, totp_secret: nil, request_options: {}) + # @!method initialize(id:, password:, email: nil, totp_secret: nil, request_options: {}) # @param id [String] # # @param password [String] Updated account password # # @param email [String] Email for the X account (updates stored email) # - # @param proxy_country [String] Two-letter country code for login proxy region - # # @param totp_secret [String] TOTP secret for 2FA re-authentication # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/x_twitter_scraper/models/x/account_reauth_response.rb b/lib/x_twitter_scraper/models/x/account_reauth_response.rb index e4b9f8d..1e310f2 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_response.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_response.rb @@ -35,37 +35,15 @@ class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!attribute login_country - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - # - # @return [String, nil] - optional :login_country, String, api_name: :loginCountry - - # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, login_country: nil) - # Some parameter documentations has been truncated, see - # {XTwitterScraper::Models::X::AccountReauthResponse} for more details. - # - # Sanitized X account summary returned by connect and reauth. Includes an optional - # `loginCountry` field surfaced only when the declared proxy region had no Driver - # capacity and the login fell back to a single US consumer device for this - # one-time action. Future activity continues to use the selected `proxy_country`; - # the field is omitted on normal logins. + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # Sanitized X account summary returned by connect and reauth. # # @param id [String] - # # @param created_at [Time] - # # @param health [Symbol, XTwitterScraper::Models::X::AccountReauthResponse::Health] - # # @param status [String] - # # @param x_user_id [String] - # # @param x_username [String] - # - # @param login_country [String] ISO-3166-1 alpha-2 country code of the Driver consumer device used for this logi # @see XTwitterScraper::Models::X::AccountReauthResponse#health module Health diff --git a/lib/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rb b/lib/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rb index 53627ff..c5f6016 100644 --- a/lib/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rb +++ b/lib/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rb @@ -12,19 +12,23 @@ class BookmarkRetrieveFoldersResponse < XTwitterScraper::Internal::Type::BaseMod -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::BookmarkRetrieveFoldersResponse::Folder] } # @!attribute has_next_page + # Always false for the current bookmark folder route # # @return [Boolean] required :has_next_page, XTwitterScraper::Internal::Type::Boolean # @!attribute next_cursor + # Always empty for the current bookmark folder route # # @return [String] required :next_cursor, String # @!method initialize(folders:, has_next_page:, next_cursor:) # @param folders [Array] - # @param has_next_page [Boolean] - # @param next_cursor [String] + # + # @param has_next_page [Boolean] Always false for the current bookmark folder route + # + # @param next_cursor [String] Always empty for the current bookmark folder route class Folder < XTwitterScraper::Internal::Type::BaseModel # @!attribute id 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 new file mode 100644 index 0000000..dee9156 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/communities/join_create_response.rb @@ -0,0 +1,20 @@ +# 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 success + # + # @return [Boolean, true] + required :success, const: true + + # @!method initialize(success: true) + # @param success [Boolean, true] + end + end + end + end +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 new file mode 100644 index 0000000..170190e --- /dev/null +++ b/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb @@ -0,0 +1,20 @@ +# 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 success + # + # @return [Boolean, true] + required :success, const: true + + # @!method initialize(success: true) + # @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 index 909902e..b0f832a 100644 --- 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 @@ -20,11 +20,27 @@ class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::TweetListByCommunityParams} for more + # details. + # # @param id [String] # # @param cursor [String] Pagination cursor for community tweets # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 a68015c..fcf30a0 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 @@ -9,32 +9,66 @@ class TweetListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + # @!attribute community_id + # Numeric ID of the community to search + # + # @return [String] + required :community_id, String + # @!attribute q - # Search query for cross-community tweets + # Keyword query within the selected community # # @return [String] required :q, String # @!attribute cursor - # Pagination cursor for cross-community results + # Pagination cursor for community results # # @return [String, nil] optional :cursor, String + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + # @!attribute query_type - # Sort order for cross-community results (Latest or Top) + # Sort order for community results (Latest or Top) # - # @return [String, nil] - optional :query_type, String + # @return [Symbol, XTwitterScraper::Models::X::Communities::TweetListParams::QueryType, nil] + optional :query_type, enum: -> { XTwitterScraper::X::Communities::TweetListParams::QueryType } - # @!method initialize(q:, cursor: nil, query_type: nil, request_options: {}) - # @param q [String] Search query for cross-community tweets + # @!method initialize(community_id:, q:, cursor: nil, page_size: nil, query_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::TweetListParams} for more details. # - # @param cursor [String] Pagination cursor for cross-community results + # @param community_id [String] Numeric ID of the community to search # - # @param query_type [String] Sort order for cross-community results (Latest or Top) + # @param q [String] Keyword query within the selected community + # + # @param cursor [String] Pagination cursor for community results + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param query_type [Symbol, XTwitterScraper::Models::X::Communities::TweetListParams::QueryType] Sort order for community results (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Sort order for community results (Latest or Top) + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + LATEST = :Latest + TOP = :Top + + # @!method self.values + # @return [Array] + end end end 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 deleted file mode 100644 index c5759d7..0000000 --- a/lib/x_twitter_scraper/models/x/community_action_result.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Models - module X - class CommunityActionResult < 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) - # Result of a community join or leave action. - # - # @param community_id [String] - # @param community_name [String] - # @param success [Boolean, true] - end - end - end -end 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 a8bcf72..6121e50 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 @@ -34,12 +34,35 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :created_at, String + # @!attribute creator + # + # @return [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, nil] + optional :creator, -> { XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator } + # @!attribute description # About text for the community # # @return [String, nil] optional :description, String + # @!attribute invites_policy + # Invitation policy + # + # @return [String, nil] + optional :invites_policy, String + + # @!attribute is_member + # Whether the authenticated viewer is a member + # + # @return [Boolean, nil] + optional :is_member, XTwitterScraper::Internal::Type::Boolean + + # @!attribute is_nsfw + # Whether the community is marked sensitive + # + # @return [Boolean, nil] + optional :is_nsfw, XTwitterScraper::Internal::Type::Boolean + # @!attribute join_policy # Join policy (open or restricted) # @@ -71,6 +94,12 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :primary_topic, -> { XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic } + # @!attribute role + # Authenticated viewer's community role + # + # @return [String, nil] + optional :role, String + # @!attribute rules # Community rules # @@ -78,7 +107,7 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :rules, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } - # @!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) + # @!method initialize(id:, banner_url: nil, created_at: nil, creator: nil, description: nil, invites_policy: nil, is_member: nil, is_nsfw: nil, join_policy: nil, member_count: nil, moderator_count: nil, name: nil, primary_topic: nil, role: nil, rules: nil) # Community info object # # @param id [String] Unique community identifier @@ -87,8 +116,16 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # # @param created_at [String] Community creation timestamp # + # @param creator [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator] + # # @param description [String] About text for the community # + # @param invites_policy [String] Invitation policy + # + # @param is_member [Boolean] Whether the authenticated viewer is a member + # + # @param is_nsfw [Boolean] Whether the community is marked sensitive + # # @param join_policy [String] Join policy (open or restricted) # # @param member_count [Integer] Total member count @@ -99,8 +136,39 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # # @param primary_topic [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic] Primary topic # + # @param role [String] Authenticated viewer's community role + # # @param rules [Array] Community rules + # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community#creator + class Creator < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!attribute verified + # + # @return [Boolean] + required :verified, XTwitterScraper::Internal::Type::Boolean + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(id:, username:, verified:, name: nil) + # @param id [String] + # @param username [String] + # @param verified [Boolean] + # @param name [String] + end + # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community#primary_topic class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel # @!attribute id diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb b/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb index 80223f0..eecb8ba 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_members_params.rb @@ -20,17 +20,22 @@ class CommunityRetrieveMembersParams < XTwitterScraper::Internal::Type::BaseMode optional :cursor, String # @!attribute page_size - # Items per page (20-200, default 20) + # Items per page (20-200, default 20). This is an upper bound for paid + # authenticated calls: remaining credits can reduce the returned page size, and + # zero affordable results returns 402 insufficient_credits. # # @return [Integer, nil] optional :page_size, Integer # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityRetrieveMembersParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor # - # @param page_size [Integer] Items per page (20-200, default 20) + # @param page_size [Integer] Items per page (20-200, default 20). This is an upper bound for paid authenticat # # @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 9df60ca..45a28a7 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 @@ -8,6 +8,12 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + # @!attribute community_id + # Numeric ID of the community whose posts to search + # + # @return [String] + required :community_id, String + # @!attribute q # Search query # @@ -20,20 +26,48 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + # @!attribute query_type # Sort order (Latest or Top) # - # @return [String, nil] - optional :query_type, String + # @return [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType, nil] + optional :query_type, enum: -> { XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType } - # @!method initialize(q:, cursor: nil, query_type: nil, request_options: {}) + # @!method initialize(community_id:, q:, cursor: nil, page_size: nil, query_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityRetrieveSearchParams} for more details. + # + # @param community_id [String] Numeric ID of the community whose posts to search + # # @param q [String] Search query # # @param cursor [String] Pagination cursor for community search # - # @param query_type [String] Sort order (Latest or Top) + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param query_type [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType] Sort order (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Sort order (Latest or Top) + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + LATEST = :Latest + TOP = :Top + + # @!method self.values + # @return [Array] + end end end end 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 1e38998..5ed2439 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 @@ -13,6 +13,13 @@ class DmRetrieveHistoryParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :user_id, String + # @!attribute account + # X handle (without the `@` prefix) of the connected X account used to read the + # conversation. The account must be a participant in the conversation. + # + # @return [String] + required :account, String + # @!attribute cursor # Pagination cursor for DM history # @@ -25,9 +32,14 @@ class DmRetrieveHistoryParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :max_id, String - # @!method initialize(user_id:, cursor: nil, max_id: nil, request_options: {}) + # @!method initialize(user_id:, account:, cursor: nil, max_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::DmRetrieveHistoryParams} for more details. + # # @param user_id [String] # + # @param account [String] X handle (without the `@` prefix) of the connected X account used to read the co + # # @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_retrieve_history_response.rb b/lib/x_twitter_scraper/models/x/dm_retrieve_history_response.rb index 8b672a6..d61f526 100644 --- a/lib/x_twitter_scraper/models/x/dm_retrieve_history_response.rb +++ b/lib/x_twitter_scraper/models/x/dm_retrieve_history_response.rb @@ -32,31 +32,48 @@ class Message < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute created_at + # @!attribute receiver_id # - # @return [String, nil] - optional :created_at, String, api_name: :createdAt + # @return [String] + required :receiver_id, String, api_name: :receiverId - # @!attribute receiver_id + # @!attribute sender_id + # + # @return [String] + required :sender_id, String, api_name: :senderId + + # @!attribute created_at # # @return [String, nil] - optional :receiver_id, String, api_name: :receiverId + optional :created_at, String, api_name: :createdAt - # @!attribute sender_id + # @!attribute media_url + # URL of attached media (image, GIF, or video). Omitted when the message has no + # media attachment. # # @return [String, nil] - optional :sender_id, String, api_name: :senderId + optional :media_url, String, api_name: :mediaUrl # @!attribute text # # @return [String, nil] optional :text, String - # @!method initialize(id:, created_at: nil, receiver_id: nil, sender_id: nil, text: nil) + # @!method initialize(id:, receiver_id:, sender_id:, created_at: nil, media_url: nil, text: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::DmRetrieveHistoryResponse::Message} for more + # details. + # # @param id [String] - # @param created_at [String] + # # @param receiver_id [String] + # # @param sender_id [String] + # + # @param created_at [String] + # + # @param media_url [String] URL of attached media (image, GIF, or video). Omitted when the message has no me + # # @param text [String] end end 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 8921ae9..cfd99cd 100644 --- a/lib/x_twitter_scraper/models/x/dm_send_params.rb +++ b/lib/x_twitter_scraper/models/x/dm_send_params.rb @@ -25,25 +25,19 @@ class DmSendParams < XTwitterScraper::Internal::Type::BaseModel required :text, String # @!attribute media_ids + # Optional array containing exactly 1 uploaded media ID. # # @return [Array, nil] optional :media_ids, XTwitterScraper::Internal::Type::ArrayOf[String] - # @!attribute reply_to_message_id - # - # @return [String, nil] - optional :reply_to_message_id, String - - # @!method initialize(user_id:, account:, text:, media_ids: nil, reply_to_message_id: nil, request_options: {}) + # @!method initialize(user_id:, account:, text:, media_ids: nil, request_options: {}) # @param user_id [String] # # @param account [String] X account (@username or ID) sending the DM # # @param text [String] # - # @param media_ids [Array] - # - # @param reply_to_message_id [String] + # @param media_ids [Array] Optional array containing exactly 1 uploaded media ID. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/follower_check_params.rb b/lib/x_twitter_scraper/models/x/follower_check_params.rb index 2881b34..2f3ec95 100644 --- a/lib/x_twitter_scraper/models/x/follower_check_params.rb +++ b/lib/x_twitter_scraper/models/x/follower_check_params.rb @@ -9,21 +9,21 @@ class FollowerCheckParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute source - # Username to check (without @) + # Source username, @username, or X or Twitter profile URL # # @return [String] required :source, String # @!attribute target - # Target username (without @) + # Target username, @username, or X or Twitter profile URL # # @return [String] required :target, String # @!method initialize(source:, target:, request_options: {}) - # @param source [String] Username to check (without @) + # @param source [String] Source username, @username, or X or Twitter profile URL # - # @param target [String] Target username (without @) + # @param target [String] Target username, @username, or X or Twitter profile URL # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 be0e53d..913a81c 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 @@ -19,11 +19,25 @@ class ListRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ListRetrieveFollowersParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor for list followers # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 9cd2cdc..c7c9a49 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 @@ -25,6 +25,16 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :include_replies, XTwitterScraper::Internal::Type::Boolean + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + # @!attribute since_time # Unix timestamp - filter after # @@ -37,13 +47,18 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :until_time, String - # @!method initialize(id:, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) + # @!method initialize(id:, cursor: nil, include_replies: nil, page_size: nil, since_time: nil, until_time: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ListRetrieveTweetsParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor for list tweets # # @param include_replies [Boolean] Include replies (default false) # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @param since_time [String] Unix timestamp - filter after # # @param until_time [String] Unix timestamp - filter before diff --git a/lib/x_twitter_scraper/models/x/media_download_params.rb b/lib/x_twitter_scraper/models/x/media_download_params.rb index cd5376d..6ec5479 100644 --- a/lib/x_twitter_scraper/models/x/media_download_params.rb +++ b/lib/x_twitter_scraper/models/x/media_download_params.rb @@ -8,8 +8,14 @@ class MediaDownloadParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + # @!attribute tweet_id + # Numeric tweet ID alias for tweetInput + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + # @!attribute tweet_ids - # Array of tweet URLs or IDs (bulk, max 50) + # Array of tweet URLs or IDs (bulk, max 50 string items) # # @return [Array, nil] optional :tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :tweetIds @@ -20,11 +26,21 @@ class MediaDownloadParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :tweet_input, String, api_name: :tweetInput - # @!method initialize(tweet_ids: nil, tweet_input: nil, request_options: {}) - # @param tweet_ids [Array] Array of tweet URLs or IDs (bulk, max 50) + # @!attribute tweet_url + # Tweet URL alias for tweetInput + # + # @return [String, nil] + optional :tweet_url, String, api_name: :tweetUrl + + # @!method initialize(tweet_id: nil, tweet_ids: nil, tweet_input: nil, tweet_url: nil, request_options: {}) + # @param tweet_id [String] Numeric tweet ID alias for tweetInput + # + # @param tweet_ids [Array] Array of tweet URLs or IDs (bulk, max 50 string items) # # @param tweet_input [String] Tweet URL or ID (single tweet) # + # @param tweet_url [String] Tweet URL alias for tweetInput + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end 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 b23b4e7..408953b 100644 --- a/lib/x_twitter_scraper/models/x/media_upload_params.rb +++ b/lib/x_twitter_scraper/models/x/media_upload_params.rb @@ -9,28 +9,21 @@ class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or ID) uploading media + # X account (@username or ID) uploading media from URL # # @return [String] required :account, String - # @!attribute file - # Media file to upload + # @!attribute url + # HTTPS URL to download and upload as media # - # @return [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] - required :file, XTwitterScraper::Internal::Type::FileInput - - # @!attribute is_long_video - # - # @return [Boolean, nil] - optional :is_long_video, XTwitterScraper::Internal::Type::Boolean + # @return [String] + required :url, String - # @!method initialize(account:, file:, is_long_video: nil, request_options: {}) - # @param account [String] X account (@username or ID) uploading media - # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Media file to upload + # @!method initialize(account:, url:, request_options: {}) + # @param account [String] X account (@username or ID) uploading media from URL # - # @param is_long_video [Boolean] + # @param url [String] HTTPS URL to download and upload as media # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/media_upload_response.rb b/lib/x_twitter_scraper/models/x/media_upload_response.rb index 3e4dd94..674668e 100644 --- a/lib/x_twitter_scraper/models/x/media_upload_response.rb +++ b/lib/x_twitter_scraper/models/x/media_upload_response.rb @@ -10,13 +10,22 @@ class MediaUploadResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :media_id, String, api_name: :mediaId + # @!attribute media_url + # Public media URL for tweet `media` arrays. + # + # @return [String] + required :media_url, String, api_name: :mediaUrl + # @!attribute success # # @return [Boolean, true] required :success, const: true - # @!method initialize(media_id:, success: true) + # @!method initialize(media_id:, media_url:, success: true) # @param media_id [String] + # + # @param media_url [String] Public media URL for tweet `media` arrays. + # # @param success [Boolean, true] end end 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 8918f53..b4a63d2 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,21 +9,21 @@ class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or ID) for avatar update + # X account (@username or ID) receiving avatar from URL # # @return [String] required :account, String - # @!attribute file - # Avatar image (max 716KB) + # @!attribute url + # HTTPS URL to the avatar image to download # - # @return [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] - required :file, XTwitterScraper::Internal::Type::FileInput + # @return [String] + required :url, String - # @!method initialize(account:, file:, request_options: {}) - # @param account [String] X account (@username or ID) for avatar update + # @!method initialize(account:, url:, request_options: {}) + # @param account [String] X account (@username or ID) receiving avatar from URL # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Avatar image (max 716KB) + # @param url [String] HTTPS URL to the avatar image to download # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 9b12227..f646929 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,21 +9,21 @@ class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute account - # X account (@username or ID) for banner update + # X account (@username or ID) receiving banner from URL # # @return [String] required :account, String - # @!attribute file - # Banner image (max 2MB) + # @!attribute url + # HTTPS URL to the banner image to download # - # @return [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] - required :file, XTwitterScraper::Internal::Type::FileInput + # @return [String] + required :url, String - # @!method initialize(account:, file:, request_options: {}) - # @param account [String] X account (@username or ID) for banner update + # @!method initialize(account:, url:, request_options: {}) + # @param account [String] X account (@username or ID) receiving banner from URL # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Banner image (max 2MB) + # @param url [String] HTTPS URL to the banner image to download # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/tweet_author.rb b/lib/x_twitter_scraper/models/x/tweet_author.rb index e441342..b928d2c 100644 --- a/lib/x_twitter_scraper/models/x/tweet_author.rb +++ b/lib/x_twitter_scraper/models/x/tweet_author.rb @@ -3,40 +3,23 @@ module XTwitterScraper module Models module X - class TweetAuthor < XTwitterScraper::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - + class TweetAuthor < XTwitterScraper::Models::UserProfile # @!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) - # Author of a tweet with follower count and verification status. + # @!method initialize(followers:, verified:) + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. # - # @param id [String] # @param followers [Integer] - # @param username [String] # @param verified [Boolean] - # @param profile_picture [String] end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_create_params.rb b/lib/x_twitter_scraper/models/x/tweet_create_params.rb index 59f71ec..cef87b1 100644 --- a/lib/x_twitter_scraper/models/x/tweet_create_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_create_params.rb @@ -30,8 +30,9 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel optional :is_note_tweet, XTwitterScraper::Internal::Type::Boolean # @!attribute media - # Array of public image URLs to attach (max 4). Each URL must be publicly - # reachable - the browser composer fetches them directly. + # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 + # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 + # credits per started MB across all files. # # @return [Array, nil] optional :media, XTwitterScraper::Internal::Type::ArrayOf[String] @@ -59,7 +60,7 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # # @param is_note_tweet [Boolean] # - # @param media [Array] Array of public image URLs to attach (max 4). Each URL must be publicly reachabl + # @param media [Array] Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 v # # @param reply_to_tweet_id [String] # diff --git a/lib/x_twitter_scraper/models/x/tweet_create_response.rb b/lib/x_twitter_scraper/models/x/tweet_create_response.rb index c339d16..9f7ca0b 100644 --- a/lib/x_twitter_scraper/models/x/tweet_create_response.rb +++ b/lib/x_twitter_scraper/models/x/tweet_create_response.rb @@ -5,6 +5,18 @@ module Models module X # @see XTwitterScraper::Resources::X::Tweets#create class TweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; + # attached media adds 2 credits per started MB. + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + # @!attribute success # # @return [Boolean, true] @@ -15,8 +27,23 @@ class TweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :tweet_id, String, api_name: :tweetId - # @!method initialize(tweet_id:, success: true) + # @!attribute write_action_id + # + # @return [String, nil] + optional :write_action_id, String, api_name: :writeActionId + + # @!method initialize(charged:, charged_credits:, tweet_id:, write_action_id: nil, success: true) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetCreateResponse} for more details. + # + # @param charged [Boolean] + # + # @param charged_credits [String] Credits charged for this tweet. Text-only tweets and replies cost 30 credits; at + # # @param tweet_id [String] + # + # @param write_action_id [String] + # # @param success [Boolean, true] end end diff --git a/lib/x_twitter_scraper/models/x/tweet_detail.rb b/lib/x_twitter_scraper/models/x/tweet_detail.rb index 61c2e05..ece9d82 100644 --- a/lib/x_twitter_scraper/models/x/tweet_detail.rb +++ b/lib/x_twitter_scraper/models/x/tweet_detail.rb @@ -44,6 +44,20 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Integer] required :view_count, Integer, api_name: :viewCount + # @!attribute author + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. + # + # @return [XTwitterScraper::Models::X::TweetAuthor, nil] + optional :author, -> { XTwitterScraper::X::TweetAuthor } + + # @!attribute content_disclosure + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + # + # @return [XTwitterScraper::Models::ContentDisclosure, nil] + optional :content_disclosure, -> { XTwitterScraper::ContentDisclosure }, api_name: :contentDisclosure + # @!attribute conversation_id # ID of the root tweet in the conversation thread # @@ -55,12 +69,44 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :created_at, String, api_name: :createdAt + # @!attribute display_text_range + # Start and end offsets for rendered tweet text + # + # @return [Array, nil] + optional :display_text_range, + XTwitterScraper::Internal::Type::ArrayOf[Integer], + api_name: :displayTextRange + # @!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 in_reply_to_id + # Tweet ID being replied to + # + # @return [String, nil] + optional :in_reply_to_id, String, api_name: :inReplyToId + + # @!attribute in_reply_to_user_id + # User ID being replied to + # + # @return [String, nil] + optional :in_reply_to_user_id, String, api_name: :inReplyToUserId + + # @!attribute in_reply_to_username + # Username being replied to + # + # @return [String, nil] + optional :in_reply_to_username, String, api_name: :inReplyToUsername + + # @!attribute is_limited_reply + # Whether replies are limited for this tweet + # + # @return [Boolean, nil] + optional :is_limited_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isLimitedReply + # @!attribute is_note_tweet # Whether this is a Note Tweet (long-form post, up to 25,000 characters) # @@ -79,17 +125,33 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + # @!attribute lang + # Tweet language code + # + # @return [String, nil] + optional :lang, String + # @!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] } + # @return [Array, nil] + optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } # @!attribute quoted_tweet - # The quoted tweet object, present when isQuoteStatus is true + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. # - # @return [Hash{Symbol=>Object}, nil] - optional :quoted_tweet, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :quoted_tweet, -> { XTwitterScraper::EmbeddedTweet } + + # @!attribute retweeted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + # + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :retweeted_tweet, -> { XTwitterScraper::EmbeddedTweet } # @!attribute source # Client application used to post this tweet @@ -97,8 +159,24 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @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. + # @!attribute type + # Tweet result type + # + # @return [String, nil] + optional :type, String + + # @!attribute url + # Tweet permalink URL + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetDetail} for more details. + # + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # mean X did not report the count. # # @param id [String] # @@ -116,57 +194,45 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # # @param view_count [Integer] # + # @param author [XTwitterScraper::Models::X::TweetAuthor] Tweet author profile. The lookup route always includes follower count and verifi + # + # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh + # # @param conversation_id [String] ID of the root tweet in the conversation thread # # @param created_at [String] # + # @param display_text_range [Array] Start and end offsets for rendered tweet text + # # @param entities [Hash{Symbol=>Object}] Parsed entities from the tweet text (URLs, mentions, hashtags, media) # + # @param in_reply_to_id [String] Tweet ID being replied to + # + # @param in_reply_to_user_id [String] User ID being replied to + # + # @param in_reply_to_username [String] Username being replied to + # + # @param is_limited_reply [Boolean] Whether replies are limited for this tweet + # # @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 lang [String] Tweet language code # - # @param quoted_tweet [Hash{Symbol=>Object}] The quoted tweet object, present when isQuoteStatus is true + # @param media [Array] Attached media items, omitted when the tweet has no media + # + # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen + # + # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen # # @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 + # + # @param type [String] Tweet result type + # + # @param url [String] Tweet permalink URL 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 e325ee2..7b8c3fc 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 @@ -19,11 +19,25 @@ class TweetGetFavoritersParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetFavoritersParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor for favoriters # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 cac3055..be1f36d 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 @@ -13,42 +13,309 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for quote tweets # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + # @!attribute include_replies # Include reply quotes (default false) # # @return [Boolean, nil] optional :include_replies, XTwitterScraper::Internal::Type::Boolean + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::TweetGetQuotesParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::TweetGetQuotesParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::TweetGetQuotesParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::TweetGetQuotesParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + # @!attribute since_time # Unix timestamp - return quotes posted after this time # # @return [String, nil] optional :since_time, String + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + # @!attribute until_time # Unix timestamp - return quotes posted before this time # # @return [String, nil] optional :until_time, String - # @!method initialize(id:, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_replies: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetQuotesParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for quote tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # # @param include_replies [Boolean] Include reply quotes (default false) # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return quotes posted after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return quotes posted before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + 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 97d916e..83d2631 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 @@ -13,34 +13,301 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for tweet replies # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::TweetGetRepliesParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::TweetGetRepliesParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::TweetGetRepliesParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::TweetGetRepliesParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + # @!attribute since_time # Unix timestamp - return replies posted after this time # # @return [String, nil] optional :since_time, String + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + # @!attribute until_time # Unix timestamp - return replies posted before this time # # @return [String, nil] optional :until_time, String - # @!method initialize(id:, cursor: nil, since_time: nil, until_time: nil, request_options: {}) + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetRepliesParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for tweet replies # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return replies posted after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return replies posted before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + 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 b92b475..09a013d 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 @@ -19,11 +19,25 @@ class TweetGetRetweetersParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetRetweetersParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor for retweeters # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 f395e34..d3e9b05 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 @@ -19,11 +19,26 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetThreadParams} for more details. + # # @param id [String] # # @param cursor [String] Pagination cursor for thread tweets # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @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 276e9e3..4bdbf58 100644 --- a/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/x/tweet_retrieve_response.rb @@ -6,21 +6,26 @@ 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. + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # mean X did not report the count. # # @return [XTwitterScraper::Models::X::TweetDetail] required :tweet, -> { XTwitterScraper::X::TweetDetail } # @!attribute author - # Author of a tweet with follower count and verification status. + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. # # @return [XTwitterScraper::Models::X::TweetAuthor, nil] optional :author, -> { XTwitterScraper::X::TweetAuthor } # @!method initialize(tweet:, author: nil) - # @param tweet [XTwitterScraper::Models::X::TweetDetail] Full tweet with text, engagement metrics, media, and metadata. + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetRetrieveResponse} for more details. # - # @param author [XTwitterScraper::Models::X::TweetAuthor] Author of a tweet with follower count and verification status. + # @param tweet [XTwitterScraper::Models::X::TweetDetail] Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # + # @param author [XTwitterScraper::Models::X::TweetAuthor] Tweet author profile. The lookup route always includes follower count and verifi 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 de9d93c..62c9beb 100644 --- a/lib/x_twitter_scraper/models/x/tweet_search_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_search_params.rb @@ -14,51 +14,321 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :q, String + # @!attribute advanced_query + # Raw advanced search query appended as-is. + # + # @return [String, nil] + optional :advanced_query, String + + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute bounding_box + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + # + # @return [String, nil] + optional :bounding_box, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor from previous response # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + # @!attribute limit # Max tweets to return (server paginates internally). Omit for single page (~20). + # This is an upper bound for paid authenticated calls: remaining credits can + # reduce the returned page size, and zero affordable results returns 402 + # insufficient_credits. # # @return [Integer, nil] optional :limit, Integer + # @!attribute list_id + # Search within a list ID. + # + # @return [String, nil] + optional :list_id, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::TweetSearchParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute place + # Search within a place ID. + # + # @return [String, nil] + optional :place, String + + # @!attribute place_country + # Search within a country code. + # + # @return [String, nil] + optional :place_country, String + + # @!attribute point_radius + # Geo point radius, e.g. -73.99 40.73 25mi. + # + # @return [String, nil] + optional :point_radius, String + # @!attribute query_type # Sort order - Latest (chronological) or Top (engagement-ranked) # # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType, nil] optional :query_type, enum: -> { XTwitterScraper::X::TweetSearchParams::QueryType } + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::TweetSearchParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::TweetSearchParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::TweetSearchParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + # @!attribute since_time # ISO 8601 timestamp - only return tweets after this time # # @return [String, nil] optional :since_time, String + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + # @!attribute until_time # ISO 8601 timestamp - only return tweets before this time # # @return [String, nil] optional :until_time, String - # @!method initialize(q:, cursor: nil, limit: nil, query_type: nil, since_time: nil, until_time: nil, request_options: {}) + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(q:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, limit: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, query_type: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetSearchParams} for more details. + # # @param q [String] Search query (keywords, # + # @param advanced_query [String] Raw advanced search query appended as-is. + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param bounding_box [String] Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor from previous response # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # # @param limit [Integer] Max tweets to return (server paginates internally). Omit for single page (~20). # + # @param list_id [String] Search within a list ID. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param place [String] Search within a place ID. + # + # @param place_country [String] Search within a country code. + # + # @param point_radius [String] Geo point radius, e.g. -73.99 40.73 25mi. + # # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order - Latest (chronological) or Top (engagement-ranked) # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] ISO 8601 timestamp - only return tweets after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] ISO 8601 timestamp - only return tweets before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + # Sort order - Latest (chronological) or Top (engagement-ranked) module QueryType extend XTwitterScraper::Internal::Type::Enum @@ -69,6 +339,42 @@ module QueryType # @!method self.values # @return [Array] end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb b/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb new file mode 100644 index 0000000..e491002 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Users#remove_follower + class UserRemoveFollowerParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # X account identifier (@username or account ID) + # + # @return [String] + required :account, String + + # @!method initialize(id:, account:, request_options: {}) + # @param id [String] + # + # @param account [String] X account identifier (@username or account ID) + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb b/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb new file mode 100644 index 0000000..915143a --- /dev/null +++ b/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Users#remove_follower + class UserRemoveFollowerResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute success + # + # @return [Boolean, true] + required :success, const: true + + # @!method initialize(success: true) + # @param success [Boolean, true] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_batch_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_batch_params.rb index 9616675..ac03fa2 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_batch_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_batch_params.rb @@ -9,13 +9,17 @@ class UserRetrieveBatchParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute ids - # Comma-separated user IDs (max 100) + # Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while + # preserving first-seen order. # # @return [String] required :ids, String # @!method initialize(ids:, request_options: {}) - # @param ids [String] Comma-separated user IDs (max 100) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveBatchParams} for more details. + # + # @param ids [String] Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_batch_response.rb b/lib/x_twitter_scraper/models/x/user_retrieve_batch_response.rb new file mode 100644 index 0000000..5fc1ee6 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/user_retrieve_batch_response.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Users#retrieve_batch + class UserRetrieveBatchResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute has_next_page + # Batch lookups never paginate. + # + # @return [Boolean, false] + required :has_next_page, const: false + + # @!attribute next_cursor + # Empty because batch lookups never paginate. + # + # @return [String] + required :next_cursor, String + + # @!attribute processed_count + # Number of requested IDs included in the lookup. + # + # @return [Integer] + required :processed_count, Integer + + # @!attribute requested_count + # Number of unique IDs requested. + # + # @return [Integer] + required :requested_count, Integer + + # @!attribute returned_count + # Number of user profiles returned and charged. + # + # @return [Integer] + required :returned_count, Integer + + # @!attribute unavailable_ids + # Processed IDs with no returned profile, in first-seen request order. + # + # @return [Array] + required :unavailable_ids, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!attribute unprocessed_ids + # Requested IDs skipped because available credits limited processing. Retry these + # IDs after adding credits. + # + # @return [Array] + required :unprocessed_ids, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!attribute users + # + # @return [Array] + required :users, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile] } + + # @!method initialize(next_cursor:, processed_count:, requested_count:, returned_count:, unavailable_ids:, unprocessed_ids:, users:, has_next_page: false) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveBatchResponse} for more details. + # + # Batch user lookup results. Duplicate requested IDs are ignored while preserving + # first-seen order. unavailable_ids identifies processed IDs with no returned + # profile. unprocessed_ids identifies IDs skipped when available credits limit + # processing. + # + # @param next_cursor [String] Empty because batch lookups never paginate. + # + # @param processed_count [Integer] Number of requested IDs included in the lookup. + # + # @param requested_count [Integer] Number of unique IDs requested. + # + # @param returned_count [Integer] Number of user profiles returned and charged. + # + # @param unavailable_ids [Array] Processed IDs with no returned profile, in first-seen request order. + # + # @param unprocessed_ids [Array] Requested IDs skipped because available credits limited processing. Retry these + # + # @param users [Array] + # + # @param has_next_page [Boolean, false] Batch lookups never paginate. + end + end + end +end 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 d7026d8..904b45b 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 @@ -13,24 +13,46 @@ class UserRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute after + # Legacy cursor alias. Prefer cursor. + # + # @return [String, nil] + optional :after, String + # @!attribute cursor # Pagination cursor for followers list # # @return [String, nil] optional :cursor, String + # @!attribute limit + # Legacy integer page size alias for following lists. Prefer pageSize. + # + # @return [Integer, nil] + optional :limit, Integer + # @!attribute page_size - # Items per page (20-200, default 200) + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. # # @return [Integer, nil] optional :page_size, Integer - # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # @!method initialize(id:, after: nil, cursor: nil, limit: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowersParams} for more details. + # # @param id [String] # + # @param after [String] Legacy cursor alias. Prefer cursor. + # # @param cursor [String] Pagination cursor for followers list # - # @param page_size [Integer] Items per page (20-200, default 200) + # @param limit [Integer] Legacy integer page size alias for following lists. Prefer pageSize. + # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 a403f5f..698924d 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 @@ -19,11 +19,26 @@ class UserRetrieveFollowersYouKnowParams < XTwitterScraper::Internal::Type::Base # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowParams} for more + # details. + # # @param id [String] # # @param cursor [String] Pagination cursor for followers-you-know # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 21d3736..a6996e1 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 @@ -13,24 +13,46 @@ class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute after + # Legacy cursor alias. Prefer cursor. + # + # @return [String, nil] + optional :after, String + # @!attribute cursor # Pagination cursor for following list # # @return [String, nil] optional :cursor, String + # @!attribute limit + # Legacy page size alias. Prefer pageSize. + # + # @return [Integer, nil] + optional :limit, Integer + # @!attribute page_size - # Results per page (20-200, default 200) + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. # # @return [Integer, nil] optional :page_size, Integer - # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # @!method initialize(id:, after: nil, cursor: nil, limit: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowingParams} for more details. + # # @param id [String] # + # @param after [String] Legacy cursor alias. Prefer cursor. + # # @param cursor [String] Pagination cursor for following list # - # @param page_size [Integer] Results per page (20-200, default 200) + # @param limit [Integer] Legacy page size alias. Prefer pageSize. + # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon # # @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 d774710..3849891 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 @@ -13,18 +13,285 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for liked tweets # # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::UserRetrieveLikesParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::UserRetrieveLikesParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::UserRetrieveLikesParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::UserRetrieveLikesParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveLikesParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for liked tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + 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 47f3528..e7ab2eb 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 @@ -13,18 +13,285 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for media tweets # # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::UserRetrieveMediaParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::UserRetrieveMediaParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::UserRetrieveMediaParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::UserRetrieveMediaParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveMediaParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for media tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + 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 7965ff4..e4ed980 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 @@ -13,34 +13,301 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for mentions # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::UserRetrieveMentionsParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::UserRetrieveMentionsParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::UserRetrieveMentionsParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::UserRetrieveMentionsParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + # @!attribute since_time # Unix timestamp - return mentions after this time # # @return [String, nil] optional :since_time, String + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + # @!attribute until_time # Unix timestamp - return mentions before this time # # @return [String, nil] optional :until_time, String - # @!method initialize(id:, cursor: nil, since_time: nil, until_time: nil, request_options: {}) + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveMentionsParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for mentions # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return mentions after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return mentions before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb new file mode 100644 index 0000000..385d438 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb @@ -0,0 +1,306 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Users#retrieve_replies + class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + + # @!attribute cursor + # Pagination cursor for user replies + # + # @return [String, nil] + optional :cursor, String + + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute include_parent_tweet + # Include parent tweet for replies + # + # @return [Boolean, nil] + optional :include_parent_tweet, XTwitterScraper::Internal::Type::Boolean + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::UserRetrieveRepliesParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::UserRetrieveRepliesParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::UserRetrieveRepliesParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::UserRetrieveRepliesParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_parent_tweet: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveRepliesParams} for more details. + # + # @param id [String] + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # + # @param cursor [String] Pagination cursor for user replies + # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param include_parent_tweet [Boolean] Include parent tweet for replies + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + end + end + end +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 e4a987c..c48f17c 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 @@ -13,12 +13,55 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for user tweets # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + # @!attribute include_parent_tweet # Include parent tweet for replies # @@ -31,16 +74,240 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :include_replies, XTwitterScraper::Internal::Type::Boolean - # @!method initialize(id:, cursor: nil, include_parent_tweet: nil, include_replies: nil, request_options: {}) + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::UserRetrieveTweetsParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_faves + # Minimum likes threshold. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute page_size + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::UserRetrieveTweetsParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::UserRetrieveTweetsParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::UserRetrieveTweetsParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_parent_tweet: nil, include_replies: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveTweetsParams} for more details. + # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for user tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # # @param include_parent_tweet [Boolean] Include parent tweet for replies # # @param include_replies [Boolean] Include reply tweets # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + 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 ae01891..0234d81 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 @@ -19,11 +19,26 @@ class UserRetrieveVerifiedFollowersParams < XTwitterScraper::Internal::Type::Bas # @return [String, nil] optional :cursor, String - # @!method initialize(id:, cursor: nil, request_options: {}) + # @!attribute page_size + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersParams} for more + # details. + # # @param id [String] # # @param cursor [String] Pagination cursor for verified followers # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/write_action_retrieve_params.rb b/lib/x_twitter_scraper/models/x/write_action_retrieve_params.rb new file mode 100644 index 0000000..a26dcef --- /dev/null +++ b/lib/x_twitter_scraper/models/x/write_action_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::WriteActions#retrieve + class WriteActionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb b/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb new file mode 100644 index 0000000..37bcc93 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::WriteActions#retrieve + class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute action + # + # @return [String] + required :action, String + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute media + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media] + required :media, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media } + + # @!attribute retryable + # + # @return [Boolean, false] + required :retryable, const: false + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status } + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmation_source + # + # @return [String, nil] + optional :confirmation_source, String, api_name: :confirmationSource, nil?: true + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute send_dispatched_at + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute target_id + # + # @return [String, nil] + optional :target_id, String, api_name: :targetId, nil?: true + + # @!attribute tweet_id + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!method initialize(action:, charged:, charged_credits:, created_at:, media:, send_dispatched:, status:, write_action_id:, confirmation_attempts: nil, confirmation_checked_at: nil, confirmation_source: nil, confirmed_at: nil, message: nil, message_id: nil, send_dispatched_at: nil, target_id: nil, tweet_id: nil, retryable: false) + # @param action [String] + # @param charged [Boolean] + # @param charged_credits [String] + # @param created_at [Time] + # @param media [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media] + # @param send_dispatched [Boolean] + # @param status [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status] + # @param write_action_id [String] + # @param confirmation_attempts [Integer] + # @param confirmation_checked_at [Time] + # @param confirmation_source [String, nil] + # @param confirmed_at [Time] + # @param message [String] + # @param message_id [String] + # @param send_dispatched_at [Time] + # @param target_id [String, nil] + # @param tweet_id [String] + # @param retryable [Boolean, false] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#media + class Media < XTwitterScraper::Internal::Type::BaseModel + # @!attribute count + # + # @return [Integer] + required :count, Integer + + # @!attribute credits + # + # @return [String] + required :credits, String + + # @!attribute kind + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind] + required :kind, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind } + + # @!attribute total_bytes + # + # @return [String] + required :total_bytes, String, api_name: :totalBytes + + # @!method initialize(count:, credits:, kind:, total_bytes:) + # @param count [Integer] + # @param credits [String] + # @param kind [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind] + # @param total_bytes [String] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media#kind + module Kind + extend XTwitterScraper::Internal::Type::Enum + + NONE = :none + IMAGE = :image + VIDEO = :video + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + SUCCESS = :success + FAILED = :failed + PENDING_CONFIRMATION = :pending_confirmation + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/x_twitter_scraper/models/x/x_account.rb b/lib/x_twitter_scraper/models/x/x_account.rb index 54ad7f8..30a32ba 100644 --- a/lib/x_twitter_scraper/models/x/x_account.rb +++ b/lib/x_twitter_scraper/models/x/x_account.rb @@ -29,6 +29,11 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :status, String + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time, api_name: :updatedAt + # @!attribute x_user_id # # @return [String] @@ -39,11 +44,16 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # @!attribute cookies_obtained_at + # + # @return [Time, nil] + optional :cookies_obtained_at, Time, api_name: :cookiesObtainedAt + + # @!method initialize(id:, created_at:, health:, status:, updated_at:, x_user_id:, x_username:, cookies_obtained_at: nil) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::XAccount} for more details. # - # Linked X account summary with username and connection status. + # Linked X account summary with connection status, health, and timestamp metadata. # # @param id [String] # @@ -53,9 +63,13 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # # @param status [String] # + # @param updated_at [Time] + # # @param x_user_id [String] # # @param x_username [String] + # + # @param cookies_obtained_at [Time] # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user # must submit fresh credentials. `locked` = X locked the account; unlock on x.com 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 2090e0c..9547e7e 100644 --- a/lib/x_twitter_scraper/models/x/x_account_detail.rb +++ b/lib/x_twitter_scraper/models/x/x_account_detail.rb @@ -40,18 +40,13 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel # @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:, health:, 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. + # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, cookies_obtained_at: nil, updated_at: nil) + # Full X account details with status, cookies, and update timestamp. # # @param id [String] # @param created_at [Time] @@ -60,7 +55,6 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel # @param x_user_id [String] # @param x_username [String] # @param cookies_obtained_at [Time] - # @param proxy_country [String] # @param updated_at [Time] # @see XTwitterScraper::Models::X::XAccountDetail#health 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 47bac28..cc2514e 100644 --- a/lib/x_twitter_scraper/models/x_get_article_response.rb +++ b/lib/x_twitter_scraper/models/x_get_article_response.rb @@ -10,18 +10,24 @@ class XGetArticleResponse < XTwitterScraper::Internal::Type::BaseModel required :article, -> { XTwitterScraper::Models::XGetArticleResponse::Article } # @!attribute author - # Author of a tweet with follower count and verification status. + # X Article author profile fields returned when available. # - # @return [XTwitterScraper::Models::X::TweetAuthor, nil] - optional :author, -> { XTwitterScraper::X::TweetAuthor } + # @return [XTwitterScraper::Models::XGetArticleResponse::Author, nil] + optional :author, -> { XTwitterScraper::Models::XGetArticleResponse::Author } # @!method initialize(article:, author: nil) # @param article [XTwitterScraper::Models::XGetArticleResponse::Article] # - # @param author [XTwitterScraper::Models::X::TweetAuthor] Author of a tweet with follower count and verification status. + # @param author [XTwitterScraper::Models::XGetArticleResponse::Author] X Article author profile fields returned when available. # @see XTwitterScraper::Models::XGetArticleResponse#article class Article < XTwitterScraper::Internal::Type::BaseModel + # @!attribute body_text + # Plain text joined from all article blocks + # + # @return [String, nil] + optional :body_text, String, api_name: :bodyText + # @!attribute contents # # @return [Array, nil] @@ -68,15 +74,25 @@ class Article < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :view_count, Integer, api_name: :viewCount - # @!method initialize(contents: nil, cover_image_url: nil, created_at: nil, like_count: nil, preview_text: nil, quote_count: nil, reply_count: nil, title: nil, view_count: nil) + # @!method initialize(body_text: nil, contents: nil, cover_image_url: nil, created_at: nil, like_count: nil, preview_text: nil, quote_count: nil, reply_count: nil, title: nil, view_count: nil) + # @param body_text [String] Plain text joined from all article blocks + # # @param contents [Array] + # # @param cover_image_url [String] + # # @param created_at [String] + # # @param like_count [Integer] + # # @param preview_text [String] + # # @param quote_count [Integer] + # # @param reply_count [Integer] + # # @param title [String] + # # @param view_count [Integer] class Content < XTwitterScraper::Internal::Type::BaseModel @@ -85,20 +101,35 @@ class Content < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :height, Integer + # @!attribute inline_style_ranges + # Inline text formatting ranges + # + # @return [Array, nil] + optional :inline_style_ranges, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange] }, + api_name: :inlineStyleRanges + + # @!attribute preview_url + # Preview image URL for media blocks + # + # @return [String, nil] + optional :preview_url, String, api_name: :previewUrl + # @!attribute text # # @return [String, nil] optional :text, String # @!attribute type - # Block type: unstyled, header-one, header-two, header-three, unordered-list-item, - # ordered-list-item, image, gif, divider + # Block type: paragraph, header-one, header-two, header-three, header-four, + # header-five, header-six, unordered-list-item, ordered-list-item, blockquote, + # code-block, media, divider # # @return [String, nil] optional :type, String # @!attribute url - # Media URL for image/gif blocks + # Media URL for media blocks # # @return [String, nil] optional :url, String @@ -108,22 +139,169 @@ class Content < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :width, Integer - # @!method initialize(height: nil, text: nil, type: nil, url: nil, width: nil) + # @!method initialize(height: nil, inline_style_ranges: nil, preview_url: nil, text: nil, type: nil, url: nil, width: nil) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::XGetArticleResponse::Article::Content} for more # details. # # @param height [Integer] # + # @param inline_style_ranges [Array] Inline text formatting ranges + # + # @param preview_url [String] Preview image URL for media blocks + # # @param text [String] # - # @param type [String] Block type: unstyled, header-one, header-two, header-three, unordered-list-item, + # @param type [String] Block type: paragraph, header-one, header-two, header-three, header-four, header # - # @param url [String] Media URL for image/gif blocks + # @param url [String] Media URL for media blocks # # @param width [Integer] + + class InlineStyleRange < XTwitterScraper::Internal::Type::BaseModel + # @!attribute length + # + # @return [Integer, nil] + optional :length, Integer + + # @!attribute offset + # + # @return [Integer, nil] + optional :offset, Integer + + # @!attribute style + # + # @return [String, nil] + optional :style, String + + # @!method initialize(length: nil, offset: nil, style: nil) + # @param length [Integer] + # @param offset [Integer] + # @param style [String] + end end end + + # @see XTwitterScraper::Models::XGetArticleResponse#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 can_dm + # + # @return [Boolean, nil] + optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm + + # @!attribute created_at + # + # @return [String, nil] + optional :created_at, String, api_name: :createdAt + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute favourites_count + # + # @return [Integer, nil] + optional :favourites_count, Integer, api_name: :favouritesCount + + # @!attribute followers_count + # + # @return [Integer, nil] + optional :followers_count, Integer, api_name: :followersCount + + # @!attribute following_count + # + # @return [Integer, nil] + optional :following_count, Integer, api_name: :followingCount + + # @!attribute is_blue_verified + # + # @return [Boolean, nil] + optional :is_blue_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isBlueVerified + + # @!attribute is_translator + # + # @return [Boolean, nil] + optional :is_translator, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslator + + # @!attribute is_verified + # + # @return [Boolean, nil] + optional :is_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isVerified + + # @!attribute location + # + # @return [String, nil] + optional :location, String + + # @!attribute media_count + # + # @return [Integer, nil] + optional :media_count, Integer, api_name: :mediaCount + + # @!attribute profile_banner_url + # + # @return [String, nil] + optional :profile_banner_url, String, api_name: :profileBannerUrl + + # @!attribute profile_picture + # + # @return [String, nil] + optional :profile_picture, String, api_name: :profilePicture + + # @!attribute protected + # + # @return [Boolean, nil] + optional :protected, XTwitterScraper::Internal::Type::Boolean + + # @!attribute statuses_count + # + # @return [Integer, nil] + optional :statuses_count, Integer, api_name: :statusesCount + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id:, name:, username:, can_dm: nil, created_at: nil, description: nil, favourites_count: nil, followers_count: nil, following_count: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, url: nil) + # X Article author profile fields returned when available. + # + # @param id [String] + # @param name [String] + # @param username [String] + # @param can_dm [Boolean] + # @param created_at [String] + # @param description [String] + # @param favourites_count [Integer] + # @param followers_count [Integer] + # @param following_count [Integer] + # @param is_blue_verified [Boolean] + # @param is_translator [Boolean] + # @param is_verified [Boolean] + # @param location [String] + # @param media_count [Integer] + # @param profile_banner_url [String] + # @param profile_picture [String] + # @param protected [Boolean] + # @param statuses_count [Integer] + # @param url [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 4a1d44d..3077f4c 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 @@ -14,7 +14,7 @@ class XGetHomeTimelineParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute seen_tweet_ids - # Comma-separated tweet IDs to exclude from results + # Comma-separated tweet IDs to exclude from results. Empty entries are ignored. # # @return [String, nil] optional :seen_tweet_ids, String @@ -22,7 +22,7 @@ class XGetHomeTimelineParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(cursor: nil, seen_tweet_ids: nil, request_options: {}) # @param cursor [String] Pagination cursor for timeline # - # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results + # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results. Empty entries are ignored. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] 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 b061a4f..932bc81 100644 --- a/lib/x_twitter_scraper/models/x_get_notifications_params.rb +++ b/lib/x_twitter_scraper/models/x_get_notifications_params.rb @@ -14,7 +14,7 @@ class XGetNotificationsParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute type - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. # # @return [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type, nil] optional :type, enum: -> { XTwitterScraper::XGetNotificationsParams::Type } @@ -22,11 +22,11 @@ class XGetNotificationsParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(cursor: nil, type: nil, request_options: {}) # @param cursor [String] Pagination cursor for notifications # - # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter + # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter. Unrecognized values fall back to All. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. module Type extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/resources/api_keys.rb b/lib/x_twitter_scraper/resources/api_keys.rb deleted file mode 100644 index 49feecb..0000000 --- a/lib/x_twitter_scraper/resources/api_keys.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -module XTwitterScraper - module Resources - # API key management (session auth only) - class APIKeys - # Create API key - # - # @overload create(name: nil, request_options: {}) - # - # @param name [String] - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::APIKeyCreateResponse] - # - # @see XTwitterScraper::Models::APIKeyCreateParams - def create(params = {}) - parsed, options = XTwitterScraper::APIKeyCreateParams.dump_request(params) - @client.request( - method: :post, - path: "api-keys", - body: parsed, - model: XTwitterScraper::Models::APIKeyCreateResponse, - options: options - ) - end - - # List API keys - # - # @overload list(request_options: {}) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::APIKeyListResponse] - # - # @see XTwitterScraper::Models::APIKeyListParams - def list(params = {}) - @client.request( - method: :get, - path: "api-keys", - model: XTwitterScraper::Models::APIKeyListResponse, - options: params[:request_options] - ) - end - - # Revoke API key - # - # @overload revoke(id, request_options: {}) - # - # @param id [String] Resource ID (stringified bigint) - # - # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [XTwitterScraper::Models::APIKeyRevokeResponse] - # - # @see XTwitterScraper::Models::APIKeyRevokeParams - def revoke(id, params = {}) - @client.request( - method: :delete, - path: ["api-keys/%1$s", id], - model: XTwitterScraper::Models::APIKeyRevokeResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [XTwitterScraper::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/x_twitter_scraper/resources/credits.rb b/lib/x_twitter_scraper/resources/credits.rb index f331bf8..6f6e2ce 100644 --- a/lib/x_twitter_scraper/resources/credits.rb +++ b/lib/x_twitter_scraper/resources/credits.rb @@ -4,6 +4,30 @@ module XTwitterScraper module Resources # Subscription, billing, and credits class Credits + # Redirect to an active top-up payment page + # + # @overload redirect_topup_checkout(session_id:, request_options: {}) + # + # @param session_id [String] Billing session ID returned by the top-up billing flow. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see XTwitterScraper::Models::CreditRedirectTopupCheckoutParams + def redirect_topup_checkout(params) + parsed, options = XTwitterScraper::CreditRedirectTopupCheckoutParams.dump_request(params) + query = XTwitterScraper::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "credits/topup/redirect", + query: query, + model: NilClass, + security: {}, + options: options + ) + end + # Get credits balance # # @overload retrieve_balance(request_options: {}) @@ -22,11 +46,37 @@ def retrieve_balance(params = {}) ) end - # Top up credits balance + # Get top-up billing status + # + # @overload retrieve_topup_status(session_id:, request_options: {}) + # + # @param session_id [String] Billing session ID returned by the top-up billing flow. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::CreditRetrieveTopupStatusResponse] + # + # @see XTwitterScraper::Models::CreditRetrieveTopupStatusParams + def retrieve_topup_status(params) + parsed, options = XTwitterScraper::CreditRetrieveTopupStatusParams.dump_request(params) + query = XTwitterScraper::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "credits/topup/status", + query: query, + model: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse, + options: options + ) + end + + # Create a Stripe Checkout session only after the user confirms. The request never + # completes payment or adds credits by itself. + # + # @overload topup_balance(dollars:, locale: nil, request_options: {}) # - # @overload topup_balance(amount:, request_options: {}) + # @param dollars [Integer] Amount to top up in US dollars. Minimum 10. # - # @param amount [Integer] Amount to top up in credits + # @param locale [String] Optional checkout locale. Defaults to en. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/drafts.rb b/lib/x_twitter_scraper/resources/drafts.rb index 0c0eab8..52f5759 100644 --- a/lib/x_twitter_scraper/resources/drafts.rb +++ b/lib/x_twitter_scraper/resources/drafts.rb @@ -31,7 +31,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -47,13 +47,16 @@ def retrieve(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::DraftListParams} for more details. + # # List saved drafts # # @overload list(after_cursor: nil, limit: nil, request_options: {}) # # @param after_cursor [String] Cursor for pagination # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -76,7 +79,7 @@ def list(params = {}) # # @overload delete(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @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 1ad74e0..3e16e59 100644 --- a/lib/x_twitter_scraper/resources/draws.rb +++ b/lib/x_twitter_scraper/resources/draws.rb @@ -8,7 +8,7 @@ class Draws # # @overload retrieve(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Draw public ID returned by create and list draw responses. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -24,13 +24,16 @@ def retrieve(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::DrawListParams} for more details. + # # List draws # - # @overload list(after: nil, limit: nil, request_options: {}) + # @overload list(cursor: nil, limit: nil, request_options: {}) # - # @param after [String] Cursor for keyset pagination + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -51,9 +54,9 @@ def list(params = {}) # Export draw data # - # @overload export(id, format_: nil, type: nil, request_options: {}) + # @overload export(id, format_:, type: nil, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Draw public ID returned by create and list draw responses. # # @param format_ [Symbol, XTwitterScraper::Models::DrawExportParams::Format] Export output format # @@ -64,7 +67,7 @@ def list(params = {}) # @return [StringIO] # # @see XTwitterScraper::Models::DrawExportParams - def export(id, params = {}) + def export(id, params) parsed, options = XTwitterScraper::DrawExportParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( @@ -77,7 +80,10 @@ def export(id, params = {}) ) end - # Run giveaway draw + # Runs a giveaway draw from a source tweet. The draw first checks the minimum + # credits needed to inspect the source tweet and at least one candidate. Remaining + # credits cap how many replies and retweeters can be inspected before filters and + # winner selection run. # # @overload run(tweet_url:, backup_count: nil, filter_account_age_days: nil, filter_language: nil, filter_min_followers: nil, must_follow_username: nil, must_retweet: nil, required_hashtags: nil, required_keywords: nil, required_mentions: nil, unique_authors_only: nil, winner_count: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/events.rb b/lib/x_twitter_scraper/resources/events.rb index eb43f1e..9638a64 100644 --- a/lib/x_twitter_scraper/resources/events.rb +++ b/lib/x_twitter_scraper/resources/events.rb @@ -8,7 +8,7 @@ class Events # # @overload retrieve(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -24,15 +24,18 @@ def retrieve(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::EventListParams} for more details. + # # List events # - # @overload list(after: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) + # @overload list(cursor: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) # - # @param after [String] Cursor for keyset pagination + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # # @param event_type [Symbol, XTwitterScraper::Models::EventType] Filter events by type # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param monitor_id [String] Filter events by monitor ID # diff --git a/lib/x_twitter_scraper/resources/extractions.rb b/lib/x_twitter_scraper/resources/extractions.rb index bcd54f3..ccb54a3 100644 --- a/lib/x_twitter_scraper/resources/extractions.rb +++ b/lib/x_twitter_scraper/resources/extractions.rb @@ -2,15 +2,15 @@ module XTwitterScraper module Resources - # Bulk data extraction (20 tool types) + # Bulk data extraction (23 tool types) class Extractions # Get extraction results # - # @overload retrieve(id, after: nil, limit: nil, request_options: {}) + # @overload retrieve(id, cursor: nil, limit: nil, request_options: {}) # # @param id [String] Extraction public ID (UUID) # - # @param after [String] Cursor for keyset pagination + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # # @param limit [Integer] Maximum number of results to return (1-1000, default 100) # @@ -31,13 +31,16 @@ def retrieve(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionListParams} for more details. + # # List extraction jobs # - # @overload list(after: nil, limit: nil, status: nil, tool_type: nil, request_options: {}) + # @overload list(cursor: nil, limit: nil, status: nil, tool_type: nil, request_options: {}) # - # @param after [String] Cursor for keyset pagination + # @param cursor [String] Cursor for keyset pagination from prior response next_cursor # - # @param limit [Integer] Maximum number of items to return (1-100, default 50) + # @param limit [Integer] Maximum number of items to return (1-100, default 50). For paid per-result endpo # # @param status [Symbol, XTwitterScraper::Models::ExtractionListParams::Status] Filter by job status # @@ -60,30 +63,91 @@ def list(params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionEstimateCostParams} for more details. + # # Estimate extraction cost # - # @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: {}) + # @overload estimate_cost(tool_type:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, results_limit: nil, retweets: nil, retweets_of_tweet_id: nil, search_query: nil, since_date: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # # @param tool_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::ToolType] Identifier for the extraction tool used to run a job. # # @param advanced_query [String] Raw advanced query string appended to the estimate (tweet_search_extractor) # + # @param any_words [String] Alternative words or quoted phrases for estimated results. Separate with spaces, + # + # @param bounding_box [String] Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_e + # + # @param cashtags [String] Cashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter used for estimation (tweet_search_extractor) + # # @param exact_phrase [String] Exact phrase filter for search estimation # - # @param exclude_words [String] Words excluded from estimated search results + # @param exclude_words [String] Words or quoted phrases excluded from estimated results. Separate with spaces, c + # + # @param from_user [String] Estimate only tweets from this author username (tweet_search_extractor) + # + # @param hashtags [String] Hashtags applied to the estimate, separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Estimate only replies to this tweet ID (tweet_search_extractor) + # + # @param language [String] Language code used for estimate filtering (tweet_search_extractor) + # + # @param list_id [String] Estimate search results within this list ID (tweet_search_extractor) + # + # @param media_type [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::MediaType] Media type used for estimate filtering (tweet_search_extractor) + # + # @param mentioning [String] Estimate tweets mentioning this username (tweet_search_extractor) + # + # @param min_faves [Integer] Minimum likes threshold for estimated results (tweet_search_extractor) + # + # @param min_quotes [Integer] Minimum quote count threshold for estimated results (tweet_search_extractor) + # + # @param min_replies [Integer] Minimum replies threshold for estimated results (tweet_search_extractor) # - # @param search_query [String] + # @param min_retweets [Integer] Minimum retweets threshold for estimated results (tweet_search_extractor) # - # @param target_community_id [String] + # @param place [String] Estimate search results within this place ID (tweet_search_extractor) # - # @param target_list_id [String] + # @param place_country [String] Estimate search results within this country code (tweet_search_extractor) # - # @param target_space_id [String] + # @param point_radius [String] Geo point radius used for estimation, e.g. -73.99 40.73 25mi (tweet_search_extra + # + # @param quotes [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Quotes] Quote mode used for estimation (tweet_search_extractor) + # + # @param quotes_of_tweet_id [String] Estimate only quotes of this tweet ID (tweet_search_extractor) + # + # @param replies [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Replies] Reply mode used for estimation (tweet_search_extractor) + # + # @param results_limit [Integer] Maximum number of results to estimate. When set, the estimate caps projected res + # + # @param retweets [Symbol, XTwitterScraper::Models::ExtractionEstimateCostParams::Retweets] Retweet mode used for estimation (tweet_search_extractor) + # + # @param retweets_of_tweet_id [String] Estimate only retweets of this tweet ID (tweet_search_extractor) + # + # @param search_query [String] Required for tweet_search_extractor & community_search. + # + # @param since_date [Date] Estimate start date in YYYY-MM-DD format (tweet_search_extractor) + # + # @param target_community_id [String] Required for community_post_extractor & community_search. + # + # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # + # @param target_space_id [String] Required for space_explorer. # # @param target_tweet_id [String] # # @param target_username [String] # + # @param to_user [String] Estimate replies sent to this username (tweet_search_extractor) + # + # @param until_date [Date] Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + # + # @param url [String] URL substring or domain filter used for estimation (tweet_search_extractor) + # + # @param verified_only [Boolean] Estimate only verified authors (tweet_search_extractor) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::ExtractionEstimateCostResponse] @@ -102,7 +166,7 @@ def estimate_cost(params) # Export extraction results # - # @overload export_results(id, format_: nil, request_options: {}) + # @overload export_results(id, format_:, request_options: {}) # # @param id [String] Extraction public ID # @@ -113,7 +177,7 @@ def estimate_cost(params) # @return [StringIO] # # @see XTwitterScraper::Models::ExtractionExportResultsParams - def export_results(id, params = {}) + def export_results(id, params) parsed, options = XTwitterScraper::ExtractionExportResultsParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( @@ -126,30 +190,91 @@ def export_results(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::ExtractionRunParams} for more details. + # # Run extraction # - # @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: {}) + # @overload run(tool_type:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, results_limit: nil, retweets: nil, retweets_of_tweet_id: nil, search_query: nil, since_date: nil, target_community_id: nil, target_list_id: nil, target_space_id: nil, target_tweet_id: nil, target_username: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # # @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) # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param bounding_box [String] Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @param conversation_id [String] Conversation ID filter (tweet_search_extractor) + # # @param exact_phrase [String] Exact phrase to match (tweet_search_extractor) # - # @param exclude_words [String] Words to exclude from results (tweet_search_extractor) + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. (twe + # + # @param from_user [String] Filter by author username (tweet_search_extractor) + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID (tweet_search_extractor) + # + # @param language [String] Language code filter (tweet_search_extractor) + # + # @param list_id [String] Search within a list ID (tweet_search_extractor) + # + # @param media_type [Symbol, XTwitterScraper::Models::ExtractionRunParams::MediaType] Media type filter (tweet_search_extractor) + # + # @param mentioning [String] Filter tweets mentioning a username (tweet_search_extractor) + # + # @param min_faves [Integer] Minimum likes threshold (tweet_search_extractor) + # + # @param min_quotes [Integer] Minimum quote count threshold (tweet_search_extractor) + # + # @param min_replies [Integer] Minimum replies threshold (tweet_search_extractor) # - # @param search_query [String] + # @param min_retweets [Integer] Minimum retweets threshold (tweet_search_extractor) # - # @param target_community_id [String] + # @param place [String] Search within a place ID (tweet_search_extractor) # - # @param target_list_id [String] + # @param place_country [String] Search within a country code (tweet_search_extractor) # - # @param target_space_id [String] + # @param point_radius [String] Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + # + # @param quotes [Symbol, XTwitterScraper::Models::ExtractionRunParams::Quotes] Quote mode (tweet_search_extractor) + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID (tweet_search_extractor) + # + # @param replies [Symbol, XTwitterScraper::Models::ExtractionRunParams::Replies] Reply mode (tweet_search_extractor) + # + # @param results_limit [Integer] Maximum number of results to extract. When set, the extraction stops after reach + # + # @param retweets [Symbol, XTwitterScraper::Models::ExtractionRunParams::Retweets] Retweet mode (tweet_search_extractor) + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID (tweet_search_extractor) + # + # @param search_query [String] Required for tweet_search_extractor & community_search. + # + # @param since_date [Date] Start date YYYY-MM-DD (tweet_search_extractor) + # + # @param target_community_id [String] Required for community_post_extractor & community_search. + # + # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # + # @param target_space_id [String] Required for space_explorer. # # @param target_tweet_id [String] # # @param target_username [String] # + # @param to_user [String] Filter replies sent to a username (tweet_search_extractor) + # + # @param until_date [Date] End date YYYY-MM-DD (tweet_search_extractor) + # + # @param url [String] URL substring or domain filter (tweet_search_extractor) + # + # @param verified_only [Boolean] Only verified authors (tweet_search_extractor) + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::ExtractionRunResponse] diff --git a/lib/x_twitter_scraper/resources/guest_wallets.rb b/lib/x_twitter_scraper/resources/guest_wallets.rb new file mode 100644 index 0000000..6a226f5 --- /dev/null +++ b/lib/x_twitter_scraper/resources/guest_wallets.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Resources + # Accountless prepaid access for paid read endpoints + class GuestWallets + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::GuestWalletCreateParams} for more details. + # + # Create a one-use Stripe-hosted checkout after the user explicitly confirms a + # $10-$250 USD amount. This request creates no charge by itself. The user opens + # checkout_url on Stripe. This endpoint returns the paid-read API key without + # requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent + # replay returns the same key. + # + # @overload create(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) + # + # @param amount_minor [Integer] Body param: Confirmed USD amount in cents. + # + # @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr + # + # @param currency [Symbol, :usd] Body param + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::GuestWalletCreateResponse] + # + # @see XTwitterScraper::Models::GuestWalletCreateParams + def create(params) + parsed, options = XTwitterScraper::GuestWalletCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "guest-wallets", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: XTwitterScraper::Models::GuestWalletCreateResponse, + security: {}, + options: options + ) + end + + # Poll after Stripe payment. Use usable to decide whether paid reads can run. An + # active wallet can remain usable while a top-up is pending. A new wallet becomes + # usable only after verified webhook fulfillment. Send the guest key as + # Authorization: Bearer. + # + # @overload retrieve_status(request_options: {}) + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::GuestWalletRetrieveStatusResponse] + # + # @see XTwitterScraper::Models::GuestWalletRetrieveStatusParams + def retrieve_status(params = {}) + @client.request( + method: :get, + path: "guest-wallets/status", + model: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse, + security: {auth_api_key: true}, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::GuestWalletTopupParams} for more details. + # + # Create a one-use Stripe-hosted checkout for an existing paid-read guest key + # after the user explicitly confirms a $10-$250 USD amount. The key remains the + # same. This request creates no charge by itself and never redirects through an + # Xquik web page. + # + # @overload topup(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) + # + # @param amount_minor [Integer] Body param: Confirmed USD amount in cents. + # + # @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr + # + # @param currency [Symbol, :usd] Body param + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::GuestWalletTopupResponse] + # + # @see XTwitterScraper::Models::GuestWalletTopupParams + def topup(params) + parsed, options = XTwitterScraper::GuestWalletTopupParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "guest-wallets/topups", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: XTwitterScraper::Models::GuestWalletTopupResponse, + security: {auth_api_key: true}, + options: options + ) + end + + # @api private + # + # @param client [XTwitterScraper::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/x_twitter_scraper/resources/monitors.rb b/lib/x_twitter_scraper/resources/monitors.rb index a1f279c..df96252 100644 --- a/lib/x_twitter_scraper/resources/monitors.rb +++ b/lib/x_twitter_scraper/resources/monitors.rb @@ -4,7 +4,14 @@ module XTwitterScraper module Resources # Real-time X account monitoring class Monitors - # Create monitor + # Real-time X account monitoring + # @return [XTwitterScraper::Resources::Monitors::Keywords] + attr_reader :keywords + + # Creates an instant monitor. Monitors are unlimited. Active monitors check every + # 1 second and cost 21 credits per hour. Events and webhook deliveries are + # included. Creation requires available credits for the first hourly charge and + # username lookup. # # @overload create(event_types:, username:, request_options: {}) # @@ -32,7 +39,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -52,7 +59,7 @@ def retrieve(id, params = {}) # # @overload update(id, event_types: nil, is_active: nil, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param event_types [Array] Array of event types to subscribe to. # @@ -92,11 +99,11 @@ def list(params = {}) ) end - # Deactivate monitor + # Delete monitor # # @overload deactivate(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -117,6 +124,7 @@ def deactivate(id, params = {}) # @param client [XTwitterScraper::Client] def initialize(client:) @client = client + @keywords = XTwitterScraper::Resources::Monitors::Keywords.new(client: client) end end end diff --git a/lib/x_twitter_scraper/resources/monitors/keywords.rb b/lib/x_twitter_scraper/resources/monitors/keywords.rb new file mode 100644 index 0000000..1b07cf4 --- /dev/null +++ b/lib/x_twitter_scraper/resources/monitors/keywords.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Resources + class Monitors + # Real-time X account monitoring + class Keywords + # Creates an instant keyword monitor. Keyword monitors are unlimited. Active + # monitors check every 1 second and cost 21 credits per hour. Events and webhook + # deliveries are included. Creation requires available credits for the first + # hourly charge. + # + # @overload create(event_types:, query:, request_options: {}) + # + # @param event_types [Array] Array of event types to subscribe to. + # + # @param query [String] X search query to monitor. Whitespace is normalized. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::Monitors::KeywordCreateResponse] + # + # @see XTwitterScraper::Models::Monitors::KeywordCreateParams + def create(params) + parsed, options = XTwitterScraper::Monitors::KeywordCreateParams.dump_request(params) + @client.request( + method: :post, + path: "monitors/keywords", + body: parsed, + model: XTwitterScraper::Models::Monitors::KeywordCreateResponse, + options: options + ) + end + + # Get keyword monitor + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] Resource ID returned by the matching create or list endpoint. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::Monitors::KeywordRetrieveResponse] + # + # @see XTwitterScraper::Models::Monitors::KeywordRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["monitors/keywords/%1$s", id], + model: XTwitterScraper::Models::Monitors::KeywordRetrieveResponse, + options: params[:request_options] + ) + end + + # Update keyword monitor + # + # @overload update(id, event_types: nil, is_active: nil, request_options: {}) + # + # @param id [String] Resource ID returned by the matching create or list endpoint. + # + # @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::Monitors::KeywordUpdateResponse] + # + # @see XTwitterScraper::Models::Monitors::KeywordUpdateParams + def update(id, params = {}) + parsed, options = XTwitterScraper::Monitors::KeywordUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["monitors/keywords/%1$s", id], + body: parsed, + model: XTwitterScraper::Models::Monitors::KeywordUpdateResponse, + options: options + ) + end + + # List keyword monitors + # + # @overload list(request_options: {}) + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::Monitors::KeywordListResponse] + # + # @see XTwitterScraper::Models::Monitors::KeywordListParams + def list(params = {}) + @client.request( + method: :get, + path: "monitors/keywords", + model: XTwitterScraper::Models::Monitors::KeywordListResponse, + options: params[:request_options] + ) + end + + # Delete keyword monitor + # + # @overload deactivate(id, request_options: {}) + # + # @param id [String] Resource ID returned by the matching create or list endpoint. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::Monitors::KeywordDeactivateResponse] + # + # @see XTwitterScraper::Models::Monitors::KeywordDeactivateParams + def deactivate(id, params = {}) + @client.request( + method: :delete, + path: ["monitors/keywords/%1$s", id], + model: XTwitterScraper::Models::Monitors::KeywordDeactivateResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [XTwitterScraper::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/x_twitter_scraper/resources/radar.rb b/lib/x_twitter_scraper/resources/radar.rb index dc85e64..257285a 100644 --- a/lib/x_twitter_scraper/resources/radar.rb +++ b/lib/x_twitter_scraper/resources/radar.rb @@ -15,11 +15,11 @@ class Radar # # @param category [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Category] Filter by category. # - # @param hours [Integer] Lookback window in hours (1-168, default 24). + # @param hours [Integer] Lookback window in hours (1-72, default 6). # # @param limit [Integer] Number of items to return (1-100, default 50). # - # @param region [String] Region filter (us, global, etc.) + # @param region [String] Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. # # @param source [Symbol, XTwitterScraper::Models::RadarRetrieveTrendingTopicsParams::Source] Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, t # diff --git a/lib/x_twitter_scraper/resources/subscribe.rb b/lib/x_twitter_scraper/resources/subscribe.rb index a9aa0ef..e9a5394 100644 --- a/lib/x_twitter_scraper/resources/subscribe.rb +++ b/lib/x_twitter_scraper/resources/subscribe.rb @@ -4,9 +4,12 @@ module XTwitterScraper module Resources # Subscription, billing, and credits class Subscribe - # Get checkout or billing URL + # Create a subscription checkout or billing-management URL only after the user + # confirms. The request never completes payment by itself. # - # @overload create(request_options: {}) + # @overload create(tier: nil, request_options: {}) + # + # @param tier [Symbol, XTwitterScraper::Models::SubscribeCreateParams::Tier] Subscription tier to pre-select. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -14,11 +17,13 @@ class Subscribe # # @see XTwitterScraper::Models::SubscribeCreateParams def create(params = {}) + parsed, options = XTwitterScraper::SubscribeCreateParams.dump_request(params) @client.request( method: :post, path: "subscribe", + body: parsed, model: XTwitterScraper::Models::SubscribeCreateResponse, - options: params[:request_options] + options: options ) end diff --git a/lib/x_twitter_scraper/resources/support/tickets.rb b/lib/x_twitter_scraper/resources/support/tickets.rb index 89eef61..00e6226 100644 --- a/lib/x_twitter_scraper/resources/support/tickets.rb +++ b/lib/x_twitter_scraper/resources/support/tickets.rb @@ -31,7 +31,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] Support ticket ID + # @param id [String] Support ticket public ID # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -51,7 +51,7 @@ def retrieve(id, params = {}) # # @overload update(id, status:, request_options: {}) # - # @param id [String] Support ticket ID to update + # @param id [String] Support ticket public ID to update # # @param status [Symbol, XTwitterScraper::Models::Support::TicketUpdateParams::Status] # @@ -93,7 +93,7 @@ def list(params = {}) # # @overload reply(id, body:, request_options: {}) # - # @param id [String] Support ticket ID for the reply + # @param id [String] Support ticket public ID for the reply # # @param body [String] # diff --git a/lib/x_twitter_scraper/resources/webhooks.rb b/lib/x_twitter_scraper/resources/webhooks.rb index 5d96ef4..629b8ad 100644 --- a/lib/x_twitter_scraper/resources/webhooks.rb +++ b/lib/x_twitter_scraper/resources/webhooks.rb @@ -32,7 +32,7 @@ def create(params) # # @overload update(id, event_types: nil, is_active: nil, url: nil, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param event_types [Array] Array of event types to subscribe to. # @@ -78,7 +78,7 @@ def list(params = {}) # # @overload deactivate(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -98,7 +98,7 @@ def deactivate(id, params = {}) # # @overload list_deliveries(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -114,11 +114,31 @@ def list_deliveries(id, params = {}) ) end + # Test and resume webhook endpoint + # + # @overload resume(id, request_options: {}) + # + # @param id [String] Resource ID returned by the matching create or list endpoint. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::WebhookResumeResponse] + # + # @see XTwitterScraper::Models::WebhookResumeParams + def resume(id, params = {}) + @client.request( + method: :post, + path: ["webhooks/%1$s/resume", id], + model: XTwitterScraper::Models::WebhookResumeResponse, + options: params[:request_options] + ) + end + # Test webhook endpoint # # @overload test_(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x.rb b/lib/x_twitter_scraper/resources/x.rb index 1b44dce..90eef37 100644 --- a/lib/x_twitter_scraper/resources/x.rb +++ b/lib/x_twitter_scraper/resources/x.rb @@ -3,10 +3,13 @@ module XTwitterScraper module Resources class X + # X write actions (tweets, likes, follows, DMs) + # @return [XTwitterScraper::Resources::X::WriteActions] + attr_reader :write_actions + # @return [XTwitterScraper::Resources::X::Tweets] attr_reader :tweets - # Look up, search, and explore user profiles and relationships # @return [XTwitterScraper::Resources::X::Users] attr_reader :users @@ -32,6 +35,10 @@ class X # @return [XTwitterScraper::Resources::X::Accounts] attr_reader :accounts + # Connected X account management + # @return [XTwitterScraper::Resources::X::AccountConnectionChallenges] + attr_reader :account_connection_challenges + # Look up, search, and analyze individual tweets # @return [XTwitterScraper::Resources::X::Bookmarks] attr_reader :bookmarks @@ -40,11 +47,15 @@ class X # @return [XTwitterScraper::Resources::X::Lists] attr_reader :lists - # Retrieve the full content of an X Article (long-form post) by tweet ID. + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::XGetArticleParams} for more details. + # + # Retrieve the full content of an X Article (long-form post) by numeric tweet ID. + # Returns article_not_found when the tweet is valid but is not an X Article. # # @overload get_article(tweet_id, request_options: {}) # - # @param tweet_id [String] Tweet ID of the article + # @param tweet_id [String] Numeric tweet ID of the article, 15-20 digits. If you have a tweet URL, use the # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -66,7 +77,7 @@ def get_article(tweet_id, params = {}) # # @param cursor [String] Pagination cursor for timeline # - # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results + # @param seen_tweet_ids [String] Comma-separated tweet IDs to exclude from results. Empty entries are ignored. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -91,7 +102,7 @@ def get_home_timeline(params = {}) # # @param cursor [String] Pagination cursor for notifications # - # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter + # @param type [Symbol, XTwitterScraper::Models::XGetNotificationsParams::Type] Notification type filter. Unrecognized values fall back to All. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -140,6 +151,7 @@ def get_trends(params = {}) # @param client [XTwitterScraper::Client] def initialize(client:) @client = client + @write_actions = XTwitterScraper::Resources::X::WriteActions.new(client: client) @tweets = XTwitterScraper::Resources::X::Tweets.new(client: client) @users = XTwitterScraper::Resources::X::Users.new(client: client) @followers = XTwitterScraper::Resources::X::Followers.new(client: client) @@ -148,6 +160,8 @@ def initialize(client:) @profile = XTwitterScraper::Resources::X::Profile.new(client: client) @communities = XTwitterScraper::Resources::X::Communities.new(client: client) @accounts = XTwitterScraper::Resources::X::Accounts.new(client: client) + @account_connection_challenges = + XTwitterScraper::Resources::X::AccountConnectionChallenges.new(client: client) @bookmarks = XTwitterScraper::Resources::X::Bookmarks.new(client: client) @lists = XTwitterScraper::Resources::X::Lists.new(client: client) end diff --git a/lib/x_twitter_scraper/resources/x/account_connection_challenges.rb b/lib/x_twitter_scraper/resources/x/account_connection_challenges.rb new file mode 100644 index 0000000..0812f03 --- /dev/null +++ b/lib/x_twitter_scraper/resources/x/account_connection_challenges.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Resources + class X + # Connected X account management + class AccountConnectionChallenges + # Submit X account email verification code + # + # @overload submit(id, email_code:, request_options: {}) + # + # @param id [String] Resource ID returned by the matching create or list endpoint. + # + # @param email_code [String] Code sent to the account email. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse] + # + # @see XTwitterScraper::Models::X::AccountConnectionChallengeSubmitParams + def submit(id, params) + parsed, options = XTwitterScraper::X::AccountConnectionChallengeSubmitParams.dump_request(params) + @client.request( + method: :post, + path: ["x/account-connection-challenges/%1$s/submit", id], + body: parsed, + model: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse, + options: options + ) + end + + # @api private + # + # @param client [XTwitterScraper::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/x_twitter_scraper/resources/x/accounts.rb b/lib/x_twitter_scraper/resources/x/accounts.rb index 1bcc4ca..3418248 100644 --- a/lib/x_twitter_scraper/resources/x/accounts.rb +++ b/lib/x_twitter_scraper/resources/x/accounts.rb @@ -7,7 +7,7 @@ class X class Accounts # Connect X account # - # @overload create(email:, password:, username:, proxy_country: nil, totp_secret: nil, request_options: {}) + # @overload create(email:, password:, username:, totp_secret: nil, request_options: {}) # # @param email [String] Account email # @@ -15,8 +15,6 @@ class Accounts # # @param username [String] X username # - # @param proxy_country [String] Proxy country code - # # @param totp_secret [String] TOTP secret for 2FA # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] @@ -39,7 +37,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -77,7 +75,7 @@ def list(params = {}) # # @overload delete(id, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -114,16 +112,14 @@ def bulk_retry(params = {}) # Re-authenticate X account # - # @overload reauth(id, password:, email: nil, proxy_country: nil, totp_secret: nil, request_options: {}) + # @overload reauth(id, password:, email: nil, totp_secret: nil, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param password [String] Updated account password # # @param email [String] Email for the X account (updates stored email) # - # @param proxy_country [String] Two-letter country code for login proxy region - # # @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/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index 7de9202..fc5bc66 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -42,7 +42,7 @@ def create(params) # # @overload delete(id, account:, community_name:, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param account [String] X account (@username or ID) deleting the community # @@ -84,6 +84,9 @@ def retrieve_info(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityRetrieveMembersParams} for more details. + # # List members of a community # # @overload retrieve_members(id, cursor: nil, page_size: nil, request_options: {}) @@ -92,7 +95,7 @@ def retrieve_info(id, params = {}) # # @param cursor [String] Pagination cursor # - # @param page_size [Integer] Items per page (20-200, default 20) + # @param page_size [Integer] Items per page (20-200, default 20). This is an upper bound for paid authenticat # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -136,15 +139,22 @@ def retrieve_moderators(id, params = {}) ) end - # Search for communities by keyword + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityRetrieveSearchParams} for more details. + # + # Returns tweets, not community records. Requires a Community ID. # - # @overload retrieve_search(q:, cursor: nil, query_type: nil, request_options: {}) + # @overload retrieve_search(community_id:, q:, cursor: nil, page_size: nil, query_type: nil, request_options: {}) + # + # @param community_id [String] Numeric ID of the community whose posts to search # # @param q [String] Search query # # @param cursor [String] Pagination cursor for community search # - # @param query_type [String] Sort order (Latest or Top) + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param query_type [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType] Sort order (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -157,7 +167,11 @@ def retrieve_search(params) @client.request( method: :get, path: "x/communities/search", - query: query.transform_keys(query_type: "queryType"), + query: query.transform_keys( + community_id: "communityId", + page_size: "pageSize", + query_type: "queryType" + ), model: XTwitterScraper::PaginatedTweets, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/communities/join.rb b/lib/x_twitter_scraper/resources/x/communities/join.rb index 5f6a8fd..e14bf34 100644 --- a/lib/x_twitter_scraper/resources/x/communities/join.rb +++ b/lib/x_twitter_scraper/resources/x/communities/join.rb @@ -10,13 +10,13 @@ class Join # # @overload create(id, account:, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::CommunityActionResult] + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse] # # @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::X::CommunityActionResult, + model: XTwitterScraper::Models::X::Communities::JoinCreateResponse, options: options ) end @@ -34,13 +34,13 @@ def create(id, params) # # @overload delete_all(id, account:, request_options: {}) # - # @param id [String] Resource ID (stringified bigint) + # @param id [String] Resource ID returned by the matching create or list endpoint. # # @param account [String] X account identifier (@username or account ID) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::CommunityActionResult] + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse] # # @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::X::CommunityActionResult, + model: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse, 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 d268fd9..b485dfe 100644 --- a/lib/x_twitter_scraper/resources/x/communities/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/communities/tweets.rb @@ -6,15 +6,22 @@ class X class Communities # X Community info, members, and tweets class Tweets - # List tweets across all communities + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::TweetListParams} for more details. # - # @overload list(q:, cursor: nil, query_type: nil, request_options: {}) + # Requires a Community ID and keyword query. # - # @param q [String] Search query for cross-community tweets + # @overload list(community_id:, q:, cursor: nil, page_size: nil, query_type: nil, request_options: {}) # - # @param cursor [String] Pagination cursor for cross-community results + # @param community_id [String] Numeric ID of the community to search # - # @param query_type [String] Sort order for cross-community results (Latest or Top) + # @param q [String] Keyword query within the selected community + # + # @param cursor [String] Pagination cursor for community results + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param query_type [Symbol, XTwitterScraper::Models::X::Communities::TweetListParams::QueryType] Sort order for community results (Latest or Top) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -27,20 +34,30 @@ def list(params) @client.request( method: :get, path: "x/communities/tweets", - query: query.transform_keys(query_type: "queryType"), + query: query.transform_keys( + community_id: "communityId", + page_size: "pageSize", + query_type: "queryType" + ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::TweetListByCommunityParams} for more + # details. + # # List tweets posted in a community # - # @overload list_by_community(id, cursor: nil, request_options: {}) + # @overload list_by_community(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] Community ID for tweet lookup # # @param cursor [String] Pagination cursor for community tweets # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -52,7 +69,7 @@ def list_by_community(id, params = {}) @client.request( method: :get, path: ["x/communities/%1$s/tweets", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedTweets, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/dm.rb b/lib/x_twitter_scraper/resources/x/dm.rb index 8cf352d..5743b22 100644 --- a/lib/x_twitter_scraper/resources/x/dm.rb +++ b/lib/x_twitter_scraper/resources/x/dm.rb @@ -4,12 +4,17 @@ module XTwitterScraper module Resources class X class Dm + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::DmRetrieveHistoryParams} for more details. + # # Get DM conversation history # - # @overload retrieve_history(user_id, cursor: nil, max_id: nil, request_options: {}) + # @overload retrieve_history(user_id, account:, cursor: nil, max_id: nil, request_options: {}) # # @param user_id [String] Target user ID # + # @param account [String] X handle (without the `@` prefix) of the connected X account used to read the co + # # @param cursor [String] Pagination cursor for DM history # # @param max_id [String] Legacy pagination cursor (backward compat) @@ -19,7 +24,7 @@ class Dm # @return [XTwitterScraper::Models::X::DmRetrieveHistoryResponse] # # @see XTwitterScraper::Models::X::DmRetrieveHistoryParams - def retrieve_history(user_id, params = {}) + def retrieve_history(user_id, params) parsed, options = XTwitterScraper::X::DmRetrieveHistoryParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( @@ -33,7 +38,7 @@ def retrieve_history(user_id, params = {}) # Send direct message # - # @overload send_(user_id, account:, text:, media_ids: nil, reply_to_message_id: nil, request_options: {}) + # @overload send_(user_id, account:, text:, media_ids: nil, request_options: {}) # # @param user_id [String] Recipient user ID # @@ -41,9 +46,7 @@ def retrieve_history(user_id, params = {}) # # @param text [String] # - # @param media_ids [Array] - # - # @param reply_to_message_id [String] + # @param media_ids [Array] Optional array containing exactly 1 uploaded media ID. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/followers.rb b/lib/x_twitter_scraper/resources/x/followers.rb index c5c1ec1..3977529 100644 --- a/lib/x_twitter_scraper/resources/x/followers.rb +++ b/lib/x_twitter_scraper/resources/x/followers.rb @@ -9,9 +9,9 @@ class Followers # # @overload check(source:, target:, request_options: {}) # - # @param source [String] Username to check (without @) + # @param source [String] Source username, @username, or X or Twitter profile URL # - # @param target [String] Target username (without @) + # @param target [String] Target username, @username, or X or Twitter profile URL # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/lists.rb b/lib/x_twitter_scraper/resources/x/lists.rb index 36e4299..f26f6cd 100644 --- a/lib/x_twitter_scraper/resources/x/lists.rb +++ b/lib/x_twitter_scraper/resources/x/lists.rb @@ -5,14 +5,19 @@ module Resources class X # X List followers, members, and tweets class Lists + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ListRetrieveFollowersParams} for more details. + # # List followers of an X List # - # @overload retrieve_followers(id, cursor: nil, request_options: {}) + # @overload retrieve_followers(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] List ID # # @param cursor [String] Pagination cursor for list followers # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -24,7 +29,7 @@ def retrieve_followers(id, params = {}) @client.request( method: :get, path: ["x/lists/%1$s/followers", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) @@ -57,9 +62,12 @@ def retrieve_members(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ListRetrieveTweetsParams} for more details. + # # List tweets from an X List # - # @overload retrieve_tweets(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) + # @overload retrieve_tweets(id, cursor: nil, include_replies: nil, page_size: nil, since_time: nil, until_time: nil, request_options: {}) # # @param id [String] List ID for tweet lookup # @@ -67,6 +75,8 @@ def retrieve_members(id, params = {}) # # @param include_replies [Boolean] Include replies (default false) # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @param since_time [String] Unix timestamp - filter after # # @param until_time [String] Unix timestamp - filter before @@ -84,6 +94,7 @@ def retrieve_tweets(id, params = {}) path: ["x/lists/%1$s/tweets", id], query: query.transform_keys( include_replies: "includeReplies", + page_size: "pageSize", since_time: "sinceTime", until_time: "untilTime" ), diff --git a/lib/x_twitter_scraper/resources/x/media.rb b/lib/x_twitter_scraper/resources/x/media.rb index 6545393..efd3343 100644 --- a/lib/x_twitter_scraper/resources/x/media.rb +++ b/lib/x_twitter_scraper/resources/x/media.rb @@ -7,12 +7,16 @@ class X class Media # Download images & videos from tweets # - # @overload download(tweet_ids: nil, tweet_input: nil, request_options: {}) + # @overload download(tweet_id: nil, tweet_ids: nil, tweet_input: nil, tweet_url: nil, request_options: {}) # - # @param tweet_ids [Array] Array of tweet URLs or IDs (bulk, max 50) + # @param tweet_id [String] Numeric tweet ID alias for tweetInput + # + # @param tweet_ids [Array] Array of tweet URLs or IDs (bulk, max 50 string items) # # @param tweet_input [String] Tweet URL or ID (single tweet) # + # @param tweet_url [String] Tweet URL alias for tweetInput + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::X::MediaDownloadResponse] @@ -31,13 +35,11 @@ def download(params = {}) # Upload media # - # @overload upload(account:, file:, is_long_video: nil, request_options: {}) - # - # @param account [String] X account (@username or ID) uploading media + # @overload upload(account:, url:, request_options: {}) # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Media file to upload + # @param account [String] X account (@username or ID) uploading media from URL # - # @param is_long_video [Boolean] + # @param url [String] HTTPS URL to download and upload as media # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/profile.rb b/lib/x_twitter_scraper/resources/x/profile.rb index cafdcb9..3c8726d 100644 --- a/lib/x_twitter_scraper/resources/x/profile.rb +++ b/lib/x_twitter_scraper/resources/x/profile.rb @@ -37,11 +37,11 @@ def update(params) # Update profile avatar # - # @overload update_avatar(account:, file:, request_options: {}) + # @overload update_avatar(account:, url:, request_options: {}) # - # @param account [String] X account (@username or ID) for avatar update + # @param account [String] X account (@username or ID) receiving avatar from URL # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Avatar image (max 716KB) + # @param url [String] HTTPS URL to the avatar image to download # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -62,11 +62,11 @@ def update_avatar(params) # Update profile banner # - # @overload update_banner(account:, file:, request_options: {}) + # @overload update_banner(account:, url:, request_options: {}) # - # @param account [String] X account (@username or ID) for banner update + # @param account [String] X account (@username or ID) receiving banner from URL # - # @param file [Pathname, StringIO, IO, String, XTwitterScraper::FilePart] Banner image (max 2MB) + # @param url [String] HTTPS URL to the banner image to download # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index 777260d..ee33a08 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -27,7 +27,7 @@ class Tweets # # @param is_note_tweet [Boolean] # - # @param media [Array] Array of public image URLs to attach (max 4). Each URL must be publicly reachabl + # @param media [Array] Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 v # # @param reply_to_tweet_id [String] # @@ -53,7 +53,7 @@ def create(params) # # @overload retrieve(id, request_options: {}) # - # @param id [String] Tweet ID + # @param id [String] Numeric tweet ID, 15-20 digits # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -116,14 +116,19 @@ def delete(id, params) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetFavoritersParams} for more details. + # # List users who liked a tweet # - # @overload get_favoriters(id, cursor: nil, request_options: {}) + # @overload get_favoriters(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] Tweet ID to get favoriters # # @param cursor [String] Pagination cursor for favoriters # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -135,26 +140,81 @@ def get_favoriters(id, params = {}) @client.request( method: :get, path: ["x/tweets/%1$s/favoriters", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetQuotesParams} for more details. + # # List quote tweets of a tweet # - # @overload get_quotes(id, cursor: nil, include_replies: nil, since_time: nil, until_time: nil, request_options: {}) + # @overload get_quotes(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_replies: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # + # @param id [String] Numeric tweet ID to get quotes, 15-20 digits # - # @param id [String] Tweet ID to get quotes + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. # # @param cursor [String] Pagination cursor for quote tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # # @param include_replies [Boolean] Include reply quotes (default false) # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return quotes posted after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return quotes posted before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -167,27 +227,100 @@ def get_quotes(id, params = {}) method: :get, path: ["x/tweets/%1$s/quotes", id], query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", include_replies: "includeReplies", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", since_time: "sinceTime", - until_time: "untilTime" + to_user: "toUser", + until_date: "untilDate", + until_time: "untilTime", + verified_only: "verifiedOnly" ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetRepliesParams} for more details. + # # List replies to a tweet # - # @overload get_replies(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) + # @overload get_replies(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # # @param id [String] Tweet ID to get replies # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for tweet replies # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return replies posted after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return replies posted before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -199,20 +332,46 @@ def get_replies(id, params = {}) @client.request( method: :get, path: ["x/tweets/%1$s/replies", id], - query: query.transform_keys(since_time: "sinceTime", until_time: "untilTime"), + query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + since_time: "sinceTime", + to_user: "toUser", + until_date: "untilDate", + until_time: "untilTime", + verified_only: "verifiedOnly" + ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetRetweetersParams} for more details. + # # List users who retweeted a tweet # - # @overload get_retweeters(id, cursor: nil, request_options: {}) + # @overload get_retweeters(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] Tweet ID to get retweeters # # @param cursor [String] Pagination cursor for retweeters # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -224,20 +383,25 @@ def get_retweeters(id, params = {}) @client.request( method: :get, path: ["x/tweets/%1$s/retweeters", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetGetThreadParams} for more details. + # # Get full conversation thread for a tweet # - # @overload get_thread(id, cursor: nil, request_options: {}) + # @overload get_thread(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] Tweet ID to get thread context # # @param cursor [String] Pagination cursor for thread tweets # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -249,28 +413,93 @@ def get_thread(id, params = {}) @client.request( method: :get, path: ["x/tweets/%1$s/thread", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedTweets, options: options ) end - # Search tweets with X query operators & pagination + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetSearchParams} for more details. # - # @overload search(q:, cursor: nil, limit: nil, query_type: nil, since_time: nil, until_time: nil, request_options: {}) + # Search tweets by query, Tweet ID, X status URL, or account date window + # + # @overload search(q:, advanced_query: nil, any_words: nil, bounding_box: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, limit: nil, list_id: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, place: nil, place_country: nil, point_radius: nil, query_type: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # # @param q [String] Search query (keywords, # + # @param advanced_query [String] Raw advanced search query appended as-is. + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param bounding_box [String] Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor from previous response # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # # @param limit [Integer] Max tweets to return (server paginates internally). Omit for single page (~20). # + # @param list_id [String] Search within a list ID. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param place [String] Search within a place ID. + # + # @param place_country [String] Search within a country code. + # + # @param point_radius [String] Geo point radius, e.g. -73.99 40.73 25mi. + # # @param query_type [Symbol, XTwitterScraper::Models::X::TweetSearchParams::QueryType] Sort order - Latest (chronological) or Top (engagement-ranked) # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetSearchParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] ISO 8601 timestamp - only return tweets after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] ISO 8601 timestamp - only return tweets before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -283,9 +512,31 @@ def search(params) method: :get, path: "x/tweets/search", query: query.transform_keys( + advanced_query: "advancedQuery", + any_words: "anyWords", + bounding_box: "boundingBox", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + list_id: "listId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + place_country: "placeCountry", + point_radius: "pointRadius", query_type: "queryType", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", since_time: "sinceTime", - until_time: "untilTime" + to_user: "toUser", + until_date: "untilDate", + until_time: "untilTime", + verified_only: "verifiedOnly" ), model: XTwitterScraper::PaginatedTweets, options: options diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index f9e7067..43310a8 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -3,7 +3,6 @@ module XTwitterScraper module Resources class X - # Look up, search, and explore user profiles and relationships class Users # X write actions (tweets, likes, follows, DMs) # @return [XTwitterScraper::Resources::X::Users::Follow] @@ -29,15 +28,42 @@ def retrieve(id, params = {}) ) end + # Remove follower + # + # @overload remove_follower(id, account:, request_options: {}) + # + # @param id [String] User ID to remove from your followers + # + # @param account [String] X account identifier (@username or account ID) + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse] + # + # @see XTwitterScraper::Models::X::UserRemoveFollowerParams + def remove_follower(id, params) + parsed, options = XTwitterScraper::X::UserRemoveFollowerParams.dump_request(params) + @client.request( + method: :post, + path: ["x/users/%1$s/remove-follower", id], + body: parsed, + model: XTwitterScraper::Models::X::UserRemoveFollowerResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveBatchParams} for more details. + # # Look up multiple users by IDs in one call # # @overload retrieve_batch(ids:, request_options: {}) # - # @param ids [String] Comma-separated user IDs (max 100) + # @param ids [String] Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::PaginatedUsers] + # @return [XTwitterScraper::Models::X::UserRetrieveBatchResponse] # # @see XTwitterScraper::Models::X::UserRetrieveBatchParams def retrieve_batch(params) @@ -47,20 +73,27 @@ def retrieve_batch(params) method: :get, path: "x/users/batch", query: query, - model: XTwitterScraper::PaginatedUsers, + model: XTwitterScraper::Models::X::UserRetrieveBatchResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowersParams} for more details. + # # List followers of a user # - # @overload retrieve_followers(id, cursor: nil, page_size: nil, request_options: {}) + # @overload retrieve_followers(id, after: nil, cursor: nil, limit: nil, page_size: nil, request_options: {}) # # @param id [String] User ID or username # + # @param after [String] Legacy cursor alias. Prefer cursor. + # # @param cursor [String] Pagination cursor for followers list # - # @param page_size [Integer] Items per page (20-200, default 200) + # @param limit [Integer] Legacy integer page size alias for following lists. Prefer pageSize. + # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -79,14 +112,20 @@ def retrieve_followers(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowersYouKnowParams} for more + # details. + # # List mutual followers between you and a user # - # @overload retrieve_followers_you_know(id, cursor: nil, request_options: {}) + # @overload retrieve_followers_you_know(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] User ID for followers-you-know lookup # # @param cursor [String] Pagination cursor for followers-you-know # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -98,21 +137,28 @@ def retrieve_followers_you_know(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s/followers-you-know", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveFollowingParams} for more details. + # # List accounts a user follows # - # @overload retrieve_following(id, cursor: nil, page_size: nil, request_options: {}) + # @overload retrieve_following(id, after: nil, cursor: nil, limit: nil, page_size: nil, request_options: {}) # # @param id [String] User ID or username for following lookup # + # @param after [String] Legacy cursor alias. Prefer cursor. + # # @param cursor [String] Pagination cursor for following list # - # @param page_size [Integer] Results per page (20-200, default 200) + # @param limit [Integer] Legacy page size alias. Prefer pageSize. + # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -131,14 +177,69 @@ def retrieve_following(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveLikesParams} for more details. + # # List tweets liked by a user # - # @overload retrieve_likes(id, cursor: nil, request_options: {}) + # @overload retrieve_likes(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # + # @param id [String] User ID or username + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. # - # @param id [String] User ID + # @param conversation_id [String] Conversation ID filter. # # @param cursor [String] Pagination cursor for liked tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -150,20 +251,94 @@ def retrieve_likes(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s/likes", id], - query: query, + query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + to_user: "toUser", + until_date: "untilDate", + verified_only: "verifiedOnly" + ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveMediaParams} for more details. + # # List media tweets posted by a user # - # @overload retrieve_media(id, cursor: nil, request_options: {}) + # @overload retrieve_media(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # + # @param id [String] User ID or username for media lookup + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o # - # @param id [String] User ID for media lookup + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. # # @param cursor [String] Pagination cursor for media tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -175,24 +350,98 @@ def retrieve_media(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s/media", id], - query: query, + query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + to_user: "toUser", + until_date: "untilDate", + verified_only: "verifiedOnly" + ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveMentionsParams} for more details. + # # List tweets mentioning a user # - # @overload retrieve_mentions(id, cursor: nil, since_time: nil, until_time: nil, request_options: {}) + # @overload retrieve_mentions(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # # @param id [String] User ID or username for mentions lookup # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for mentions # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # # @param since_time [String] Unix timestamp - return mentions after this time # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # # @param until_time [String] Unix timestamp - return mentions before this time # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -204,7 +453,130 @@ def retrieve_mentions(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s/mentions", id], - query: query.transform_keys(since_time: "sinceTime", until_time: "untilTime"), + query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + since_time: "sinceTime", + to_user: "toUser", + until_date: "untilDate", + until_time: "untilTime", + verified_only: "verifiedOnly" + ), + model: XTwitterScraper::PaginatedTweets, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveRepliesParams} for more details. + # + # Returns the user's timeline with replies included by default. + # + # @overload retrieve_replies(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_parent_tweet: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) + # + # @param id [String] X user ID or username + # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # + # @param cursor [String] Pagination cursor for user replies + # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param include_parent_tweet [Boolean] Include parent tweet for replies + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::PaginatedTweets] + # + # @see XTwitterScraper::Models::X::UserRetrieveRepliesParams + def retrieve_replies(id, params = {}) + parsed, options = XTwitterScraper::X::UserRetrieveRepliesParams.dump_request(params) + query = XTwitterScraper::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["x/users/%1$s/replies", id], + query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + include_parent_tweet: "includeParentTweet", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + to_user: "toUser", + until_date: "untilDate", + verified_only: "verifiedOnly" + ), model: XTwitterScraper::PaginatedTweets, options: options ) @@ -235,18 +607,73 @@ def retrieve_search(params) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveTweetsParams} for more details. + # # List recent tweets posted by a user # - # @overload retrieve_tweets(id, cursor: nil, include_parent_tweet: nil, include_replies: nil, request_options: {}) + # @overload retrieve_tweets(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_parent_tweet: nil, include_replies: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # # @param id [String] X user ID or username # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for user tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # # @param include_parent_tweet [Boolean] Include parent tweet for replies # # @param include_replies [Boolean] Include reply tweets # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_faves [Integer] Minimum likes threshold. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # + # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -259,22 +686,46 @@ def retrieve_tweets(id, params = {}) method: :get, path: ["x/users/%1$s/tweets", id], query: query.transform_keys( + any_words: "anyWords", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", include_parent_tweet: "includeParentTweet", - include_replies: "includeReplies" + include_replies: "includeReplies", + in_reply_to_tweet_id: "inReplyToTweetId", + media_type: "mediaType", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + to_user: "toUser", + until_date: "untilDate", + verified_only: "verifiedOnly" ), model: XTwitterScraper::PaginatedTweets, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRetrieveVerifiedFollowersParams} for more + # details. + # # List verified followers of a user # - # @overload retrieve_verified_followers(id, cursor: nil, request_options: {}) + # @overload retrieve_verified_followers(id, cursor: nil, page_size: nil, request_options: {}) # # @param id [String] User ID or username for verified followers # # @param cursor [String] Pagination cursor for verified followers # + # @param page_size [Integer] Maximum user profiles requested from this page (20-200, default 200). The respon + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedUsers] @@ -286,7 +737,7 @@ def retrieve_verified_followers(id, params = {}) @client.request( method: :get, path: ["x/users/%1$s/verified-followers", id], - query: query, + query: query.transform_keys(page_size: "pageSize"), model: XTwitterScraper::PaginatedUsers, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/write_actions.rb b/lib/x_twitter_scraper/resources/x/write_actions.rb new file mode 100644 index 0000000..1c8f71c --- /dev/null +++ b/lib/x_twitter_scraper/resources/x/write_actions.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Resources + class X + # X write actions (tweets, likes, follows, DMs) + class WriteActions + # Get write action status + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] Write action ID returned by a pending write response. + # + # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse] + # + # @see XTwitterScraper::Models::X::WriteActionRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["x/write-actions/%1$s", id], + model: XTwitterScraper::Models::X::WriteActionRetrieveResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [XTwitterScraper::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/client.rbi b/rbi/x_twitter_scraper/client.rbi index 88a7076..9714958 100644 --- a/rbi/x_twitter_scraper/client.rbi +++ b/rbi/x_twitter_scraper/client.rbi @@ -21,10 +21,6 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::Account) } attr_reader :account - # API key management (session auth only) - sig { returns(XTwitterScraper::Resources::APIKeys) } - attr_reader :api_keys - # Subscription, billing, and credits sig { returns(XTwitterScraper::Resources::Subscribe) } attr_reader :subscribe @@ -53,7 +49,7 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::Events) } attr_reader :events - # Bulk data extraction (20 tool types) + # Bulk data extraction (23 tool types) sig { returns(XTwitterScraper::Resources::Extractions) } attr_reader :extractions @@ -79,9 +75,22 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::Credits) } attr_reader :credits + # Accountless prepaid access for paid read endpoints + sig { returns(XTwitterScraper::Resources::GuestWallets) } + attr_reader :guest_wallets + # @api private - sig { override.returns(T::Hash[String, String]) } - private def auth_headers + sig do + override + .params( + security: { + auth_api_key: T::Boolean, + oauth_bearer: T::Boolean + } + ) + .returns(T::Hash[String, String]) + end + private def auth_headers(security:) end # @api private diff --git a/rbi/x_twitter_scraper/internal/transport/base_client.rbi b/rbi/x_twitter_scraper/internal/transport/base_client.rbi index af0adf3..c8669de 100644 --- a/rbi/x_twitter_scraper/internal/transport/base_client.rbi +++ b/rbi/x_twitter_scraper/internal/transport/base_client.rbi @@ -52,6 +52,10 @@ module XTwitterScraper stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), + security: + T.nilable( + { auth_api_key: T::Boolean, oauth_bearer: T::Boolean } + ), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) } end @@ -240,7 +244,7 @@ module XTwitterScraper # Execute the request specified by `req`. This is the method that all resource # methods call into. # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, options: {}) + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, security: {auth_api_key: true, oauth_bearer: true}, options: {}) sig do params( method: Symbol, @@ -282,6 +286,8 @@ module XTwitterScraper ), stream: T.nilable(T::Class[T.anything]), model: T.nilable(XTwitterScraper::Internal::Type::Converter::Input), + security: + T.nilable({ auth_api_key: T::Boolean, oauth_bearer: T::Boolean }), options: T.nilable(XTwitterScraper::RequestOptions::OrHash) ).returns(T.anything) end @@ -295,6 +301,7 @@ module XTwitterScraper page: nil, stream: nil, model: XTwitterScraper::Internal::Type::Unknown, + security: { auth_api_key: true, oauth_bearer: true }, options: {} ) end diff --git a/rbi/x_twitter_scraper/models.rbi b/rbi/x_twitter_scraper/models.rbi index 2ace23b..4e423b8 100644 --- a/rbi/x_twitter_scraper/models.rbi +++ b/rbi/x_twitter_scraper/models.rbi @@ -7,19 +7,19 @@ module XTwitterScraper AccountUpdateLocaleParams = XTwitterScraper::Models::AccountUpdateLocaleParams - APIKey = XTwitterScraper::Models::APIKey - - APIKeyCreateParams = XTwitterScraper::Models::APIKeyCreateParams - - APIKeyListParams = XTwitterScraper::Models::APIKeyListParams + ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams - APIKeyRevokeParams = XTwitterScraper::Models::APIKeyRevokeParams + ContentDisclosure = XTwitterScraper::Models::ContentDisclosure - ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams + CreditRedirectTopupCheckoutParams = + XTwitterScraper::Models::CreditRedirectTopupCheckoutParams CreditRetrieveBalanceParams = XTwitterScraper::Models::CreditRetrieveBalanceParams + CreditRetrieveTopupStatusParams = + XTwitterScraper::Models::CreditRetrieveTopupStatusParams + CreditTopupBalanceParams = XTwitterScraper::Models::CreditTopupBalanceParams Delivery = XTwitterScraper::Models::Delivery @@ -48,6 +48,8 @@ module XTwitterScraper DrawRunParams = XTwitterScraper::Models::DrawRunParams + EmbeddedTweet = XTwitterScraper::Models::EmbeddedTweet + Error = XTwitterScraper::Models::Error Event = XTwitterScraper::Models::Event @@ -74,6 +76,15 @@ module XTwitterScraper ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams + GuestWalletAmount = XTwitterScraper::Models::GuestWalletAmount + + GuestWalletCreateParams = XTwitterScraper::Models::GuestWalletCreateParams + + GuestWalletRetrieveStatusParams = + XTwitterScraper::Models::GuestWalletRetrieveStatusParams + + GuestWalletTopupParams = XTwitterScraper::Models::GuestWalletTopupParams + Monitor = XTwitterScraper::Models::Monitor MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -84,6 +95,8 @@ module XTwitterScraper MonitorRetrieveParams = XTwitterScraper::Models::MonitorRetrieveParams + Monitors = XTwitterScraper::Models::Monitors + MonitorUpdateParams = XTwitterScraper::Models::MonitorUpdateParams PaginatedTweets = XTwitterScraper::Models::PaginatedTweets @@ -121,6 +134,8 @@ module XTwitterScraper TrendListParams = XTwitterScraper::Models::TrendListParams + TweetMedia = XTwitterScraper::Models::TweetMedia + UserProfile = XTwitterScraper::Models::UserProfile Webhook = XTwitterScraper::Models::Webhook @@ -134,6 +149,8 @@ module XTwitterScraper WebhookListParams = XTwitterScraper::Models::WebhookListParams + WebhookResumeParams = XTwitterScraper::Models::WebhookResumeParams + WebhookTestParams = XTwitterScraper::Models::WebhookTestParams WebhookUpdateParams = XTwitterScraper::Models::WebhookUpdateParams diff --git a/rbi/x_twitter_scraper/models/account_retrieve_response.rbi b/rbi/x_twitter_scraper/models/account_retrieve_response.rbi index 58d19ce..f8f5bfd 100644 --- a/rbi/x_twitter_scraper/models/account_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/account_retrieve_response.rbi @@ -11,6 +11,23 @@ module XTwitterScraper ) end + sig do + returns( + XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling + ) + end + attr_reader :monitor_billing + + sig do + params( + monitor_billing: + XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling::OrHash + ).void + end + attr_writer :monitor_billing + + # Deprecated. Monitor slots are unlimited, so this is always + # Number.MAX_SAFE_INTEGER. sig { returns(Integer) } attr_accessor :monitors_allowed @@ -50,6 +67,8 @@ module XTwitterScraper sig do params( + monitor_billing: + XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling::OrHash, monitors_allowed: Integer, monitors_used: Integer, plan: @@ -60,6 +79,9 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + monitor_billing:, + # Deprecated. Monitor slots are unlimited, so this is always + # Number.MAX_SAFE_INTEGER. monitors_allowed:, monitors_used:, plan:, @@ -72,6 +94,8 @@ module XTwitterScraper sig do override.returns( { + monitor_billing: + XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, monitors_allowed: Integer, monitors_used: Integer, plan: @@ -85,6 +109,89 @@ module XTwitterScraper def to_hash end + class MonitorBilling < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, + XTwitterScraper::Internal::AnyHash + ) + end + + # Estimated daily credits for currently active monitors. + sig { returns(String) } + attr_accessor :active_daily_estimate + + # Credits charged each hour for currently active monitors. + sig { returns(String) } + attr_accessor :active_hourly_burn + + # Estimated daily credits for 1 active instant monitor. + sig { returns(String) } + attr_accessor :credits_per_active_monitor_day + + # Hourly credits charged for 1 active instant monitor. + sig { returns(String) } + attr_accessor :credits_per_active_monitor_hour + + # Webhook and event deliveries are included in monitor billing. + sig { returns(T::Boolean) } + attr_accessor :events_included + + # Active monitors check every 1 second. + sig { returns(Integer) } + attr_accessor :instant_check_interval_seconds + + # Monitor slot count is unlimited. + sig { returns(T::Boolean) } + attr_accessor :unlimited_slots + + sig do + params( + active_daily_estimate: String, + active_hourly_burn: String, + credits_per_active_monitor_day: String, + credits_per_active_monitor_hour: String, + events_included: T::Boolean, + instant_check_interval_seconds: Integer, + unlimited_slots: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Estimated daily credits for currently active monitors. + active_daily_estimate:, + # Credits charged each hour for currently active monitors. + active_hourly_burn:, + # Estimated daily credits for 1 active instant monitor. + credits_per_active_monitor_day:, + # Hourly credits charged for 1 active instant monitor. + credits_per_active_monitor_hour:, + # Webhook and event deliveries are included in monitor billing. + events_included:, + # Active monitors check every 1 second. + instant_check_interval_seconds:, + # Monitor slot count is unlimited. + unlimited_slots: + ) + end + + sig do + override.returns( + { + active_daily_estimate: String, + active_hourly_burn: String, + credits_per_active_monitor_day: String, + credits_per_active_monitor_hour: String, + events_included: T::Boolean, + instant_check_interval_seconds: Integer, + unlimited_slots: T::Boolean + } + ) + end + def to_hash + end + end + module Plan extend XTwitterScraper::Internal::Type::Enum @@ -128,30 +235,50 @@ module XTwitterScraper ) end + # Dollar amount charged when automatic top-up runs. + sig { returns(Float) } + attr_accessor :auto_topup_amount_dollars + sig { returns(T::Boolean) } attr_accessor :auto_topup_enabled - sig { returns(Integer) } + # Bigint string threshold that triggers automatic top-up when enabled. + sig { returns(String) } + attr_accessor :auto_topup_threshold + + # Bigint string to preserve precision above Number.MAX_SAFE_INTEGER. + sig { returns(String) } attr_accessor :balance - sig { returns(Integer) } + # Total purchased credits as a bigint string. + sig { returns(String) } attr_accessor :lifetime_purchased - sig { returns(Integer) } + # Total consumed credits as a bigint string. + sig { returns(String) } attr_accessor :lifetime_used sig do params( + auto_topup_amount_dollars: Float, auto_topup_enabled: T::Boolean, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String ).returns(T.attached_class) end def self.new( + # Dollar amount charged when automatic top-up runs. + auto_topup_amount_dollars:, auto_topup_enabled:, + # Bigint string threshold that triggers automatic top-up when enabled. + auto_topup_threshold:, + # Bigint string to preserve precision above Number.MAX_SAFE_INTEGER. balance:, + # Total purchased credits as a bigint string. lifetime_purchased:, + # Total consumed credits as a bigint string. lifetime_used: ) end @@ -159,10 +286,12 @@ module XTwitterScraper sig do override.returns( { + auto_topup_amount_dollars: Float, auto_topup_enabled: T::Boolean, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } ) end diff --git a/rbi/x_twitter_scraper/models/api_key.rbi b/rbi/x_twitter_scraper/models/api_key.rbi deleted file mode 100644 index a6d9126..0000000 --- a/rbi/x_twitter_scraper/models/api_key.rbi +++ /dev/null @@ -1,69 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class APIKey < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(XTwitterScraper::APIKey, 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 - - # API key metadata returned when listing keys. - 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 diff --git a/rbi/x_twitter_scraper/models/api_key_create_response.rbi b/rbi/x_twitter_scraper/models/api_key_create_response.rbi deleted file mode 100644 index 2890734..0000000 --- a/rbi/x_twitter_scraper/models/api_key_create_response.rbi +++ /dev/null @@ -1,56 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class APIKeyCreateResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::APIKeyCreateResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(Time) } - attr_accessor :created_at - - sig { returns(String) } - attr_accessor :full_key - - sig { returns(String) } - attr_accessor :name - - sig { returns(String) } - attr_accessor :prefix - - sig do - params( - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - ).returns(T.attached_class) - end - def self.new(id:, created_at:, full_key:, name:, prefix:) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/api_key_list_response.rbi b/rbi/x_twitter_scraper/models/api_key_list_response.rbi deleted file mode 100644 index e8a3dd2..0000000 --- a/rbi/x_twitter_scraper/models/api_key_list_response.rbi +++ /dev/null @@ -1,30 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class APIKeyListResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::APIKeyListResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Array[XTwitterScraper::APIKey]) } - attr_accessor :keys - - sig do - params(keys: T::Array[XTwitterScraper::APIKey::OrHash]).returns( - T.attached_class - ) - end - def self.new(keys:) - end - - sig { override.returns({ keys: T::Array[XTwitterScraper::APIKey] }) } - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/api_key_revoke_response.rbi b/rbi/x_twitter_scraper/models/api_key_revoke_response.rbi deleted file mode 100644 index eeb7a7e..0000000 --- a/rbi/x_twitter_scraper/models/api_key_revoke_response.rbi +++ /dev/null @@ -1,26 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - class APIKeyRevokeResponse < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::Models::APIKeyRevokeResponse, - XTwitterScraper::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :success - - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) - end - - sig { override.returns({ success: T::Boolean }) } - def to_hash - end - end - end -end diff --git a/rbi/x_twitter_scraper/models/content_disclosure.rbi b/rbi/x_twitter_scraper/models/content_disclosure.rbi new file mode 100644 index 0000000..0c3ae33 --- /dev/null +++ b/rbi/x_twitter_scraper/models/content_disclosure.rbi @@ -0,0 +1,149 @@ +# typed: strong + +module XTwitterScraper + module Models + class ContentDisclosure < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::ContentDisclosure, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns(T.nilable(XTwitterScraper::ContentDisclosure::Advertising)) + end + attr_reader :advertising + + sig do + params( + advertising: XTwitterScraper::ContentDisclosure::Advertising::OrHash + ).void + end + attr_writer :advertising + + sig do + returns(T.nilable(XTwitterScraper::ContentDisclosure::AIGenerated)) + end + attr_reader :ai_generated + + sig do + params( + ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated::OrHash + ).void + end + attr_writer :ai_generated + + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + sig do + params( + advertising: XTwitterScraper::ContentDisclosure::Advertising::OrHash, + ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated::OrHash + ).returns(T.attached_class) + end + def self.new(advertising: nil, ai_generated: nil) + end + + sig do + override.returns( + { + advertising: XTwitterScraper::ContentDisclosure::Advertising, + ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated + } + ) + end + def to_hash + end + + class Advertising < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::ContentDisclosure::Advertising, + XTwitterScraper::Internal::AnyHash + ) + end + + # True when X labels the tweet as paid promotion content. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_paid_promotion + + sig { params(is_paid_promotion: T::Boolean).void } + attr_writer :is_paid_promotion + + sig { params(is_paid_promotion: T::Boolean).returns(T.attached_class) } + def self.new( + # True when X labels the tweet as paid promotion content. + is_paid_promotion: nil + ) + end + + sig { override.returns({ is_paid_promotion: T::Boolean }) } + def to_hash + end + end + + class AIGenerated < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::ContentDisclosure::AIGenerated, + XTwitterScraper::Internal::AnyHash + ) + end + + # Whether the disclosure can be edited on X. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :can_edit + + sig { params(can_edit: T::Boolean).void } + attr_writer :can_edit + + # Source of the AI-generated media disclosure. + sig { returns(T.nilable(String)) } + attr_reader :detection_source + + sig { params(detection_source: String).void } + attr_writer :detection_source + + # True when X labels the tweet as containing AI-generated media. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_ai_generated_media + + sig { params(has_ai_generated_media: T::Boolean).void } + attr_writer :has_ai_generated_media + + sig do + params( + can_edit: T::Boolean, + detection_source: String, + has_ai_generated_media: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Whether the disclosure can be edited on X. + can_edit: nil, + # Source of the AI-generated media disclosure. + detection_source: nil, + # True when X labels the tweet as containing AI-generated media. + has_ai_generated_media: nil + ) + end + + sig do + override.returns( + { + can_edit: T::Boolean, + detection_source: String, + has_ai_generated_media: T::Boolean + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbi b/rbi/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbi new file mode 100644 index 0000000..d092320 --- /dev/null +++ b/rbi/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module XTwitterScraper + module Models + class CreditRedirectTopupCheckoutParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::CreditRedirectTopupCheckoutParams, + XTwitterScraper::Internal::AnyHash + ) + end + + # Billing session ID returned by the top-up billing flow. + sig { returns(String) } + attr_accessor :session_id + + sig do + params( + session_id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Billing session ID returned by the top-up billing flow. + session_id:, + request_options: {} + ) + end + + sig do + override.returns( + { + session_id: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/credit_retrieve_balance_response.rbi b/rbi/x_twitter_scraper/models/credit_retrieve_balance_response.rbi index ff75eb8..31504da 100644 --- a/rbi/x_twitter_scraper/models/credit_retrieve_balance_response.rbi +++ b/rbi/x_twitter_scraper/models/credit_retrieve_balance_response.rbi @@ -11,30 +11,54 @@ module XTwitterScraper ) end + # Configured dollar amount for each automatic top-up. + sig { returns(Float) } + attr_accessor :auto_topup_amount_dollars + sig { returns(T::Boolean) } attr_accessor :auto_topup_enabled - sig { returns(Integer) } + # Credit balance threshold that triggers automatic top-up when enabled, + # represented as a bigint string. + sig { returns(String) } + attr_accessor :auto_topup_threshold + + # Current credit balance as a bigint string to preserve precision above + # Number.MAX_SAFE_INTEGER. + sig { returns(String) } attr_accessor :balance - sig { returns(Integer) } + # Lifetime purchased credits as a bigint string. + sig { returns(String) } attr_accessor :lifetime_purchased - sig { returns(Integer) } + # Lifetime consumed credits as a bigint string. + sig { returns(String) } attr_accessor :lifetime_used sig do params( + auto_topup_amount_dollars: Float, auto_topup_enabled: T::Boolean, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String ).returns(T.attached_class) end def self.new( + # Configured dollar amount for each automatic top-up. + auto_topup_amount_dollars:, auto_topup_enabled:, + # Credit balance threshold that triggers automatic top-up when enabled, + # represented as a bigint string. + auto_topup_threshold:, + # Current credit balance as a bigint string to preserve precision above + # Number.MAX_SAFE_INTEGER. balance:, + # Lifetime purchased credits as a bigint string. lifetime_purchased:, + # Lifetime consumed credits as a bigint string. lifetime_used: ) end @@ -42,10 +66,12 @@ module XTwitterScraper sig do override.returns( { + auto_topup_amount_dollars: Float, auto_topup_enabled: T::Boolean, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } ) end diff --git a/rbi/x_twitter_scraper/models/api_key_create_params.rbi b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi similarity index 50% rename from rbi/x_twitter_scraper/models/api_key_create_params.rbi rename to rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi index c4911c1..5037662 100644 --- a/rbi/x_twitter_scraper/models/api_key_create_params.rbi +++ b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi @@ -2,36 +2,41 @@ module XTwitterScraper module Models - class APIKeyCreateParams < XTwitterScraper::Internal::Type::BaseModel + class CreditRetrieveTopupStatusParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters OrHash = T.type_alias do T.any( - XTwitterScraper::APIKeyCreateParams, + XTwitterScraper::CreditRetrieveTopupStatusParams, XTwitterScraper::Internal::AnyHash ) end - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name + # Billing session ID returned by the top-up billing flow. + sig { returns(String) } + attr_accessor :session_id sig do params( - name: String, + session_id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(name: nil, request_options: {}) + def self.new( + # Billing session ID returned by the top-up billing flow. + session_id:, + request_options: {} + ) end sig do override.returns( - { name: String, request_options: XTwitterScraper::RequestOptions } + { + session_id: String, + request_options: XTwitterScraper::RequestOptions + } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbi b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbi new file mode 100644 index 0000000..4855eda --- /dev/null +++ b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module XTwitterScraper + module Models + class CreditRetrieveTopupStatusResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Dollar amount requested for the top-up. + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_dollars + + # Bigint string credit amount granted or pending. + sig { returns(T.nilable(String)) } + attr_reader :credits + + sig { params(credits: String).void } + attr_writer :credits + + sig do + params( + status: + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::OrSymbol, + amount_dollars: T.nilable(Integer), + credits: String + ).returns(T.attached_class) + end + def self.new( + status:, + # Dollar amount requested for the top-up. + amount_dollars: nil, + # Bigint string credit amount granted or pending. + credits: nil + ) + end + + sig do + override.returns( + { + status: + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol, + amount_dollars: T.nilable(Integer), + credits: String + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAID = + T.let( + :paid, + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/credit_topup_balance_params.rbi b/rbi/x_twitter_scraper/models/credit_topup_balance_params.rbi index 7366cbb..14674e6 100644 --- a/rbi/x_twitter_scraper/models/credit_topup_balance_params.rbi +++ b/rbi/x_twitter_scraper/models/credit_topup_balance_params.rbi @@ -14,26 +14,40 @@ module XTwitterScraper ) end - # Amount to top up in credits + # Amount to top up in US dollars. Minimum 10. sig { returns(Integer) } - attr_accessor :amount + attr_accessor :dollars + + # Optional checkout locale. Defaults to en. + sig { returns(T.nilable(String)) } + attr_reader :locale + + sig { params(locale: String).void } + attr_writer :locale sig do params( - amount: Integer, + dollars: Integer, + locale: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Amount to top up in credits - amount:, + # Amount to top up in US dollars. Minimum 10. + dollars:, + # Optional checkout locale. Defaults to en. + locale: nil, request_options: {} ) end sig do override.returns( - { amount: Integer, request_options: XTwitterScraper::RequestOptions } + { + dollars: Integer, + locale: String, + request_options: XTwitterScraper::RequestOptions + } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/credit_topup_balance_response.rbi b/rbi/x_twitter_scraper/models/credit_topup_balance_response.rbi index 9cc283a..8a56278 100644 --- a/rbi/x_twitter_scraper/models/credit_topup_balance_response.rbi +++ b/rbi/x_twitter_scraper/models/credit_topup_balance_response.rbi @@ -11,14 +11,28 @@ module XTwitterScraper ) end - sig { returns(T::Boolean) } - attr_accessor :success + # Stable first-party Xquik redirect URL for the active Stripe Checkout session. + sig { returns(String) } + attr_accessor :redirect_url - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Same stable first-party Xquik redirect URL as redirect_url. The response never + # exposes a raw Stripe Checkout URL. + sig { returns(String) } + attr_accessor :url + + sig do + params(redirect_url: String, url: String).returns(T.attached_class) + end + def self.new( + # Stable first-party Xquik redirect URL for the active Stripe Checkout session. + redirect_url:, + # Same stable first-party Xquik redirect URL as redirect_url. The response never + # exposes a raw Stripe Checkout URL. + url: + ) end - sig { override.returns({ success: T::Boolean }) } + sig { override.returns({ redirect_url: String, url: String }) } def to_hash end end diff --git a/rbi/x_twitter_scraper/models/draft_list_params.rbi b/rbi/x_twitter_scraper/models/draft_list_params.rbi index d8639d4..88aea66 100644 --- a/rbi/x_twitter_scraper/models/draft_list_params.rbi +++ b/rbi/x_twitter_scraper/models/draft_list_params.rbi @@ -21,7 +21,10 @@ module XTwitterScraper sig { params(after_cursor: String).void } attr_writer :after_cursor - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -38,7 +41,10 @@ module XTwitterScraper def self.new( # Cursor for pagination after_cursor: nil, - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/draw_detail.rbi b/rbi/x_twitter_scraper/models/draw_detail.rbi index ee9f32f..c11f6b3 100644 --- a/rbi/x_twitter_scraper/models/draw_detail.rbi +++ b/rbi/x_twitter_scraper/models/draw_detail.rbi @@ -8,6 +8,7 @@ module XTwitterScraper T.any(XTwitterScraper::DrawDetail, XTwitterScraper::Internal::AnyHash) end + # Draw public ID. sig { returns(String) } attr_accessor :id @@ -73,6 +74,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Draw public ID. id:, created_at:, status:, diff --git a/rbi/x_twitter_scraper/models/draw_export_params.rbi b/rbi/x_twitter_scraper/models/draw_export_params.rbi index 60bd8f4..b080886 100644 --- a/rbi/x_twitter_scraper/models/draw_export_params.rbi +++ b/rbi/x_twitter_scraper/models/draw_export_params.rbi @@ -18,17 +18,8 @@ module XTwitterScraper attr_accessor :id # Export output format - sig do - returns(T.nilable(XTwitterScraper::DrawExportParams::Format::OrSymbol)) - end - attr_reader :format_ - - sig do - params( - format_: XTwitterScraper::DrawExportParams::Format::OrSymbol - ).void - end - attr_writer :format_ + sig { returns(XTwitterScraper::DrawExportParams::Format::OrSymbol) } + attr_accessor :format_ # Export winners or all entries sig do @@ -52,7 +43,7 @@ module XTwitterScraper def self.new( id:, # Export output format - format_: nil, + format_:, # Export winners or all entries type: nil, request_options: {} diff --git a/rbi/x_twitter_scraper/models/draw_list_item.rbi b/rbi/x_twitter_scraper/models/draw_list_item.rbi index 16387e7..1aef708 100644 --- a/rbi/x_twitter_scraper/models/draw_list_item.rbi +++ b/rbi/x_twitter_scraper/models/draw_list_item.rbi @@ -11,6 +11,7 @@ module XTwitterScraper ) end + # Draw public ID for detail responses. sig { returns(String) } attr_accessor :id @@ -48,6 +49,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Draw public ID for detail responses. id:, created_at:, status:, diff --git a/rbi/x_twitter_scraper/models/draw_list_params.rbi b/rbi/x_twitter_scraper/models/draw_list_params.rbi index fc1b5bd..f32967d 100644 --- a/rbi/x_twitter_scraper/models/draw_list_params.rbi +++ b/rbi/x_twitter_scraper/models/draw_list_params.rbi @@ -14,14 +14,17 @@ module XTwitterScraper ) end - # Cursor for keyset pagination + # Cursor for keyset pagination from prior response next_cursor sig { returns(T.nilable(String)) } - attr_reader :after + attr_reader :cursor - sig { params(after: String).void } - attr_writer :after + sig { params(cursor: String).void } + attr_writer :cursor - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -30,15 +33,18 @@ module XTwitterScraper sig do params( - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Cursor for keyset pagination - after: nil, - # Maximum number of items to return (1-100, default 50) + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, request_options: {} ) @@ -47,7 +53,7 @@ module XTwitterScraper sig do override.returns( { - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/draw_run_response.rbi b/rbi/x_twitter_scraper/models/draw_run_response.rbi index 33b2005..b8e57e8 100644 --- a/rbi/x_twitter_scraper/models/draw_run_response.rbi +++ b/rbi/x_twitter_scraper/models/draw_run_response.rbi @@ -14,12 +14,16 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Candidate entries inspected for this draw after the credit-derived cap. This may + # be lower than the source tweet's full reply count. sig { returns(Integer) } attr_accessor :total_entries sig { returns(String) } attr_accessor :tweet_id + # Entries from the inspected candidate set that passed all filters. This is not + # necessarily every valid reply on the source tweet when credits cap inspection. sig { returns(Integer) } attr_accessor :valid_entries @@ -35,7 +39,17 @@ module XTwitterScraper winners: T::Array[XTwitterScraper::Winner::OrHash] ).returns(T.attached_class) end - def self.new(id:, total_entries:, tweet_id:, valid_entries:, winners:) + def self.new( + id:, + # Candidate entries inspected for this draw after the credit-derived cap. This may + # be lower than the source tweet's full reply count. + total_entries:, + tweet_id:, + # Entries from the inspected candidate set that passed all filters. This is not + # necessarily every valid reply on the source tweet when credits cap inspection. + valid_entries:, + winners: + ) end sig do diff --git a/rbi/x_twitter_scraper/models/embedded_tweet.rbi b/rbi/x_twitter_scraper/models/embedded_tweet.rbi new file mode 100644 index 0000000..5c2d534 --- /dev/null +++ b/rbi/x_twitter_scraper/models/embedded_tweet.rbi @@ -0,0 +1,255 @@ +# typed: strong + +module XTwitterScraper + module Models + class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet, + 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 + + # X user profile with bio, follower counts, and verification status. + sig { returns(T.nilable(XTwitterScraper::UserProfile)) } + attr_reader :author + + sig { params(author: XTwitterScraper::UserProfile::OrHash).void } + attr_writer :author + + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } + attr_reader :content_disclosure + + sig do + params( + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash + ).void + end + attr_writer :content_disclosure + + 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 + + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :display_text_range + + sig { params(display_text_range: T::Array[Integer]).void } + attr_writer :display_text_range + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_id + + sig { params(in_reply_to_id: String).void } + attr_writer :in_reply_to_id + + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_user_id + + sig { params(in_reply_to_user_id: String).void } + attr_writer :in_reply_to_user_id + + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_username + + sig { params(in_reply_to_username: String).void } + attr_writer :in_reply_to_username + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_limited_reply + + sig { params(is_limited_reply: T::Boolean).void } + attr_writer :is_limited_reply + + 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(T::Boolean)) } + attr_reader :is_quote_status + + sig { params(is_quote_status: T::Boolean).void } + attr_writer :is_quote_status + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_reply + + sig { params(is_reply: T::Boolean).void } + attr_writer :is_reply + + sig { returns(T.nilable(String)) } + attr_reader :lang + + sig { params(lang: String).void } + attr_writer :lang + + sig { returns(T.nilable(T::Array[XTwitterScraper::TweetMedia])) } + attr_reader :media + + sig { params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void } + attr_writer :media + + sig { returns(T.nilable(String)) } + attr_reader :source + + sig { params(source: String).void } + attr_writer :source + + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + 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, + author: XTwitterScraper::UserProfile::OrHash, + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, + conversation_id: String, + created_at: String, + display_text_range: T::Array[Integer], + entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + lang: String, + media: T::Array[XTwitterScraper::TweetMedia::OrHash], + source: String, + type: String, + url: String + ).returns(T.attached_class) + end + def self.new( + id:, + bookmark_count:, + like_count:, + quote_count:, + reply_count:, + retweet_count:, + text:, + view_count:, + # X user profile with bio, follower counts, and verification status. + author: nil, + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + content_disclosure: nil, + conversation_id: nil, + created_at: nil, + display_text_range: nil, + entities: nil, + in_reply_to_id: nil, + in_reply_to_user_id: nil, + in_reply_to_username: nil, + is_limited_reply: nil, + is_note_tweet: nil, + is_quote_status: nil, + is_reply: nil, + lang: nil, + media: nil, + source: nil, + type: nil, + url: 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, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: T::Array[Integer], + entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + lang: String, + media: T::Array[XTwitterScraper::TweetMedia], + source: String, + type: String, + url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index 3acde29..2f9a416 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -8,108 +8,887 @@ module XTwitterScraper T.any(XTwitterScraper::Error, XTwitterScraper::Internal::AnyHash) end - sig { returns(XTwitterScraper::Error::Error::OrSymbol) } + sig do + returns( + T.any( + XTwitterScraper::Error::Error::LegacyErrorCode::OrSymbol, + XTwitterScraper::Error::Error::StructuredError + ) + ) + end attr_accessor :error - # Error response containing a machine-readable error code. + # Error response. Default v1 returns a legacy string error code. Send + # `xquik-api-contract: 2026-04-29` to receive the structured best-practice error + # object. sig do - params(error: XTwitterScraper::Error::Error::OrSymbol).returns( - T.attached_class - ) + params( + error: + T.any( + XTwitterScraper::Error::Error::LegacyErrorCode::OrSymbol, + XTwitterScraper::Error::Error::StructuredError::OrHash + ) + ).returns(T.attached_class) end def self.new(error:) end sig do - override.returns({ error: XTwitterScraper::Error::Error::OrSymbol }) + override.returns( + { + error: + T.any( + XTwitterScraper::Error::Error::LegacyErrorCode::OrSymbol, + XTwitterScraper::Error::Error::StructuredError + ) + } + ) end def to_hash end module Error - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, XTwitterScraper::Error::Error) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - INTERNAL_ERROR = - T.let(:internal_error, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_FORMAT = - T.let(:invalid_format, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_ID = - T.let(:invalid_id, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_INPUT = - T.let(:invalid_input, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_PARAMS = - T.let(:invalid_params, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_TOOL_TYPE = - T.let(:invalid_tool_type, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_TWEET_ID = - T.let(:invalid_tweet_id, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_TWEET_URL = - T.let(:invalid_tweet_url, XTwitterScraper::Error::Error::TaggedSymbol) - INVALID_USERNAME = - T.let(:invalid_username, XTwitterScraper::Error::Error::TaggedSymbol) - INSUFFICIENT_CREDITS = - T.let( - :insufficient_credits, - XTwitterScraper::Error::Error::TaggedSymbol - ) - MISSING_PARAMS = - T.let(:missing_params, XTwitterScraper::Error::Error::TaggedSymbol) - MISSING_QUERY = - T.let(:missing_query, XTwitterScraper::Error::Error::TaggedSymbol) - MONITOR_ALREADY_EXISTS = - T.let( - :monitor_already_exists, - XTwitterScraper::Error::Error::TaggedSymbol - ) - MONITOR_LIMIT_REACHED = - T.let( - :monitor_limit_reached, - XTwitterScraper::Error::Error::TaggedSymbol - ) - NO_CREDITS = - T.let(:no_credits, XTwitterScraper::Error::Error::TaggedSymbol) - NO_SUBSCRIPTION = - T.let(:no_subscription, XTwitterScraper::Error::Error::TaggedSymbol) - NOT_FOUND = - T.let(:not_found, XTwitterScraper::Error::Error::TaggedSymbol) - SUBSCRIPTION_INACTIVE = - T.let( - :subscription_inactive, - XTwitterScraper::Error::Error::TaggedSymbol - ) - TWEET_NOT_FOUND = - T.let(:tweet_not_found, XTwitterScraper::Error::Error::TaggedSymbol) - UNAUTHENTICATED = - T.let(:unauthenticated, XTwitterScraper::Error::Error::TaggedSymbol) - UNSUPPORTED_FIELD = - T.let(:unsupported_field, XTwitterScraper::Error::Error::TaggedSymbol) - USER_NOT_FOUND = - T.let(:user_not_found, XTwitterScraper::Error::Error::TaggedSymbol) - WEBHOOK_INACTIVE = - T.let(:webhook_inactive, XTwitterScraper::Error::Error::TaggedSymbol) - X_API_RATE_LIMITED = - T.let( - :x_api_rate_limited, - XTwitterScraper::Error::Error::TaggedSymbol - ) - X_API_UNAVAILABLE = - T.let(:x_api_unavailable, XTwitterScraper::Error::Error::TaggedSymbol) - X_API_UNAUTHORIZED = - T.let( - :x_api_unauthorized, - XTwitterScraper::Error::Error::TaggedSymbol - ) + extend XTwitterScraper::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol, + XTwitterScraper::Error::Error::StructuredError + ) + end + + module LegacyErrorCode + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::Error::Error::LegacyErrorCode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTERNAL_ERROR = + T.let( + :internal_error, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ACCOUNT_ALREADY_CONNECTED = + T.let( + :account_already_connected, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ACCOUNT_NEEDS_REAUTH = + T.let( + :account_needs_reauth, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ACCOUNT_NOT_FOUND = + T.let( + :account_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ACCOUNT_REQUIRED = + T.let( + :account_required, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ACCOUNT_RESTRICTED = + T.let( + :account_restricted, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + API_KEY_LIMIT_REACHED = + T.let( + :api_key_limit_reached, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + ARTICLE_NOT_FOUND = + T.let( + :article_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + DM_NOT_PERMITTED = + T.let( + :dm_not_permitted, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_FORMAT = + T.let( + :invalid_format, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_ID = + T.let( + :invalid_id, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_INPUT = + T.let( + :invalid_input, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_PARAMS = + T.let( + :invalid_params, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_TOOL_TYPE = + T.let( + :invalid_tool_type, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_TWEET_ID = + T.let( + :invalid_tweet_id, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_TWEET_URL = + T.let( + :invalid_tweet_url, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_USER_ID = + T.let( + :invalid_user_id, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_USER_IDS = + T.let( + :invalid_user_ids, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_USERNAME = + T.let( + :invalid_username, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_JSON = + T.let( + :invalid_json, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INSUFFICIENT_CREDITS = + T.let( + :insufficient_credits, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + LOGIN_COOLDOWN = + T.let( + :login_cooldown, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + LOGIN_FAILED = + T.let( + :login_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MEDIA_DOWNLOAD_FAILED = + T.let( + :media_download_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MISSING_PARAMS = + T.let( + :missing_params, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MISSING_QUERY = + T.let( + :missing_query, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MONITOR_ALREADY_EXISTS = + T.let( + :monitor_already_exists, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + NO_MEDIA = + T.let( + :no_media, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + NO_CREDITS = + T.let( + :no_credits, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + NO_SUBSCRIPTION = + T.let( + :no_subscription, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + NOT_FOUND = + T.let( + :not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + PAYMENT_FAILED = + T.let( + :payment_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + RATE_LIMIT_EXCEEDED = + T.let( + :rate_limit_exceeded, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + SERVICE_UNAVAILABLE = + T.let( + :service_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + STYLE_NOT_FOUND = + T.let( + :style_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + SUBSCRIPTION_INACTIVE = + T.let( + :subscription_inactive, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + TWEET_NOT_FOUND = + T.let( + :tweet_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + UNAUTHENTICATED = + T.let( + :unauthenticated, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + UNSUPPORTED_FIELD = + T.let( + :unsupported_field, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + USER_NOT_FOUND = + T.let( + :user_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_ACCOUNT_FEATURE_REQUIRED = + T.let( + :x_account_feature_required, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_ACCOUNT_PROTECTED = + T.let( + :x_account_protected, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_ACCOUNT_SUSPENDED = + T.let( + :x_account_suspended, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_API_RATE_LIMITED = + T.let( + :x_api_rate_limited, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_API_UNAVAILABLE = + T.let( + :x_api_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_API_UNAUTHORIZED = + T.let( + :x_api_unauthorized, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_AUTH_FAILURE = + T.let( + :x_auth_failure, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_CONTENT_TOO_LONG = + T.let( + :x_content_too_long, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_DAILY_LIMIT = + T.let( + :x_daily_limit, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_DM_NOT_ALLOWED = + T.let( + :x_dm_not_allowed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_DUPLICATE_ACTION = + T.let( + :x_duplicate_action, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_AUTH_FAILED = + T.let( + :x_login_auth_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_CHALLENGE = + T.let( + :x_login_challenge, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_DENIED = + T.let( + :x_login_denied, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_FAILED = + T.let( + :x_login_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_PROXY_ERROR = + T.let( + :x_login_proxy_error, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_RATE_LIMITED = + T.let( + :x_login_rate_limited, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_SERVICE_UNAVAILABLE = + T.let( + :x_login_service_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_LOGIN_SUSPENDED = + T.let( + :x_login_suspended, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_RATE_LIMITED = + T.let( + :x_rate_limited, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_REJECTED = + T.let( + :x_rejected, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_TARGET_NOT_FOUND = + T.let( + :x_target_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_TRANSIENT_ERROR = + T.let( + :x_transient_error, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_USER_LOOKUP_FAILED = + T.let( + :x_user_lookup_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_WRITE_AMBIGUOUS = + T.let( + :x_write_ambiguous, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_WRITE_FAILED = + T.let( + :x_write_failed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_WRITE_UNCONFIRMED = + T.let( + :x_write_unconfirmed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + class StructuredError < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Error::Error::StructuredError, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Error::Error::StructuredError::Code::OrSymbol + ) + end + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig do + returns( + XTwitterScraper::Error::Error::StructuredError::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + params( + code: + XTwitterScraper::Error::Error::StructuredError::Code::OrSymbol, + message: String, + type: + XTwitterScraper::Error::Error::StructuredError::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(code:, message:, type:) + end + + sig do + override.returns( + { + code: + XTwitterScraper::Error::Error::StructuredError::Code::OrSymbol, + message: String, + type: + XTwitterScraper::Error::Error::StructuredError::Type::OrSymbol + } + ) + end + def to_hash + end + + module Code + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Error::Error::StructuredError::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTERNAL_ERROR = + T.let( + :internal_error, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ACCOUNT_ALREADY_CONNECTED = + T.let( + :account_already_connected, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ACCOUNT_NEEDS_REAUTH = + T.let( + :account_needs_reauth, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ACCOUNT_NOT_FOUND = + T.let( + :account_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ACCOUNT_REQUIRED = + T.let( + :account_required, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ACCOUNT_RESTRICTED = + T.let( + :account_restricted, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + API_KEY_LIMIT_REACHED = + T.let( + :api_key_limit_reached, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + ARTICLE_NOT_FOUND = + T.let( + :article_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + DM_NOT_PERMITTED = + T.let( + :dm_not_permitted, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_FORMAT = + T.let( + :invalid_format, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_ID = + T.let( + :invalid_id, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_INPUT = + T.let( + :invalid_input, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_PARAMS = + T.let( + :invalid_params, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_TOOL_TYPE = + T.let( + :invalid_tool_type, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_TWEET_ID = + T.let( + :invalid_tweet_id, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_TWEET_URL = + T.let( + :invalid_tweet_url, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_USER_ID = + T.let( + :invalid_user_id, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_USER_IDS = + T.let( + :invalid_user_ids, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_USERNAME = + T.let( + :invalid_username, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_JSON = + T.let( + :invalid_json, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INSUFFICIENT_CREDITS = + T.let( + :insufficient_credits, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + LOGIN_COOLDOWN = + T.let( + :login_cooldown, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + LOGIN_FAILED = + T.let( + :login_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MEDIA_DOWNLOAD_FAILED = + T.let( + :media_download_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MISSING_PARAMS = + T.let( + :missing_params, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MISSING_QUERY = + T.let( + :missing_query, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MONITOR_ALREADY_EXISTS = + T.let( + :monitor_already_exists, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + NO_MEDIA = + T.let( + :no_media, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + NO_CREDITS = + T.let( + :no_credits, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + NO_SUBSCRIPTION = + T.let( + :no_subscription, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + NOT_FOUND = + T.let( + :not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + PAYMENT_FAILED = + T.let( + :payment_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + RATE_LIMIT_EXCEEDED = + T.let( + :rate_limit_exceeded, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + SERVICE_UNAVAILABLE = + T.let( + :service_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + STYLE_NOT_FOUND = + T.let( + :style_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + SUBSCRIPTION_INACTIVE = + T.let( + :subscription_inactive, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + TWEET_NOT_FOUND = + T.let( + :tweet_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + UNAUTHENTICATED = + T.let( + :unauthenticated, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + UNSUPPORTED_FIELD = + T.let( + :unsupported_field, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + USER_NOT_FOUND = + T.let( + :user_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_ACCOUNT_FEATURE_REQUIRED = + T.let( + :x_account_feature_required, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_ACCOUNT_PROTECTED = + T.let( + :x_account_protected, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_ACCOUNT_SUSPENDED = + T.let( + :x_account_suspended, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_API_RATE_LIMITED = + T.let( + :x_api_rate_limited, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_API_UNAVAILABLE = + T.let( + :x_api_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_API_UNAUTHORIZED = + T.let( + :x_api_unauthorized, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_AUTH_FAILURE = + T.let( + :x_auth_failure, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_CONTENT_TOO_LONG = + T.let( + :x_content_too_long, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_DAILY_LIMIT = + T.let( + :x_daily_limit, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_DM_NOT_ALLOWED = + T.let( + :x_dm_not_allowed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_DUPLICATE_ACTION = + T.let( + :x_duplicate_action, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_AUTH_FAILED = + T.let( + :x_login_auth_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_CHALLENGE = + T.let( + :x_login_challenge, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_DENIED = + T.let( + :x_login_denied, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_FAILED = + T.let( + :x_login_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_PROXY_ERROR = + T.let( + :x_login_proxy_error, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_RATE_LIMITED = + T.let( + :x_login_rate_limited, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_SERVICE_UNAVAILABLE = + T.let( + :x_login_service_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_LOGIN_SUSPENDED = + T.let( + :x_login_suspended, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_RATE_LIMITED = + T.let( + :x_rate_limited, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_REJECTED = + T.let( + :x_rejected, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_TARGET_NOT_FOUND = + T.let( + :x_target_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_TRANSIENT_ERROR = + T.let( + :x_transient_error, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_USER_LOOKUP_FAILED = + T.let( + :x_user_lookup_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_WRITE_AMBIGUOUS = + T.let( + :x_write_ambiguous, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_WRITE_FAILED = + T.let( + :x_write_failed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_WRITE_UNCONFIRMED = + T.let( + :x_write_unconfirmed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Error::Error::StructuredError::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + API_ERROR = + T.let( + :api_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + AUTHENTICATION_ERROR = + T.let( + :authentication_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :billing_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + DEPENDENCY_ERROR = + T.let( + :dependency_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + INVALID_REQUEST_ERROR = + T.let( + :invalid_request_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + PERMISSION_ERROR = + T.let( + :permission_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + RATE_LIMIT_ERROR = + T.let( + :rate_limit_error, + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Error::Error::StructuredError::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end sig do - override.returns( - T::Array[XTwitterScraper::Error::Error::TaggedSymbol] - ) + override.returns(T::Array[XTwitterScraper::Error::Error::Variants]) end - def self.values + def self.variants end end end diff --git a/rbi/x_twitter_scraper/models/event.rbi b/rbi/x_twitter_scraper/models/event.rbi index c5725db..646a29b 100644 --- a/rbi/x_twitter_scraper/models/event.rbi +++ b/rbi/x_twitter_scraper/models/event.rbi @@ -14,9 +14,14 @@ module XTwitterScraper sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :data + # Account monitor ID for account events, or keyword monitor ID for keyword events. sig { returns(String) } attr_accessor :monitor_id + # Source monitor type. + sig { returns(XTwitterScraper::Event::MonitorType::TaggedSymbol) } + attr_accessor :monitor_type + sig { returns(Time) } attr_accessor :occurred_at @@ -24,28 +29,57 @@ module XTwitterScraper sig { returns(XTwitterScraper::EventType::TaggedSymbol) } attr_accessor :type - sig { returns(String) } - attr_accessor :username + # Keyword monitor ID, present for keyword monitor events. + sig { returns(T.nilable(String)) } + attr_reader :keyword_monitor_id + + sig { params(keyword_monitor_id: String).void } + attr_writer :keyword_monitor_id + + # Keyword query, present for keyword monitor events. + sig { returns(T.nilable(String)) } + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + # Account username, present for account monitor events. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username - # Monitor event summary with type, username, and occurrence time. + # Monitor event summary with source metadata and occurrence time. sig do params( id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, + monitor_type: XTwitterScraper::Event::MonitorType::OrSymbol, occurred_at: Time, type: XTwitterScraper::EventType::OrSymbol, + keyword_monitor_id: String, + query: String, username: String ).returns(T.attached_class) end def self.new( id:, data:, + # Account monitor ID for account events, or keyword monitor ID for keyword events. monitor_id:, + # Source monitor type. + monitor_type:, occurred_at:, # Type of monitor event fired when account activity occurs. type:, - username: + # Keyword monitor ID, present for keyword monitor events. + keyword_monitor_id: nil, + # Keyword query, present for keyword monitor events. + query: nil, + # Account username, present for account monitor events. + username: nil ) end @@ -55,14 +89,39 @@ module XTwitterScraper id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, + monitor_type: XTwitterScraper::Event::MonitorType::TaggedSymbol, occurred_at: Time, type: XTwitterScraper::EventType::TaggedSymbol, + keyword_monitor_id: String, + query: String, username: String } ) end def to_hash end + + # Source monitor type. + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, XTwitterScraper::Event::MonitorType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let(:account, XTwitterScraper::Event::MonitorType::TaggedSymbol) + KEYWORD = + T.let(:keyword, XTwitterScraper::Event::MonitorType::TaggedSymbol) + + sig do + override.returns( + T::Array[XTwitterScraper::Event::MonitorType::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 d22c824..245a0a0 100644 --- a/rbi/x_twitter_scraper/models/event_detail.rbi +++ b/rbi/x_twitter_scraper/models/event_detail.rbi @@ -18,9 +18,14 @@ module XTwitterScraper sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :data + # Monitor ID associated with this detailed event payload. sig { returns(String) } attr_accessor :monitor_id + # Source monitor type for this detailed event. + sig { returns(XTwitterScraper::EventDetail::MonitorType::TaggedSymbol) } + attr_accessor :monitor_type + sig { returns(Time) } attr_accessor :occurred_at @@ -28,8 +33,26 @@ module XTwitterScraper sig { returns(XTwitterScraper::EventType::TaggedSymbol) } attr_accessor :type - sig { returns(String) } - attr_accessor :username + # Keyword monitor ID included on detailed keyword events. + sig { returns(T.nilable(String)) } + attr_reader :keyword_monitor_id + + sig { params(keyword_monitor_id: String).void } + attr_writer :keyword_monitor_id + + # Keyword query for this detailed monitor event. + sig { returns(T.nilable(String)) } + attr_reader :query + + sig { params(query: String).void } + attr_writer :query + + # Account username for this detailed monitor event. + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username sig { returns(T.nilable(String)) } attr_reader :x_event_id @@ -43,8 +66,11 @@ module XTwitterScraper id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, + monitor_type: XTwitterScraper::EventDetail::MonitorType::OrSymbol, occurred_at: Time, type: XTwitterScraper::EventType::OrSymbol, + keyword_monitor_id: String, + query: String, username: String, x_event_id: String ).returns(T.attached_class) @@ -53,11 +79,19 @@ module XTwitterScraper id:, # Event payload - shape varies by event type (JSON) data:, + # Monitor ID associated with this detailed event payload. monitor_id:, + # Source monitor type for this detailed event. + monitor_type:, occurred_at:, # Type of monitor event fired when account activity occurs. type:, - username:, + # Keyword monitor ID included on detailed keyword events. + keyword_monitor_id: nil, + # Keyword query for this detailed monitor event. + query: nil, + # Account username for this detailed monitor event. + username: nil, x_event_id: nil ) end @@ -68,8 +102,12 @@ module XTwitterScraper id: String, data: T::Hash[Symbol, T.anything], monitor_id: String, + monitor_type: + XTwitterScraper::EventDetail::MonitorType::TaggedSymbol, occurred_at: Time, type: XTwitterScraper::EventType::TaggedSymbol, + keyword_monitor_id: String, + query: String, username: String, x_event_id: String } @@ -77,6 +115,36 @@ module XTwitterScraper end def to_hash end + + # Source monitor type for this detailed event. + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::EventDetail::MonitorType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + XTwitterScraper::EventDetail::MonitorType::TaggedSymbol + ) + KEYWORD = + T.let( + :keyword, + XTwitterScraper::EventDetail::MonitorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::EventDetail::MonitorType::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 f2f84a2..9c719e9 100644 --- a/rbi/x_twitter_scraper/models/event_list_params.rbi +++ b/rbi/x_twitter_scraper/models/event_list_params.rbi @@ -14,12 +14,12 @@ module XTwitterScraper ) end - # Cursor for keyset pagination + # Cursor for keyset pagination from prior response next_cursor sig { returns(T.nilable(String)) } - attr_reader :after + attr_reader :cursor - sig { params(after: String).void } - attr_writer :after + sig { params(cursor: String).void } + attr_writer :cursor # Filter events by type sig { returns(T.nilable(XTwitterScraper::EventType::OrSymbol)) } @@ -28,7 +28,10 @@ module XTwitterScraper sig { params(event_type: XTwitterScraper::EventType::OrSymbol).void } attr_writer :event_type - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -44,7 +47,7 @@ module XTwitterScraper sig do params( - after: String, + cursor: String, event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, @@ -52,11 +55,14 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Cursor for keyset pagination - after: nil, + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, # Filter events by type event_type: nil, - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, # Filter events by monitor ID monitor_id: nil, @@ -67,7 +73,7 @@ module XTwitterScraper sig do override.returns( { - after: String, + cursor: String, event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, diff --git a/rbi/x_twitter_scraper/models/event_type.rbi b/rbi/x_twitter_scraper/models/event_type.rbi index 4a0ba79..353cfad 100644 --- a/rbi/x_twitter_scraper/models/event_type.rbi +++ b/rbi/x_twitter_scraper/models/event_type.rbi @@ -16,6 +16,64 @@ module XTwitterScraper T.let(:"tweet.retweet", XTwitterScraper::EventType::TaggedSymbol) TWEET_QUOTE = T.let(:"tweet.quote", XTwitterScraper::EventType::TaggedSymbol) + TWEET_MEDIA = + T.let(:"tweet.media", XTwitterScraper::EventType::TaggedSymbol) + TWEET_LINK = + T.let(:"tweet.link", XTwitterScraper::EventType::TaggedSymbol) + TWEET_POLL = + T.let(:"tweet.poll", XTwitterScraper::EventType::TaggedSymbol) + TWEET_MENTION = + T.let(:"tweet.mention", XTwitterScraper::EventType::TaggedSymbol) + TWEET_HASHTAG = + T.let(:"tweet.hashtag", XTwitterScraper::EventType::TaggedSymbol) + TWEET_LONGFORM = + T.let(:"tweet.longform", XTwitterScraper::EventType::TaggedSymbol) + PROFILE_AVATAR_CHANGED = + T.let( + :"profile.avatar.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_BANNER_CHANGED = + T.let( + :"profile.banner.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_NAME_CHANGED = + T.let(:"profile.name.changed", XTwitterScraper::EventType::TaggedSymbol) + PROFILE_USERNAME_CHANGED = + T.let( + :"profile.username.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_BIO_CHANGED = + T.let(:"profile.bio.changed", XTwitterScraper::EventType::TaggedSymbol) + PROFILE_LOCATION_CHANGED = + T.let( + :"profile.location.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_URL_CHANGED = + T.let(:"profile.url.changed", XTwitterScraper::EventType::TaggedSymbol) + PROFILE_VERIFIED_CHANGED = + T.let( + :"profile.verified.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_PROTECTED_CHANGED = + T.let( + :"profile.protected.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_PINNED_TWEET_CHANGED = + T.let( + :"profile.pinned_tweet.changed", + XTwitterScraper::EventType::TaggedSymbol + ) + PROFILE_UNAVAILABLE_CHANGED = + T.let( + :"profile.unavailable.changed", + XTwitterScraper::EventType::TaggedSymbol + ) sig do override.returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) 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 2ff52c5..0cb6a1c 100644 --- a/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi @@ -29,6 +29,36 @@ module XTwitterScraper sig { params(advanced_query: String).void } attr_writer :advanced_query + # Alternative words or quoted phrases for estimated results. Separate with spaces, + # commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 + # (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :bounding_box + + sig { params(bounding_box: String).void } + attr_writer :bounding_box + + # Cashtags applied to the estimate, separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter used for estimation (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Exact phrase filter for search estimation sig { returns(T.nilable(String)) } attr_reader :exact_phrase @@ -36,31 +66,230 @@ module XTwitterScraper sig { params(exact_phrase: String).void } attr_writer :exact_phrase - # Words excluded from estimated search results + # Words or quoted phrases excluded from estimated results. Separate with spaces, + # commas, or lines. sig { returns(T.nilable(String)) } attr_reader :exclude_words sig { params(exclude_words: String).void } attr_writer :exclude_words + # Estimate only tweets from this author username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags applied to the estimate, separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Estimate only replies to this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code used for estimate filtering (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Estimate search results within this list ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :list_id + + sig { params(list_id: String).void } + attr_writer :list_id + + # Media type used for estimate filtering (tweet_search_extractor) + sig do + returns( + T.nilable( + XTwitterScraper::ExtractionEstimateCostParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::ExtractionEstimateCostParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Estimate tweets mentioning this username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold for estimated results (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold for estimated results (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold for estimated results (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold for estimated results (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Estimate search results within this place ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :place + + sig { params(place: String).void } + attr_writer :place + + # Estimate search results within this country code (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :place_country + + sig { params(place_country: String).void } + attr_writer :place_country + + # Geo point radius used for estimation, e.g. -73.99 40.73 25mi + # (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :point_radius + + sig { params(point_radius: String).void } + attr_writer :point_radius + + # Quote mode used for estimation (tweet_search_extractor) + sig do + returns( + T.nilable( + XTwitterScraper::ExtractionEstimateCostParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::ExtractionEstimateCostParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Estimate only quotes of this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode used for estimation (tweet_search_extractor) + sig do + returns( + T.nilable( + XTwitterScraper::ExtractionEstimateCostParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::ExtractionEstimateCostParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Maximum number of results to estimate. When set, the estimate caps projected + # results to this value. + sig { returns(T.nilable(Integer)) } + attr_reader :results_limit + + sig { params(results_limit: Integer).void } + attr_writer :results_limit + + # Retweet mode used for estimation (tweet_search_extractor) + sig do + returns( + T.nilable( + XTwitterScraper::ExtractionEstimateCostParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::ExtractionEstimateCostParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Estimate only retweets of this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Required for tweet_search_extractor & community_search. sig { returns(T.nilable(String)) } attr_reader :search_query sig { params(search_query: String).void } attr_writer :search_query + # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Required for community_post_extractor & community_search. sig { returns(T.nilable(String)) } attr_reader :target_community_id sig { params(target_community_id: String).void } attr_writer :target_community_id + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. sig { returns(T.nilable(String)) } attr_reader :target_list_id sig { params(target_list_id: String).void } attr_writer :target_list_id + # Required for space_explorer. sig { returns(T.nilable(String)) } attr_reader :target_space_id @@ -79,19 +308,80 @@ module XTwitterScraper sig { params(target_username: String).void } attr_writer :target_username + # Estimate replies sent to this username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter used for estimation (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Estimate only verified authors (tweet_search_extractor) + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( tool_type: XTwitterScraper::ExtractionEstimateCostParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: + XTwitterScraper::ExtractionEstimateCostParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: + XTwitterScraper::ExtractionEstimateCostParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::ExtractionEstimateCostParams::Replies::OrSymbol, + results_limit: Integer, + retweets: + XTwitterScraper::ExtractionEstimateCostParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -100,16 +390,84 @@ module XTwitterScraper tool_type:, # Raw advanced query string appended to the estimate (tweet_search_extractor) advanced_query: nil, + # Alternative words or quoted phrases for estimated results. Separate with spaces, + # commas, or lines. + any_words: nil, + # Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 + # (tweet_search_extractor) + bounding_box: nil, + # Cashtags applied to the estimate, separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter used for estimation (tweet_search_extractor) + conversation_id: nil, # Exact phrase filter for search estimation exact_phrase: nil, - # Words excluded from estimated search results + # Words or quoted phrases excluded from estimated results. Separate with spaces, + # commas, or lines. exclude_words: nil, + # Estimate only tweets from this author username (tweet_search_extractor) + from_user: nil, + # Hashtags applied to the estimate, separated by spaces, commas, or lines. + hashtags: nil, + # Estimate only replies to this tweet ID (tweet_search_extractor) + in_reply_to_tweet_id: nil, + # Language code used for estimate filtering (tweet_search_extractor) + language: nil, + # Estimate search results within this list ID (tweet_search_extractor) + list_id: nil, + # Media type used for estimate filtering (tweet_search_extractor) + media_type: nil, + # Estimate tweets mentioning this username (tweet_search_extractor) + mentioning: nil, + # Minimum likes threshold for estimated results (tweet_search_extractor) + min_faves: nil, + # Minimum quote count threshold for estimated results (tweet_search_extractor) + min_quotes: nil, + # Minimum replies threshold for estimated results (tweet_search_extractor) + min_replies: nil, + # Minimum retweets threshold for estimated results (tweet_search_extractor) + min_retweets: nil, + # Estimate search results within this place ID (tweet_search_extractor) + place: nil, + # Estimate search results within this country code (tweet_search_extractor) + place_country: nil, + # Geo point radius used for estimation, e.g. -73.99 40.73 25mi + # (tweet_search_extractor) + point_radius: nil, + # Quote mode used for estimation (tweet_search_extractor) + quotes: nil, + # Estimate only quotes of this tweet ID (tweet_search_extractor) + quotes_of_tweet_id: nil, + # Reply mode used for estimation (tweet_search_extractor) + replies: nil, + # Maximum number of results to estimate. When set, the estimate caps projected + # results to this value. + results_limit: nil, + # Retweet mode used for estimation (tweet_search_extractor) + retweets: nil, + # Estimate only retweets of this tweet ID (tweet_search_extractor) + retweets_of_tweet_id: nil, + # Required for tweet_search_extractor & community_search. search_query: nil, + # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) + since_date: nil, + # Required for community_post_extractor & community_search. target_community_id: nil, + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. target_list_id: nil, + # Required for space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, + # Estimate replies sent to this username (tweet_search_extractor) + to_user: nil, + # Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + until_date: nil, + # URL substring or domain filter used for estimation (tweet_search_extractor) + url: nil, + # Estimate only verified authors (tweet_search_extractor) + verified_only: nil, request_options: {} ) end @@ -120,14 +478,47 @@ module XTwitterScraper tool_type: XTwitterScraper::ExtractionEstimateCostParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: + XTwitterScraper::ExtractionEstimateCostParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: + XTwitterScraper::ExtractionEstimateCostParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::ExtractionEstimateCostParams::Replies::OrSymbol, + results_limit: Integer, + retweets: + XTwitterScraper::ExtractionEstimateCostParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) @@ -173,6 +564,11 @@ module XTwitterScraper :community_search, XTwitterScraper::ExtractionEstimateCostParams::ToolType::TaggedSymbol ) + FAVORITERS = + T.let( + :favoriters, + XTwitterScraper::ExtractionEstimateCostParams::ToolType::TaggedSymbol + ) FOLLOWER_EXPLORER = T.let( :follower_explorer, @@ -243,6 +639,16 @@ module XTwitterScraper :tweet_search_extractor, XTwitterScraper::ExtractionEstimateCostParams::ToolType::TaggedSymbol ) + USER_LIKES = + T.let( + :user_likes, + XTwitterScraper::ExtractionEstimateCostParams::ToolType::TaggedSymbol + ) + USER_MEDIA = + T.let( + :user_media, + XTwitterScraper::ExtractionEstimateCostParams::ToolType::TaggedSymbol + ) VERIFIED_FOLLOWER_EXPLORER = T.let( :verified_follower_explorer, @@ -259,6 +665,178 @@ module XTwitterScraper def self.values end end + + # Media type used for estimate filtering (tweet_search_extractor) + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::ExtractionEstimateCostParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionEstimateCostParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode used for estimation (tweet_search_extractor) + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::ExtractionEstimateCostParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionEstimateCostParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionEstimateCostParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionEstimateCostParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionEstimateCostParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode used for estimation (tweet_search_extractor) + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::ExtractionEstimateCostParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionEstimateCostParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionEstimateCostParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionEstimateCostParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionEstimateCostParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode used for estimation (tweet_search_extractor) + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::ExtractionEstimateCostParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionEstimateCostParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionEstimateCostParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionEstimateCostParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionEstimateCostParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi b/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi index f3337d6..904e589 100644 --- a/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_estimate_cost_response.rbi @@ -23,7 +23,11 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :estimated_results - sig { returns(String) } + sig do + returns( + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + end attr_accessor :source sig { returns(T.nilable(String)) } @@ -38,7 +42,8 @@ module XTwitterScraper credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::OrSymbol, resolved_x_user_id: String ).returns(T.attached_class) end @@ -59,13 +64,83 @@ module XTwitterScraper credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol, resolved_x_user_id: String } ) end def to_hash end + + module Source + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FOLLOWERS = + T.let( + :followers, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + FOLLOWING = + T.let( + :following, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + PAGINATION_CAP = + T.let( + :paginationCap, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + POSTS = + T.let( + :posts, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + QUOTE_COUNT = + T.let( + :quoteCount, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + REPLY_COUNT = + T.let( + :replyCount, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + RESULTS_LIMIT = + T.let( + :resultsLimit, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + RETWEET_COUNT = + T.let( + :retweetCount, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::ExtractionEstimateCostResponse::Source::TaggedSymbol + ] + ) + end + def self.values + end + end end end end 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 9ea0141..66402d3 100644 --- a/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_export_results_params.rbi @@ -20,20 +20,10 @@ module XTwitterScraper # Export file format sig do returns( - T.nilable( - XTwitterScraper::ExtractionExportResultsParams::Format::OrSymbol - ) + XTwitterScraper::ExtractionExportResultsParams::Format::OrSymbol ) end - attr_reader :format_ - - sig do - params( - format_: - XTwitterScraper::ExtractionExportResultsParams::Format::OrSymbol - ).void - end - attr_writer :format_ + attr_accessor :format_ sig do params( @@ -46,7 +36,7 @@ module XTwitterScraper def self.new( id:, # Export file format - format_: nil, + format_:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/models/extraction_job.rbi b/rbi/x_twitter_scraper/models/extraction_job.rbi index 52f77cc..1377afe 100644 --- a/rbi/x_twitter_scraper/models/extraction_job.rbi +++ b/rbi/x_twitter_scraper/models/extraction_job.rbi @@ -131,6 +131,11 @@ module XTwitterScraper :community_search, XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol ) + FAVORITERS = + T.let( + :favoriters, + XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol + ) FOLLOWER_EXPLORER = T.let( :follower_explorer, @@ -201,6 +206,16 @@ module XTwitterScraper :tweet_search_extractor, XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol ) + USER_LIKES = + T.let( + :user_likes, + XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol + ) + USER_MEDIA = + T.let( + :user_media, + XTwitterScraper::ExtractionJob::ToolType::TaggedSymbol + ) VERIFIED_FOLLOWER_EXPLORER = T.let( :verified_follower_explorer, diff --git a/rbi/x_twitter_scraper/models/extraction_list_params.rbi b/rbi/x_twitter_scraper/models/extraction_list_params.rbi index 86b2e75..e145ad7 100644 --- a/rbi/x_twitter_scraper/models/extraction_list_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_list_params.rbi @@ -14,14 +14,17 @@ module XTwitterScraper ) end - # Cursor for keyset pagination + # Cursor for keyset pagination from prior response next_cursor sig { returns(T.nilable(String)) } - attr_reader :after + attr_reader :cursor - sig { params(after: String).void } - attr_writer :after + sig { params(cursor: String).void } + attr_writer :cursor - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -60,7 +63,7 @@ module XTwitterScraper sig do params( - after: String, + cursor: String, limit: Integer, status: XTwitterScraper::ExtractionListParams::Status::OrSymbol, tool_type: XTwitterScraper::ExtractionListParams::ToolType::OrSymbol, @@ -68,9 +71,12 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Cursor for keyset pagination - after: nil, - # Maximum number of items to return (1-100, default 50) + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, # Filter by job status status: nil, @@ -83,7 +89,7 @@ module XTwitterScraper sig do override.returns( { - after: String, + cursor: String, limit: Integer, status: XTwitterScraper::ExtractionListParams::Status::OrSymbol, tool_type: @@ -167,6 +173,11 @@ module XTwitterScraper :community_search, XTwitterScraper::ExtractionListParams::ToolType::TaggedSymbol ) + FAVORITERS = + T.let( + :favoriters, + XTwitterScraper::ExtractionListParams::ToolType::TaggedSymbol + ) FOLLOWER_EXPLORER = T.let( :follower_explorer, @@ -237,6 +248,16 @@ module XTwitterScraper :tweet_search_extractor, XTwitterScraper::ExtractionListParams::ToolType::TaggedSymbol ) + USER_LIKES = + T.let( + :user_likes, + XTwitterScraper::ExtractionListParams::ToolType::TaggedSymbol + ) + USER_MEDIA = + T.let( + :user_media, + XTwitterScraper::ExtractionListParams::ToolType::TaggedSymbol + ) VERIFIED_FOLLOWER_EXPLORER = T.let( :verified_follower_explorer, diff --git a/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi b/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi index 424c84d..017cd63 100644 --- a/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_retrieve_params.rbi @@ -17,12 +17,12 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Cursor for keyset pagination + # Cursor for keyset pagination from prior response next_cursor sig { returns(T.nilable(String)) } - attr_reader :after + attr_reader :cursor - sig { params(after: String).void } - attr_writer :after + sig { params(cursor: String).void } + attr_writer :cursor # Maximum number of results to return (1-1000, default 100) sig { returns(T.nilable(Integer)) } @@ -34,15 +34,15 @@ module XTwitterScraper sig do params( id: String, - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # Cursor for keyset pagination - after: nil, + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, # Maximum number of results to return (1-1000, default 100) limit: nil, request_options: {} @@ -53,7 +53,7 @@ module XTwitterScraper override.returns( { id: String, - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/extraction_run_params.rbi b/rbi/x_twitter_scraper/models/extraction_run_params.rbi index d965b4e..1c2c0e0 100644 --- a/rbi/x_twitter_scraper/models/extraction_run_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_run_params.rbi @@ -25,6 +25,35 @@ module XTwitterScraper sig { params(advanced_query: String).void } attr_writer :advanced_query + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :bounding_box + + sig { params(bounding_box: String).void } + attr_writer :bounding_box + + # Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Exact phrase to match (tweet_search_extractor) sig { returns(T.nilable(String)) } attr_reader :exact_phrase @@ -32,31 +61,217 @@ module XTwitterScraper sig { params(exact_phrase: String).void } attr_writer :exact_phrase - # Words to exclude from results (tweet_search_extractor) + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # (tweet_search_extractor) sig { returns(T.nilable(String)) } attr_reader :exclude_words sig { params(exclude_words: String).void } attr_writer :exclude_words + # Filter by author username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Search within a list ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :list_id + + sig { params(list_id: String).void } + attr_writer :list_id + + # Media type filter (tweet_search_extractor) + sig do + returns( + T.nilable(XTwitterScraper::ExtractionRunParams::MediaType::OrSymbol) + ) + end + attr_reader :media_type + + sig do + params( + media_type: XTwitterScraper::ExtractionRunParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold (tweet_search_extractor) + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Search within a place ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :place + + sig { params(place: String).void } + attr_writer :place + + # Search within a country code (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :place_country + + sig { params(place_country: String).void } + attr_writer :place_country + + # Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :point_radius + + sig { params(point_radius: String).void } + attr_writer :point_radius + + # Quote mode (tweet_search_extractor) + sig do + returns( + T.nilable(XTwitterScraper::ExtractionRunParams::Quotes::OrSymbol) + ) + end + attr_reader :quotes + + sig do + params( + quotes: XTwitterScraper::ExtractionRunParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode (tweet_search_extractor) + sig do + returns( + T.nilable(XTwitterScraper::ExtractionRunParams::Replies::OrSymbol) + ) + end + attr_reader :replies + + sig do + params( + replies: XTwitterScraper::ExtractionRunParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Maximum number of results to extract. When set, the extraction stops after + # reaching this limit. + sig { returns(T.nilable(Integer)) } + attr_reader :results_limit + + sig { params(results_limit: Integer).void } + attr_writer :results_limit + + # Retweet mode (tweet_search_extractor) + sig do + returns( + T.nilable(XTwitterScraper::ExtractionRunParams::Retweets::OrSymbol) + ) + end + attr_reader :retweets + + sig do + params( + retweets: XTwitterScraper::ExtractionRunParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Required for tweet_search_extractor & community_search. sig { returns(T.nilable(String)) } attr_reader :search_query sig { params(search_query: String).void } attr_writer :search_query + # Start date YYYY-MM-DD (tweet_search_extractor) + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Required for community_post_extractor & community_search. sig { returns(T.nilable(String)) } attr_reader :target_community_id sig { params(target_community_id: String).void } attr_writer :target_community_id + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. sig { returns(T.nilable(String)) } attr_reader :target_list_id sig { params(target_list_id: String).void } attr_writer :target_list_id + # Required for space_explorer. sig { returns(T.nilable(String)) } attr_reader :target_space_id @@ -75,18 +290,75 @@ module XTwitterScraper sig { params(target_username: String).void } attr_writer :target_username + # Filter replies sent to a username (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date YYYY-MM-DD (tweet_search_extractor) + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter (tweet_search_extractor) + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only verified authors (tweet_search_extractor) + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( tool_type: XTwitterScraper::ExtractionRunParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::ExtractionRunParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::ExtractionRunParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::ExtractionRunParams::Replies::OrSymbol, + results_limit: Integer, + retweets: XTwitterScraper::ExtractionRunParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -95,16 +367,82 @@ module XTwitterScraper tool_type:, # Raw advanced search query appended as-is (tweet_search_extractor) advanced_query: nil, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. (tweet_search_extractor) + any_words: nil, + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + bounding_box: nil, + # Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + cashtags: nil, + # Conversation ID filter (tweet_search_extractor) + conversation_id: nil, # Exact phrase to match (tweet_search_extractor) exact_phrase: nil, - # Words to exclude from results (tweet_search_extractor) + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # (tweet_search_extractor) exclude_words: nil, + # Filter by author username (tweet_search_extractor) + from_user: nil, + # Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + hashtags: nil, + # Only replies to this tweet ID (tweet_search_extractor) + in_reply_to_tweet_id: nil, + # Language code filter (tweet_search_extractor) + language: nil, + # Search within a list ID (tweet_search_extractor) + list_id: nil, + # Media type filter (tweet_search_extractor) + media_type: nil, + # Filter tweets mentioning a username (tweet_search_extractor) + mentioning: nil, + # Minimum likes threshold (tweet_search_extractor) + min_faves: nil, + # Minimum quote count threshold (tweet_search_extractor) + min_quotes: nil, + # Minimum replies threshold (tweet_search_extractor) + min_replies: nil, + # Minimum retweets threshold (tweet_search_extractor) + min_retweets: nil, + # Search within a place ID (tweet_search_extractor) + place: nil, + # Search within a country code (tweet_search_extractor) + place_country: nil, + # Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + point_radius: nil, + # Quote mode (tweet_search_extractor) + quotes: nil, + # Only quotes of this tweet ID (tweet_search_extractor) + quotes_of_tweet_id: nil, + # Reply mode (tweet_search_extractor) + replies: nil, + # Maximum number of results to extract. When set, the extraction stops after + # reaching this limit. + results_limit: nil, + # Retweet mode (tweet_search_extractor) + retweets: nil, + # Only retweets of this tweet ID (tweet_search_extractor) + retweets_of_tweet_id: nil, + # Required for tweet_search_extractor & community_search. search_query: nil, + # Start date YYYY-MM-DD (tweet_search_extractor) + since_date: nil, + # Required for community_post_extractor & community_search. target_community_id: nil, + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. target_list_id: nil, + # Required for space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, + # Filter replies sent to a username (tweet_search_extractor) + to_user: nil, + # End date YYYY-MM-DD (tweet_search_extractor) + until_date: nil, + # URL substring or domain filter (tweet_search_extractor) + url: nil, + # Only verified authors (tweet_search_extractor) + verified_only: nil, request_options: {} ) end @@ -114,14 +452,44 @@ module XTwitterScraper { tool_type: XTwitterScraper::ExtractionRunParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: + XTwitterScraper::ExtractionRunParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::ExtractionRunParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::ExtractionRunParams::Replies::OrSymbol, + results_limit: Integer, + retweets: XTwitterScraper::ExtractionRunParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) @@ -164,6 +532,11 @@ module XTwitterScraper :community_search, XTwitterScraper::ExtractionRunParams::ToolType::TaggedSymbol ) + FAVORITERS = + T.let( + :favoriters, + XTwitterScraper::ExtractionRunParams::ToolType::TaggedSymbol + ) FOLLOWER_EXPLORER = T.let( :follower_explorer, @@ -234,6 +607,16 @@ module XTwitterScraper :tweet_search_extractor, XTwitterScraper::ExtractionRunParams::ToolType::TaggedSymbol ) + USER_LIKES = + T.let( + :user_likes, + XTwitterScraper::ExtractionRunParams::ToolType::TaggedSymbol + ) + USER_MEDIA = + T.let( + :user_media, + XTwitterScraper::ExtractionRunParams::ToolType::TaggedSymbol + ) VERIFIED_FOLLOWER_EXPLORER = T.let( :verified_follower_explorer, @@ -250,6 +633,167 @@ module XTwitterScraper def self.values end end + + # Media type filter (tweet_search_extractor) + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::ExtractionRunParams::MediaType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionRunParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode (tweet_search_extractor) + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::ExtractionRunParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionRunParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionRunParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionRunParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::ExtractionRunParams::Quotes::TaggedSymbol] + ) + end + def self.values + end + end + + # Reply mode (tweet_search_extractor) + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::ExtractionRunParams::Replies) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionRunParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionRunParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionRunParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionRunParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode (tweet_search_extractor) + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::ExtractionRunParams::Retweets) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::ExtractionRunParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::ExtractionRunParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::ExtractionRunParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::ExtractionRunParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/extraction_run_response.rbi b/rbi/x_twitter_scraper/models/extraction_run_response.rbi index 2b74df7..087ff89 100644 --- a/rbi/x_twitter_scraper/models/extraction_run_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_run_response.rbi @@ -92,6 +92,11 @@ module XTwitterScraper :community_search, XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol ) + FAVORITERS = + T.let( + :favoriters, + XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol + ) FOLLOWER_EXPLORER = T.let( :follower_explorer, @@ -162,6 +167,16 @@ module XTwitterScraper :tweet_search_extractor, XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol ) + USER_LIKES = + T.let( + :user_likes, + XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol + ) + USER_MEDIA = + T.let( + :user_media, + XTwitterScraper::Models::ExtractionRunResponse::ToolType::TaggedSymbol + ) VERIFIED_FOLLOWER_EXPLORER = T.let( :verified_follower_explorer, diff --git a/rbi/x_twitter_scraper/models/guest_wallet_amount.rbi b/rbi/x_twitter_scraper/models/guest_wallet_amount.rbi new file mode 100644 index 0000000..fc023c1 --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_amount.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletAmount < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::GuestWalletAmount, + XTwitterScraper::Internal::AnyHash + ) + end + + # USD amount in cents. Accepted range is $10-$250. + sig { returns(Integer) } + attr_accessor :amount_minor + + sig { returns(Symbol) } + attr_accessor :currency + + # Confirmed USD amount for a guest wallet purchase. + sig do + params(amount_minor: Integer, currency: Symbol).returns( + T.attached_class + ) + end + def self.new( + # USD amount in cents. Accepted range is $10-$250. + amount_minor:, + currency: :usd + ) + end + + sig { override.returns({ amount_minor: Integer, currency: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi b/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi new file mode 100644 index 0000000..2fd4336 --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::GuestWalletCreateParams, + XTwitterScraper::Internal::AnyHash + ) + end + + # Confirmed USD amount in cents. + sig { returns(Integer) } + attr_accessor :amount_minor + + sig { returns(Symbol) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :idempotency_key + + sig do + params( + amount_minor: Integer, + idempotency_key: String, + currency: Symbol, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Confirmed USD amount in cents. + amount_minor:, + idempotency_key:, + currency: :usd, + request_options: {} + ) + end + + sig do + override.returns( + { + amount_minor: Integer, + currency: Symbol, + idempotency_key: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi b/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi new file mode 100644 index 0000000..002b972 --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi @@ -0,0 +1,243 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletCreateResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletCreateResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :account_required + + # Confirmed USD amount for a guest wallet purchase. + sig { returns(XTwitterScraper::GuestWalletAmount) } + attr_reader :amount + + sig { params(amount: XTwitterScraper::GuestWalletAmount::OrHash).void } + attr_writer :amount + + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + sig { returns(String) } + attr_accessor :api_key + + sig do + returns( + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization + ) + end + attr_reader :authorization + + sig do + params( + authorization: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::OrHash + ).void + end + attr_writer :authorization + + # Raw Stripe-hosted checkout URL for user interaction. + sig { returns(String) } + attr_accessor :checkout_url + + sig { returns(Symbol) } + attr_accessor :credential_notice + + # Credits granted after verified payment. + sig { returns(String) } + attr_accessor :credits + + # Time when the pending checkout expires. + sig { returns(Time) } + attr_accessor :expires_at + + sig { returns(Symbol) } + attr_accessor :instructions + + # Wait at least this long before polling status_url. + sig { returns(Integer) } + attr_accessor :poll_after_seconds + + sig { returns(String) } + attr_accessor :purchase_id + + sig { returns(T::Boolean) } + attr_accessor :requires_user_interaction + + sig do + returns( + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(Symbol) } + attr_accessor :status_url + + sig { returns(String) } + attr_accessor :wallet_id + + # Initial guest wallet response containing the one-time key. + sig do + params( + amount: XTwitterScraper::GuestWalletAmount::OrHash, + api_key: String, + authorization: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::OrHash, + checkout_url: String, + credits: String, + expires_at: Time, + purchase_id: String, + status: + XTwitterScraper::Models::GuestWalletCreateResponse::Status::OrSymbol, + wallet_id: String, + account_required: T::Boolean, + credential_notice: Symbol, + instructions: Symbol, + poll_after_seconds: Integer, + requires_user_interaction: T::Boolean, + status_url: Symbol + ).returns(T.attached_class) + end + def self.new( + # Confirmed USD amount for a guest wallet purchase. + amount:, + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + api_key:, + authorization:, + # Raw Stripe-hosted checkout URL for user interaction. + checkout_url:, + # Credits granted after verified payment. + credits:, + # Time when the pending checkout expires. + expires_at:, + purchase_id:, + status:, + wallet_id:, + account_required: false, + credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + # Wait at least this long before polling status_url. + poll_after_seconds: 2, + requires_user_interaction: true, + status_url: :"https://xquik.com/api/v1/guest-wallets/status" + ) + end + + sig do + override.returns( + { + account_required: T::Boolean, + amount: XTwitterScraper::GuestWalletAmount, + api_key: String, + authorization: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + checkout_url: String, + credential_notice: Symbol, + credits: String, + expires_at: Time, + instructions: Symbol, + poll_after_seconds: Integer, + purchase_id: String, + requires_user_interaction: T::Boolean, + status: + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol, + status_url: Symbol, + wallet_id: String + } + ) + end + def to_hash + end + + class Authorization < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :header + + sig { returns(Symbol) } + attr_accessor :scheme + + sig { params(header: Symbol, scheme: Symbol).returns(T.attached_class) } + def self.new(header: :Authorization, scheme: :Bearer) + end + + sig { override.returns({ header: Symbol, scheme: Symbol }) } + def to_hash + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATING = + T.let( + :creating, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + PAID = + T.let( + :paid, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + DISPUTED = + T.let( + :disputed, + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/api_key_list_params.rbi b/rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbi similarity index 81% rename from rbi/x_twitter_scraper/models/api_key_list_params.rbi rename to rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbi index ed8d431..90632d0 100644 --- a/rbi/x_twitter_scraper/models/api_key_list_params.rbi +++ b/rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbi @@ -2,14 +2,14 @@ module XTwitterScraper module Models - class APIKeyListParams < XTwitterScraper::Internal::Type::BaseModel + class GuestWalletRetrieveStatusParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters OrHash = T.type_alias do T.any( - XTwitterScraper::APIKeyListParams, + XTwitterScraper::GuestWalletRetrieveStatusParams, XTwitterScraper::Internal::AnyHash ) end diff --git a/rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbi b/rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbi new file mode 100644 index 0000000..004e92d --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbi @@ -0,0 +1,402 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletRetrieveStatusResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :balance + + # Latest guest wallet purchase fulfillment state. + sig do + returns( + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase + ) + ) + end + attr_reader :latest_purchase + + sig do + params( + latest_purchase: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::OrHash + ) + ).void + end + attr_writer :latest_purchase + + # Polling delay while payment is pending. Null means stop. + sig do + returns( + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds::TaggedInteger + ) + ) + end + attr_accessor :poll_after_seconds + + sig { returns(Symbol) } + attr_accessor :scope + + # Combined wallet and pending-checkout state. A pending top-up can coexist with + # usable true. Terminal expired or failed states require a new guest wallet. + sig do + returns( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Top-up action when usable and no checkout is pending. + sig do + returns( + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp + ) + ) + end + attr_reader :top_up + + sig do + params( + top_up: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp::OrHash + ) + ).void + end + attr_writer :top_up + + # Authoritative paid-read readiness. Use instead of status. + sig { returns(T::Boolean) } + attr_accessor :usable + + sig { returns(String) } + attr_accessor :wallet_id + + # Current balance, usability, and latest guest purchase state. + sig do + params( + balance: String, + latest_purchase: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::OrHash + ), + poll_after_seconds: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds::OrInteger + ), + status: + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::OrSymbol, + top_up: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp::OrHash + ), + usable: T::Boolean, + wallet_id: String, + scope: Symbol + ).returns(T.attached_class) + end + def self.new( + balance:, + # Latest guest wallet purchase fulfillment state. + latest_purchase:, + # Polling delay while payment is pending. Null means stop. + poll_after_seconds:, + # Combined wallet and pending-checkout state. A pending top-up can coexist with + # usable true. Terminal expired or failed states require a new guest wallet. + status:, + # Top-up action when usable and no checkout is pending. + top_up:, + # Authoritative paid-read readiness. Use instead of status. + usable:, + wallet_id:, + scope: :paid_reads + ) + end + + sig do + override.returns( + { + balance: String, + latest_purchase: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase + ), + poll_after_seconds: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds::TaggedInteger + ), + scope: Symbol, + status: + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol, + top_up: + T.nilable( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp + ), + usable: T::Boolean, + wallet_id: String + } + ) + end + def to_hash + end + + class LatestPurchase < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase, + XTwitterScraper::Internal::AnyHash + ) + end + + # Confirmed USD amount for a guest wallet purchase. + sig { returns(XTwitterScraper::GuestWalletAmount) } + attr_reader :amount + + sig { params(amount: XTwitterScraper::GuestWalletAmount::OrHash).void } + attr_writer :amount + + # Present only while the purchase is pending. + sig { returns(T.nilable(String)) } + attr_accessor :checkout_url + + sig { returns(String) } + attr_accessor :credits + + sig { returns(Time) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :purchase_id + + sig do + returns( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Latest guest wallet purchase fulfillment state. + sig do + params( + amount: XTwitterScraper::GuestWalletAmount::OrHash, + checkout_url: T.nilable(String), + credits: String, + expires_at: Time, + purchase_id: String, + status: + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Confirmed USD amount for a guest wallet purchase. + amount:, + # Present only while the purchase is pending. + checkout_url:, + credits:, + expires_at:, + purchase_id:, + status: + ) + end + + sig do + override.returns( + { + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: T.nilable(String), + credits: String, + expires_at: Time, + purchase_id: String, + status: + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATING = + T.let( + :creating, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + PAID = + T.let( + :paid, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + DISPUTED = + T.let( + :disputed, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Polling delay while payment is pending. Null means stop. + module PollAfterSeconds + extend XTwitterScraper::Internal::Type::Enum + + TaggedInteger = + T.type_alias do + T.all( + Integer, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds + ) + end + OrInteger = T.type_alias { Integer } + + POLL_AFTER_SECONDS_2 = + T.let( + 2, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds::TaggedInteger + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds::TaggedInteger + ] + ) + end + def self.values + end + end + + # Combined wallet and pending-checkout state. A pending top-up can coexist with + # usable true. Terminal expired or failed states require a new guest wallet. + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + FROZEN = + T.let( + :frozen, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TopUp < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :method_ + + sig { returns(Symbol) } + attr_accessor :path + + # Top-up action when usable and no checkout is pending. + sig { params(method_: Symbol, path: Symbol).returns(T.attached_class) } + def self.new(method_: :POST, path: :"/api/v1/guest-wallets/topups") + end + + sig { override.returns({ method_: Symbol, path: Symbol }) } + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi b/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi new file mode 100644 index 0000000..6f96c9c --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletTopupParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::GuestWalletTopupParams, + XTwitterScraper::Internal::AnyHash + ) + end + + # Confirmed USD amount in cents. + sig { returns(Integer) } + attr_accessor :amount_minor + + sig { returns(Symbol) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :idempotency_key + + sig do + params( + amount_minor: Integer, + idempotency_key: String, + currency: Symbol, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Confirmed USD amount in cents. + amount_minor:, + idempotency_key:, + currency: :usd, + request_options: {} + ) + end + + sig do + override.returns( + { + amount_minor: Integer, + currency: Symbol, + idempotency_key: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi b/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi new file mode 100644 index 0000000..4b5088a --- /dev/null +++ b/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module XTwitterScraper + module Models + class GuestWalletTopupResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletTopupResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :account_required + + # Confirmed USD amount for a guest wallet purchase. + sig { returns(XTwitterScraper::GuestWalletAmount) } + attr_reader :amount + + sig { params(amount: XTwitterScraper::GuestWalletAmount::OrHash).void } + attr_writer :amount + + # Raw Stripe-hosted checkout URL for user interaction. + sig { returns(String) } + attr_accessor :checkout_url + + # Credits granted after verified payment. + sig { returns(String) } + attr_accessor :credits + + # Time when the pending checkout expires. + sig { returns(Time) } + attr_accessor :expires_at + + sig { returns(Symbol) } + attr_accessor :instructions + + # Wait at least this long before polling status_url. + sig { returns(Integer) } + attr_accessor :poll_after_seconds + + sig { returns(String) } + attr_accessor :purchase_id + + sig { returns(T::Boolean) } + attr_accessor :requires_user_interaction + + sig do + returns( + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(Symbol) } + attr_accessor :status_url + + sig { returns(String) } + attr_accessor :wallet_id + + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + sig { returns(T.nilable(String)) } + attr_reader :api_key + + sig { params(api_key: String).void } + attr_writer :api_key + + sig do + returns( + T.nilable( + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization + ) + ) + end + attr_reader :authorization + + sig do + params( + authorization: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::OrHash + ).void + end + attr_writer :authorization + + sig do + returns( + T.nilable( + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::TaggedSymbol + ) + ) + end + attr_reader :credential_notice + + sig do + params( + credential_notice: + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::OrSymbol + ).void + end + attr_writer :credential_notice + + # Pending Stripe checkout and guest wallet purchase details. + sig do + params( + amount: XTwitterScraper::GuestWalletAmount::OrHash, + checkout_url: String, + credits: String, + expires_at: Time, + purchase_id: String, + status: + XTwitterScraper::Models::GuestWalletTopupResponse::Status::OrSymbol, + wallet_id: String, + api_key: String, + authorization: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::OrHash, + credential_notice: + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::OrSymbol, + account_required: T::Boolean, + instructions: Symbol, + poll_after_seconds: Integer, + requires_user_interaction: T::Boolean, + status_url: Symbol + ).returns(T.attached_class) + end + def self.new( + # Confirmed USD amount for a guest wallet purchase. + amount:, + # Raw Stripe-hosted checkout URL for user interaction. + checkout_url:, + # Credits granted after verified payment. + credits:, + # Time when the pending checkout expires. + expires_at:, + purchase_id:, + status:, + wallet_id:, + # Paid-read bearer credential returned only by initial creation. Store it as a + # secret. Never place it in a URL or log. + api_key: nil, + authorization: nil, + credential_notice: nil, + account_required: false, + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + # Wait at least this long before polling status_url. + poll_after_seconds: 2, + requires_user_interaction: true, + status_url: :"https://xquik.com/api/v1/guest-wallets/status" + ) + end + + sig do + override.returns( + { + account_required: T::Boolean, + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String, + credits: String, + expires_at: Time, + instructions: Symbol, + poll_after_seconds: Integer, + purchase_id: String, + requires_user_interaction: T::Boolean, + status: + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol, + status_url: Symbol, + wallet_id: String, + api_key: String, + authorization: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, + credential_notice: + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletTopupResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATING = + T.let( + :creating, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + PAID = + T.let( + :paid, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + DISPUTED = + T.let( + :disputed, + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletTopupResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Authorization < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :header + + sig { returns(Symbol) } + attr_accessor :scheme + + sig { params(header: Symbol, scheme: Symbol).returns(T.attached_class) } + def self.new(header: :Authorization, scheme: :Bearer) + end + + sig { override.returns({ header: Symbol, scheme: Symbol }) } + def to_hash + end + end + + module CredentialNotice + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STORE_API_KEY_AND_THE_IDEMPOTENCY_KEY_SECURELY_BEFORE_SHARING_CHECKOUT_URL_NO_EMAIL_RECOVERY_IS_AVAILABLE = + T.let( + :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice::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 9921c01..fa0e45c 100644 --- a/rbi/x_twitter_scraper/models/monitor.rbi +++ b/rbi/x_twitter_scraper/models/monitor.rbi @@ -21,6 +21,10 @@ module XTwitterScraper sig { returns(T::Boolean) } attr_accessor :is_active + # Next hourly credit charge time for this account monitor. + sig { returns(Time) } + attr_accessor :next_billing_at + sig { returns(String) } attr_accessor :username @@ -34,6 +38,7 @@ module XTwitterScraper created_at: Time, event_types: T::Array[XTwitterScraper::EventType::OrSymbol], is_active: T::Boolean, + next_billing_at: Time, username: String, x_user_id: String ).returns(T.attached_class) @@ -44,6 +49,8 @@ module XTwitterScraper # Array of event types to subscribe to. event_types:, is_active:, + # Next hourly credit charge time for this account monitor. + next_billing_at:, username:, x_user_id: ) @@ -56,6 +63,7 @@ module XTwitterScraper created_at: Time, event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], is_active: T::Boolean, + next_billing_at: Time, username: String, x_user_id: String } diff --git a/rbi/x_twitter_scraper/models/monitor_create_response.rbi b/rbi/x_twitter_scraper/models/monitor_create_response.rbi index b68050c..c8f204d 100644 --- a/rbi/x_twitter_scraper/models/monitor_create_response.rbi +++ b/rbi/x_twitter_scraper/models/monitor_create_response.rbi @@ -21,6 +21,13 @@ module XTwitterScraper sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types + sig { returns(T::Boolean) } + attr_accessor :is_active + + # Next hourly credit charge time. New active monitors are due immediately. + sig { returns(Time) } + attr_accessor :next_billing_at + sig { returns(String) } attr_accessor :username @@ -32,6 +39,8 @@ module XTwitterScraper id: String, created_at: Time, event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + next_billing_at: Time, username: String, x_user_id: String ).returns(T.attached_class) @@ -41,6 +50,9 @@ module XTwitterScraper created_at:, # Array of event types to subscribe to. event_types:, + is_active:, + # Next hourly credit charge time. New active monitors are due immediately. + next_billing_at:, username:, x_user_id: ) @@ -52,6 +64,8 @@ module XTwitterScraper id: String, created_at: Time, event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + is_active: T::Boolean, + next_billing_at: Time, username: String, x_user_id: String } diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_create_params.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_create_params.rbi new file mode 100644 index 0000000..929e02a --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_create_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Monitors::KeywordCreateParams, + XTwitterScraper::Internal::AnyHash + ) + end + + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::OrSymbol]) } + attr_accessor :event_types + + # X search query to monitor. Whitespace is normalized. + sig { returns(String) } + attr_accessor :query + + sig do + params( + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + query: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Array of event types to subscribe to. + event_types:, + # X search query to monitor. Whitespace is normalized. + query:, + request_options: {} + ) + end + + sig do + override.returns( + { + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + query: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_create_response.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_create_response.rbi new file mode 100644 index 0000000..f6ded24 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_create_response.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordCreateResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordCreateResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } + attr_accessor :event_types + + sig { returns(T::Boolean) } + attr_accessor :is_active + + # Next hourly credit charge time for this keyword query monitor. + sig { returns(Time) } + attr_accessor :next_billing_at + + sig { returns(String) } + attr_accessor :query + + # Keyword monitor that tracks matching public X activity. + sig do + params( + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + is_active:, + # Next hourly credit charge time for this keyword query monitor. + next_billing_at:, + query: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbi new file mode 100644 index 0000000..679b1a1 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordDeactivateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Monitors::KeywordDeactivateParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: XTwitterScraper::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbi new file mode 100644 index 0000000..4f0233d --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordDeactivateResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordDeactivateResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :success + + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success: true) + end + + sig { override.returns({ success: T::Boolean }) } + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_list_params.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_list_params.rbi new file mode 100644 index 0000000..a6c4e47 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_list_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordListParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Monitors::KeywordListParams, + 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/monitors/keyword_list_response.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_list_response.rbi new file mode 100644 index 0000000..3100fa0 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_list_response.rbi @@ -0,0 +1,123 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordListResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordListResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor + ] + ) + end + attr_accessor :monitors + + sig { returns(Integer) } + attr_accessor :total + + sig do + params( + monitors: + T::Array[ + XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor::OrHash + ], + total: Integer + ).returns(T.attached_class) + end + def self.new(monitors:, total:) + end + + sig do + override.returns( + { + monitors: + T::Array[ + XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor + ], + total: Integer + } + ) + end + def to_hash + end + + class Monitor < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } + attr_accessor :event_types + + sig { returns(T::Boolean) } + attr_accessor :is_active + + # Next hourly credit charge time for this keyword query monitor. + sig { returns(Time) } + attr_accessor :next_billing_at + + sig { returns(String) } + attr_accessor :query + + # Keyword monitor that tracks matching public X activity. + sig do + params( + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + is_active:, + # Next hourly credit charge time for this keyword query monitor. + next_billing_at:, + query: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbi new file mode 100644 index 0000000..0700552 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Monitors::KeywordRetrieveParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: XTwitterScraper::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbi new file mode 100644 index 0000000..b286706 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordRetrieveResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } + attr_accessor :event_types + + sig { returns(T::Boolean) } + attr_accessor :is_active + + # Next hourly credit charge time for this keyword query monitor. + sig { returns(Time) } + attr_accessor :next_billing_at + + sig { returns(String) } + attr_accessor :query + + # Keyword monitor that tracks matching public X activity. + sig do + params( + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + is_active:, + # Next hourly credit charge time for this keyword query monitor. + next_billing_at:, + query: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_update_params.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_update_params.rbi new file mode 100644 index 0000000..e6037c3 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_update_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordUpdateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Monitors::KeywordUpdateParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Array of event types to subscribe to. + sig do + returns(T.nilable(T::Array[XTwitterScraper::EventType::OrSymbol])) + end + attr_reader :event_types + + sig do + params( + event_types: T::Array[XTwitterScraper::EventType::OrSymbol] + ).void + end + attr_writer :event_types + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_active + + sig { params(is_active: T::Boolean).void } + attr_writer :is_active + + sig do + params( + id: String, + 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:, + # 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::EventType::OrSymbol], + is_active: T::Boolean, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/monitors/keyword_update_response.rbi b/rbi/x_twitter_scraper/models/monitors/keyword_update_response.rbi new file mode 100644 index 0000000..25583f5 --- /dev/null +++ b/rbi/x_twitter_scraper/models/monitors/keyword_update_response.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module XTwitterScraper + module Models + module Monitors + class KeywordUpdateResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Monitors::KeywordUpdateResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + # Array of event types to subscribe to. + sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } + attr_accessor :event_types + + sig { returns(T::Boolean) } + attr_accessor :is_active + + # Next hourly credit charge time for this keyword query monitor. + sig { returns(Time) } + attr_accessor :next_billing_at + + sig { returns(String) } + attr_accessor :query + + # Keyword monitor that tracks matching public X activity. + sig do + params( + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + # Array of event types to subscribe to. + event_types:, + is_active:, + # Next hourly credit charge time for this keyword query monitor. + next_billing_at:, + query: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + is_active: T::Boolean, + next_billing_at: Time, + query: String + } + ) + end + def to_hash + 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 0f975e4..46f7dc0 100644 --- a/rbi/x_twitter_scraper/models/paginated_tweets.rbi +++ b/rbi/x_twitter_scraper/models/paginated_tweets.rbi @@ -20,7 +20,11 @@ module XTwitterScraper sig { returns(T::Array[XTwitterScraper::SearchTweet]) } attr_accessor :tweets - # Paginated list of tweets with cursor-based navigation. + # Paginated tweet results. The item count can be lower than pageSize when the + # source returns fewer tweets, filters remove tweets, or remaining credits cover + # fewer results. Follow next_cursor while has_next_page is true. An empty page can + # still have has_next_page true after filtering. Zero affordable results returns + # 402 insufficient_credits. sig do params( has_next_page: T::Boolean, diff --git a/rbi/x_twitter_scraper/models/paginated_users.rbi b/rbi/x_twitter_scraper/models/paginated_users.rbi index 8cd0882..2a09cff 100644 --- a/rbi/x_twitter_scraper/models/paginated_users.rbi +++ b/rbi/x_twitter_scraper/models/paginated_users.rbi @@ -20,7 +20,11 @@ module XTwitterScraper sig { returns(T::Array[XTwitterScraper::UserProfile]) } attr_accessor :users - # Paginated list of user profiles with cursor-based navigation. + # Paginated user profiles. The item count can be lower than pageSize when the + # source returns fewer profiles or remaining credits cover fewer results. Follow + # next_cursor while has_next_page is true. A relationship can naturally contain + # fewer profiles than requested. Zero affordable results returns 402 + # insufficient_credits. sig do params( has_next_page: T::Boolean, diff --git a/rbi/x_twitter_scraper/models/radar_item.rbi b/rbi/x_twitter_scraper/models/radar_item.rbi index 1855836..7eec65c 100644 --- a/rbi/x_twitter_scraper/models/radar_item.rbi +++ b/rbi/x_twitter_scraper/models/radar_item.rbi @@ -8,7 +8,7 @@ module XTwitterScraper T.any(XTwitterScraper::RadarItem, XTwitterScraper::Internal::AnyHash) end - # Internal numeric identifier (stringified bigint). + # Radar item identifier. sig { returns(String) } attr_accessor :id @@ -93,7 +93,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Internal numeric identifier (stringified bigint). + # Radar item identifier. id:, category:, created_at:, 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 49fd852..cfd1c37 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 @@ -39,7 +39,7 @@ module XTwitterScraper end attr_writer :category - # Lookback window in hours (1-168, default 24). + # Lookback window in hours (1-72, default 6). sig { returns(T.nilable(Integer)) } attr_reader :hours @@ -53,7 +53,7 @@ module XTwitterScraper sig { params(limit: Integer).void } attr_writer :limit - # Region filter (us, global, etc.) + # Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. sig { returns(T.nilable(String)) } attr_reader :region @@ -97,11 +97,11 @@ module XTwitterScraper after: nil, # Filter by category. category: nil, - # Lookback window in hours (1-168, default 24). + # Lookback window in hours (1-72, default 6). hours: nil, # Number of items to return (1-100, default 50). limit: nil, - # Region filter (us, global, etc.) + # Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. region: nil, # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia diff --git a/rbi/x_twitter_scraper/models/search_tweet.rbi b/rbi/x_twitter_scraper/models/search_tweet.rbi index 82d4779..322add8 100644 --- a/rbi/x_twitter_scraper/models/search_tweet.rbi +++ b/rbi/x_twitter_scraper/models/search_tweet.rbi @@ -14,20 +14,52 @@ module XTwitterScraper 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(T.nilable(XTwitterScraper::SearchTweet::Author)) } + sig { returns(Integer) } + attr_accessor :view_count + + # X user profile with bio, follower counts, and verification status. + sig { returns(T.nilable(XTwitterScraper::UserProfile)) } attr_reader :author - sig { params(author: XTwitterScraper::SearchTweet::Author::OrHash).void } + sig { params(author: XTwitterScraper::UserProfile::OrHash).void } attr_writer :author - sig { returns(T.nilable(Integer)) } - attr_reader :bookmark_count + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } + attr_reader :content_disclosure + + sig do + params( + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash + ).void + end + attr_writer :content_disclosure + + # Root tweet ID for the search result conversation + sig { returns(T.nilable(String)) } + attr_reader :conversation_id - sig { params(bookmark_count: Integer).void } - attr_writer :bookmark_count + sig { params(conversation_id: String).void } + attr_writer :conversation_id sig { returns(T.nilable(String)) } attr_reader :created_at @@ -35,6 +67,49 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at + # Start and end offsets for rendered tweet text + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :display_text_range + + sig { params(display_text_range: T::Array[Integer]).void } + attr_writer :display_text_range + + # Parsed search-result entities including URLs, mentions, hashtags, and media + # markers + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + # Tweet ID being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_id + + sig { params(in_reply_to_id: String).void } + attr_writer :in_reply_to_id + + # User ID being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_user_id + + sig { params(in_reply_to_user_id: String).void } + attr_writer :in_reply_to_user_id + + # Username being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_username + + sig { params(in_reply_to_username: String).void } + attr_writer :in_reply_to_username + + # Whether the tweet has limited reply permissions + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_limited_reply + + sig { params(is_limited_reply: T::Boolean).void } + attr_writer :is_limited_reply + # True for Note Tweets (long-form content, up to 25,000 characters) sig { returns(T.nilable(T::Boolean)) } attr_reader :is_note_tweet @@ -42,65 +117,161 @@ module XTwitterScraper sig { params(is_note_tweet: T::Boolean).void } attr_writer :is_note_tweet - sig { returns(T.nilable(Integer)) } - attr_reader :like_count + # True when this search result quotes another tweet + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_quote_status - sig { params(like_count: Integer).void } - attr_writer :like_count + sig { params(is_quote_status: T::Boolean).void } + attr_writer :is_quote_status - sig { returns(T.nilable(Integer)) } - attr_reader :quote_count + # True when this search result is a reply + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_reply - sig { params(quote_count: Integer).void } - attr_writer :quote_count + sig { params(is_reply: T::Boolean).void } + attr_writer :is_reply + + # Tweet language code + sig { returns(T.nilable(String)) } + attr_reader :lang - sig { returns(T.nilable(Integer)) } - attr_reader :reply_count + sig { params(lang: String).void } + attr_writer :lang - sig { params(reply_count: Integer).void } - attr_writer :reply_count + # Search-result media attachments, omitted when no media is present + sig { returns(T.nilable(T::Array[XTwitterScraper::TweetMedia])) } + attr_reader :media - sig { returns(T.nilable(Integer)) } - attr_reader :retweet_count + sig { params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void } + attr_writer :media - sig { params(retweet_count: Integer).void } - attr_writer :retweet_count + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } + attr_reader :quoted_tweet - sig { returns(T.nilable(Integer)) } - attr_reader :view_count + sig { params(quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash).void } + attr_writer :quoted_tweet - sig { params(view_count: Integer).void } - attr_writer :view_count + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } + attr_reader :retweeted_tweet - # Tweet returned from search results with inline author info. + sig do + params(retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash).void + end + attr_writer :retweeted_tweet + + # Client application used to post the tweet + sig { returns(T.nilable(String)) } + attr_reader :source + + sig { params(source: String).void } + attr_writer :source + + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + # Tweet permalink URL + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Tweet returned from search results with inline author info. A zero metric can + # mean X did not report the count. sig do params( id: String, - text: String, - author: XTwitterScraper::SearchTweet::Author::OrHash, bookmark_count: Integer, - created_at: String, - is_note_tweet: T::Boolean, like_count: Integer, quote_count: Integer, reply_count: Integer, retweet_count: Integer, - view_count: Integer + text: String, + view_count: Integer, + author: XTwitterScraper::UserProfile::OrHash, + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, + conversation_id: String, + created_at: String, + display_text_range: T::Array[Integer], + entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + lang: String, + media: T::Array[XTwitterScraper::TweetMedia::OrHash], + quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, + retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, + source: String, + type: String, + url: String ).returns(T.attached_class) end def self.new( id:, + bookmark_count:, + like_count:, + quote_count:, + reply_count:, + retweet_count:, text:, + view_count:, + # X user profile with bio, follower counts, and verification status. author: nil, - bookmark_count: nil, + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + content_disclosure: nil, + # Root tweet ID for the search result conversation + conversation_id: nil, created_at: nil, + # Start and end offsets for rendered tweet text + display_text_range: nil, + # Parsed search-result entities including URLs, mentions, hashtags, and media + # markers + entities: nil, + # Tweet ID being replied to + in_reply_to_id: nil, + # User ID being replied to + in_reply_to_user_id: nil, + # Username being replied to + in_reply_to_username: nil, + # Whether the tweet has limited reply permissions + is_limited_reply: 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, - retweet_count: nil, - view_count: nil + # True when this search result quotes another tweet + is_quote_status: nil, + # True when this search result is a reply + is_reply: nil, + # Tweet language code + lang: nil, + # Search-result media attachments, omitted when no media is present + media: nil, + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + quoted_tweet: nil, + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + retweeted_tweet: nil, + # Client application used to post the tweet + source: nil, + type: nil, + # Tweet permalink URL + url: nil ) end @@ -108,65 +279,38 @@ module XTwitterScraper override.returns( { id: String, - text: String, - author: XTwitterScraper::SearchTweet::Author, bookmark_count: Integer, - created_at: String, - is_note_tweet: T::Boolean, like_count: Integer, quote_count: Integer, reply_count: Integer, retweet_count: Integer, - view_count: Integer + text: String, + view_count: Integer, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: T::Array[Integer], + entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, + is_note_tweet: T::Boolean, + is_quote_status: T::Boolean, + is_reply: T::Boolean, + lang: String, + media: T::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: String } ) end def to_hash end - - class Author < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::SearchTweet::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 diff --git a/rbi/x_twitter_scraper/models/subscribe_create_params.rbi b/rbi/x_twitter_scraper/models/subscribe_create_params.rbi index a0b350b..755a279 100644 --- a/rbi/x_twitter_scraper/models/subscribe_create_params.rbi +++ b/rbi/x_twitter_scraper/models/subscribe_create_params.rbi @@ -14,19 +14,79 @@ module XTwitterScraper ) end + # Subscription tier to pre-select. + sig do + returns( + T.nilable(XTwitterScraper::SubscribeCreateParams::Tier::OrSymbol) + ) + end + attr_reader :tier + sig do params( + tier: XTwitterScraper::SubscribeCreateParams::Tier::OrSymbol + ).void + end + attr_writer :tier + + sig do + params( + tier: XTwitterScraper::SubscribeCreateParams::Tier::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(request_options: {}) + def self.new( + # Subscription tier to pre-select. + tier: nil, + request_options: {} + ) end sig do - override.returns({ request_options: XTwitterScraper::RequestOptions }) + override.returns( + { + tier: XTwitterScraper::SubscribeCreateParams::Tier::OrSymbol, + request_options: XTwitterScraper::RequestOptions + } + ) end def to_hash end + + # Subscription tier to pre-select. + module Tier + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::SubscribeCreateParams::Tier) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STARTER = + T.let( + :starter, + XTwitterScraper::SubscribeCreateParams::Tier::TaggedSymbol + ) + PRO = + T.let( + :pro, + XTwitterScraper::SubscribeCreateParams::Tier::TaggedSymbol + ) + BUSINESS = + T.let( + :business, + XTwitterScraper::SubscribeCreateParams::Tier::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::SubscribeCreateParams::Tier::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/subscribe_create_response.rbi b/rbi/x_twitter_scraper/models/subscribe_create_response.rbi index 614c1cb..42fd472 100644 --- a/rbi/x_twitter_scraper/models/subscribe_create_response.rbi +++ b/rbi/x_twitter_scraper/models/subscribe_create_response.rbi @@ -12,49 +12,36 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :url - - sig { returns(T.nilable(String)) } - attr_reader :message - - sig { params(message: String).void } - attr_writer :message + attr_accessor :message sig do returns( - T.nilable( - XTwitterScraper::Models::SubscribeCreateResponse::Status::TaggedSymbol - ) + XTwitterScraper::Models::SubscribeCreateResponse::Status::TaggedSymbol ) end - attr_reader :status + attr_accessor :status - sig do - params( - status: - XTwitterScraper::Models::SubscribeCreateResponse::Status::OrSymbol - ).void - end - attr_writer :status + sig { returns(String) } + attr_accessor :url sig do params( - url: String, message: String, status: - XTwitterScraper::Models::SubscribeCreateResponse::Status::OrSymbol + XTwitterScraper::Models::SubscribeCreateResponse::Status::OrSymbol, + url: String ).returns(T.attached_class) end - def self.new(url:, message: nil, status: nil) + def self.new(message:, status:, url:) end sig do override.returns( { - url: String, message: String, status: - XTwitterScraper::Models::SubscribeCreateResponse::Status::TaggedSymbol + XTwitterScraper::Models::SubscribeCreateResponse::Status::TaggedSymbol, + url: String } ) end diff --git a/rbi/x_twitter_scraper/models/tweet_media.rbi b/rbi/x_twitter_scraper/models/tweet_media.rbi new file mode 100644 index 0000000..fee1ad6 --- /dev/null +++ b/rbi/x_twitter_scraper/models/tweet_media.rbi @@ -0,0 +1,130 @@ +# typed: strong + +module XTwitterScraper + module Models + class TweetMedia < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(XTwitterScraper::TweetMedia, XTwitterScraper::Internal::AnyHash) + end + + # Media preview URL + sig { returns(String) } + attr_accessor :media_url + + sig { returns(XTwitterScraper::TweetMedia::Type::TaggedSymbol) } + attr_accessor :type + + # X media link from the tweet + sig { returns(String) } + attr_accessor :url + + # Available video encodings, ordered as returned + sig do + returns(T.nilable(T::Array[XTwitterScraper::TweetMedia::VideoVariant])) + end + attr_reader :video_variants + + sig do + params( + video_variants: + T::Array[XTwitterScraper::TweetMedia::VideoVariant::OrHash] + ).void + end + attr_writer :video_variants + + # Normalized media attached to a tweet. + sig do + params( + media_url: String, + type: XTwitterScraper::TweetMedia::Type::OrSymbol, + url: String, + video_variants: + T::Array[XTwitterScraper::TweetMedia::VideoVariant::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Media preview URL + media_url:, + type:, + # X media link from the tweet + url:, + # Available video encodings, ordered as returned + video_variants: nil + ) + end + + sig do + override.returns( + { + media_url: String, + type: XTwitterScraper::TweetMedia::Type::TaggedSymbol, + url: String, + video_variants: T::Array[XTwitterScraper::TweetMedia::VideoVariant] + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, XTwitterScraper::TweetMedia::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PHOTO = T.let(:photo, XTwitterScraper::TweetMedia::Type::TaggedSymbol) + VIDEO = T.let(:video, XTwitterScraper::TweetMedia::Type::TaggedSymbol) + ANIMATED_GIF = + T.let(:animated_gif, XTwitterScraper::TweetMedia::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[XTwitterScraper::TweetMedia::Type::TaggedSymbol] + ) + end + def self.values + end + end + + class VideoVariant < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::TweetMedia::VideoVariant, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :content_type + + sig { returns(String) } + attr_accessor :url + + sig { returns(T.nilable(Integer)) } + attr_reader :bitrate + + sig { params(bitrate: Integer).void } + attr_writer :bitrate + + sig do + params(content_type: String, url: String, bitrate: Integer).returns( + T.attached_class + ) + end + def self.new(content_type:, url:, bitrate: nil) + end + + sig do + override.returns( + { content_type: String, url: String, bitrate: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/user_profile.rbi b/rbi/x_twitter_scraper/models/user_profile.rbi index e0e0b69..3eda672 100644 --- a/rbi/x_twitter_scraper/models/user_profile.rbi +++ b/rbi/x_twitter_scraper/models/user_profile.rbi @@ -20,6 +20,31 @@ module XTwitterScraper sig { returns(String) } attr_accessor :username + sig { returns(T.nilable(String)) } + attr_reader :automated_by + + sig { params(automated_by: String).void } + attr_writer :automated_by + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :can_dm + + sig { params(can_dm: T::Boolean).void } + attr_writer :can_dm + + # Community role when returned by community member reads + sig { returns(T.nilable(String)) } + attr_reader :community_role + + sig { params(community_role: String).void } + attr_writer :community_role + + sig { returns(T.nilable(String)) } + attr_reader :cover_picture + + sig { params(cover_picture: String).void } + attr_writer :cover_picture + sig { returns(T.nilable(String)) } attr_reader :created_at @@ -32,6 +57,12 @@ module XTwitterScraper sig { params(description: String).void } attr_writer :description + sig { returns(T.nilable(Integer)) } + attr_reader :favourites_count + + sig { params(favourites_count: Integer).void } + attr_writer :favourites_count + sig { returns(T.nilable(Integer)) } attr_reader :followers @@ -44,58 +75,227 @@ module XTwitterScraper sig { params(following: Integer).void } attr_writer :following + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_custom_timelines + + sig { params(has_custom_timelines: T::Boolean).void } + attr_writer :has_custom_timelines + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_automated + + sig { params(is_automated: T::Boolean).void } + attr_writer :is_automated + + # Whether X shows a blue verification badge + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_blue_verified + + sig { params(is_blue_verified: T::Boolean).void } + attr_writer :is_blue_verified + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_translator + + sig { params(is_translator: T::Boolean).void } + attr_writer :is_translator + + # Whether X marks the profile as verified + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_verified + + sig { params(is_verified: T::Boolean).void } + attr_writer :is_verified + sig { returns(T.nilable(String)) } attr_reader :location sig { params(location: String).void } attr_writer :location + sig { returns(T.nilable(Integer)) } + attr_reader :media_count + + sig { params(media_count: Integer).void } + attr_writer :media_count + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pinned_tweet_ids + + sig { params(pinned_tweet_ids: T::Array[String]).void } + attr_writer :pinned_tweet_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :possibly_sensitive + + sig { params(possibly_sensitive: T::Boolean).void } + attr_writer :possibly_sensitive + + # Structured profile bio with entity annotations + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :profile_bio + + sig { params(profile_bio: T::Hash[Symbol, T.anything]).void } + attr_writer :profile_bio + + # Original X profile banner field when available + sig { returns(T.nilable(String)) } + attr_reader :profile_banner_url + + sig { params(profile_banner_url: String).void } + attr_writer :profile_banner_url + sig { returns(T.nilable(String)) } attr_reader :profile_picture sig { params(profile_picture: String).void } attr_writer :profile_picture + # Whether the profile protects its posts + sig { returns(T.nilable(T::Boolean)) } + attr_reader :protected + + sig { params(protected: T::Boolean).void } + attr_writer :protected + 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 :unavailable + + sig { params(unavailable: T::Boolean).void } + attr_writer :unavailable + + sig { returns(T.nilable(String)) } + attr_reader :unavailable_reason + + sig { params(unavailable_reason: String).void } + attr_writer :unavailable_reason + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + sig { returns(T.nilable(T::Boolean)) } attr_reader :verified sig { params(verified: T::Boolean).void } attr_writer :verified + sig { returns(T.nilable(String)) } + attr_reader :verified_type + + sig { params(verified_type: String).void } + attr_writer :verified_type + + # Whether this profile follows the authenticated viewer + sig { returns(T.nilable(T::Boolean)) } + attr_reader :viewer_followed_by + + sig { params(viewer_followed_by: T::Boolean).void } + attr_writer :viewer_followed_by + + # Whether the authenticated viewer follows this profile + sig { returns(T.nilable(T::Boolean)) } + attr_reader :viewer_following + + sig { params(viewer_following: T::Boolean).void } + attr_writer :viewer_following + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :withheld_in_countries + + sig { params(withheld_in_countries: T::Array[String]).void } + attr_writer :withheld_in_countries + # X user profile with bio, follower counts, and verification status. sig do params( id: String, name: String, username: String, + automated_by: String, + can_dm: T::Boolean, + community_role: String, + cover_picture: String, created_at: String, description: String, + favourites_count: Integer, followers: Integer, following: Integer, + has_custom_timelines: T::Boolean, + is_automated: T::Boolean, + is_blue_verified: T::Boolean, + is_translator: T::Boolean, + is_verified: T::Boolean, location: String, + media_count: Integer, + pinned_tweet_ids: T::Array[String], + possibly_sensitive: T::Boolean, + profile_bio: T::Hash[Symbol, T.anything], + profile_banner_url: String, profile_picture: String, + protected: T::Boolean, statuses_count: Integer, - verified: T::Boolean + unavailable: T::Boolean, + unavailable_reason: String, + url: String, + verified: T::Boolean, + verified_type: String, + viewer_followed_by: T::Boolean, + viewer_following: T::Boolean, + withheld_in_countries: T::Array[String] ).returns(T.attached_class) end def self.new( id:, name:, username:, + automated_by: nil, + can_dm: nil, + # Community role when returned by community member reads + community_role: nil, + cover_picture: nil, created_at: nil, description: nil, + favourites_count: nil, followers: nil, following: nil, + has_custom_timelines: nil, + is_automated: nil, + # Whether X shows a blue verification badge + is_blue_verified: nil, + is_translator: nil, + # Whether X marks the profile as verified + is_verified: nil, location: nil, + media_count: nil, + pinned_tweet_ids: nil, + possibly_sensitive: nil, + # Structured profile bio with entity annotations + profile_bio: nil, + # Original X profile banner field when available + profile_banner_url: nil, profile_picture: nil, + # Whether the profile protects its posts + protected: nil, statuses_count: nil, - verified: nil + unavailable: nil, + unavailable_reason: nil, + url: nil, + verified: nil, + verified_type: nil, + # Whether this profile follows the authenticated viewer + viewer_followed_by: nil, + # Whether the authenticated viewer follows this profile + viewer_following: nil, + withheld_in_countries: nil ) end @@ -105,14 +305,37 @@ module XTwitterScraper id: String, name: String, username: String, + automated_by: String, + can_dm: T::Boolean, + community_role: String, + cover_picture: String, created_at: String, description: String, + favourites_count: Integer, followers: Integer, following: Integer, + has_custom_timelines: T::Boolean, + is_automated: T::Boolean, + is_blue_verified: T::Boolean, + is_translator: T::Boolean, + is_verified: T::Boolean, location: String, + media_count: Integer, + pinned_tweet_ids: T::Array[String], + possibly_sensitive: T::Boolean, + profile_bio: T::Hash[Symbol, T.anything], + profile_banner_url: String, profile_picture: String, + protected: T::Boolean, statuses_count: Integer, - verified: T::Boolean + unavailable: T::Boolean, + unavailable_reason: String, + url: String, + verified: T::Boolean, + verified_type: String, + viewer_followed_by: T::Boolean, + viewer_following: T::Boolean, + withheld_in_countries: T::Array[String] } ) end diff --git a/rbi/x_twitter_scraper/models/webhook.rbi b/rbi/x_twitter_scraper/models/webhook.rbi index 0108dec..b244a16 100644 --- a/rbi/x_twitter_scraper/models/webhook.rbi +++ b/rbi/x_twitter_scraper/models/webhook.rbi @@ -11,13 +11,26 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Consecutive failed delivery attempts since the last success. + sig { returns(Integer) } + attr_accessor :consecutive_failures + sig { returns(Time) } attr_accessor :created_at + # Endpoint delivery state. needs_attention means delivery stopped after repeated + # failures. + sig { returns(XTwitterScraper::Webhook::DeliveryStatus::TaggedSymbol) } + attr_accessor :delivery_status + # Array of event types to subscribe to. sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types + # Consecutive delivery failures that pause the endpoint. + sig { returns(Integer) } + attr_accessor :failure_hard_cap + sig { returns(T::Boolean) } attr_accessor :is_active @@ -28,17 +41,27 @@ module XTwitterScraper sig do params( id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: XTwitterScraper::Webhook::DeliveryStatus::OrSymbol, event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + failure_hard_cap: Integer, is_active: T::Boolean, url: String ).returns(T.attached_class) end def self.new( id:, + # Consecutive failed delivery attempts since the last success. + consecutive_failures:, created_at:, + # Endpoint delivery state. needs_attention means delivery stopped after repeated + # failures. + delivery_status:, # Array of event types to subscribe to. event_types:, + # Consecutive delivery failures that pause the endpoint. + failure_hard_cap:, is_active:, url: ) @@ -48,8 +71,12 @@ module XTwitterScraper override.returns( { id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: + XTwitterScraper::Webhook::DeliveryStatus::TaggedSymbol, event_types: T::Array[XTwitterScraper::EventType::TaggedSymbol], + failure_hard_cap: Integer, is_active: T::Boolean, url: String } @@ -57,6 +84,36 @@ module XTwitterScraper end def to_hash end + + # Endpoint delivery state. needs_attention means delivery stopped after repeated + # failures. + module DeliveryStatus + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::Webhook::DeliveryStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:active, XTwitterScraper::Webhook::DeliveryStatus::TaggedSymbol) + PAUSED = + T.let(:paused, XTwitterScraper::Webhook::DeliveryStatus::TaggedSymbol) + NEEDS_ATTENTION = + T.let( + :needs_attention, + XTwitterScraper::Webhook::DeliveryStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[XTwitterScraper::Webhook::DeliveryStatus::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 d3827c9..ce94084 100644 --- a/rbi/x_twitter_scraper/models/webhook_create_response.rbi +++ b/rbi/x_twitter_scraper/models/webhook_create_response.rbi @@ -21,6 +21,7 @@ module XTwitterScraper sig { returns(T::Array[XTwitterScraper::EventType::TaggedSymbol]) } attr_accessor :event_types + # Plaintext HMAC signing secret returned only at creation. sig { returns(String) } attr_accessor :secret @@ -41,6 +42,7 @@ module XTwitterScraper created_at:, # Array of event types to subscribe to. event_types:, + # Plaintext HMAC signing secret returned only at creation. secret:, url: ) diff --git a/rbi/x_twitter_scraper/models/api_key_revoke_params.rbi b/rbi/x_twitter_scraper/models/webhook_resume_params.rbi similarity index 86% rename from rbi/x_twitter_scraper/models/api_key_revoke_params.rbi rename to rbi/x_twitter_scraper/models/webhook_resume_params.rbi index 5f378ee..ae6df57 100644 --- a/rbi/x_twitter_scraper/models/api_key_revoke_params.rbi +++ b/rbi/x_twitter_scraper/models/webhook_resume_params.rbi @@ -2,14 +2,14 @@ module XTwitterScraper module Models - class APIKeyRevokeParams < XTwitterScraper::Internal::Type::BaseModel + class WebhookResumeParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters OrHash = T.type_alias do T.any( - XTwitterScraper::APIKeyRevokeParams, + XTwitterScraper::WebhookResumeParams, XTwitterScraper::Internal::AnyHash ) end diff --git a/rbi/x_twitter_scraper/models/webhook_resume_response.rbi b/rbi/x_twitter_scraper/models/webhook_resume_response.rbi new file mode 100644 index 0000000..0f0a2d5 --- /dev/null +++ b/rbi/x_twitter_scraper/models/webhook_resume_response.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module XTwitterScraper + module Models + class WebhookResumeResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::WebhookResumeResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :status_code + + sig { returns(T::Boolean) } + attr_accessor :success + + # Webhook endpoint registered to receive event deliveries. + sig { returns(XTwitterScraper::Webhook) } + attr_reader :webhook + + sig { params(webhook: XTwitterScraper::Webhook::OrHash).void } + attr_writer :webhook + + sig do + params( + status_code: Integer, + success: T::Boolean, + webhook: XTwitterScraper::Webhook::OrHash + ).returns(T.attached_class) + end + def self.new( + status_code:, + success:, + # Webhook endpoint registered to receive event deliveries. + webhook: + ) + end + + sig do + override.returns( + { + status_code: Integer, + success: T::Boolean, + webhook: XTwitterScraper::Webhook + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbi b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbi new file mode 100644 index 0000000..884500a --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class AccountConnectionChallengeSubmitParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::AccountConnectionChallengeSubmitParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Code sent to the account email. + sig { returns(String) } + attr_accessor :email_code + + sig do + params( + id: String, + email_code: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Code sent to the account email. + email_code:, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + email_code: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi new file mode 100644 index 0000000..17bdb45 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi @@ -0,0 +1,131 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class AccountConnectionChallengeSubmitResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + end + attr_accessor :health + + sig { returns(String) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :x_user_id + + sig { returns(String) } + attr_accessor :x_username + + # Sanitized X account summary returned by connect and reauth. + sig do + params( + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::OrSymbol, + status: String, + x_user_id: String, + x_username: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + health:, + status:, + x_user_id:, + x_username: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol, + status: String, + x_user_id: String, + x_username: String + } + ) + end + def to_hash + end + + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let( + :healthy, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + LOCKED = + T.let( + :locked, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/account_create_params.rbi b/rbi/x_twitter_scraper/models/x/account_create_params.rbi index 4e8a6a0..da203c9 100644 --- a/rbi/x_twitter_scraper/models/x/account_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/account_create_params.rbi @@ -27,13 +27,6 @@ module XTwitterScraper sig { returns(String) } attr_accessor :username - # Proxy country code - sig { returns(T.nilable(String)) } - attr_reader :proxy_country - - sig { params(proxy_country: String).void } - attr_writer :proxy_country - # TOTP secret for 2FA sig { returns(T.nilable(String)) } attr_reader :totp_secret @@ -46,7 +39,6 @@ module XTwitterScraper email: String, password: String, username: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) @@ -58,8 +50,6 @@ module XTwitterScraper password:, # X username username:, - # Proxy country code - proxy_country: nil, # TOTP secret for 2FA totp_secret: nil, request_options: {} @@ -72,7 +62,6 @@ module XTwitterScraper email: String, password: String, username: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/account_create_response.rbi b/rbi/x_twitter_scraper/models/x/account_create_response.rbi index 54b7090..2b6b47c 100644 --- a/rbi/x_twitter_scraper/models/x/account_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_create_response.rbi @@ -34,20 +34,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - sig { returns(T.nilable(String)) } - attr_reader :login_country - - sig { params(login_country: String).void } - attr_writer :login_country - - # Sanitized X account summary returned by connect and reauth. Includes an optional - # `loginCountry` field surfaced only when the declared proxy region had no Driver - # capacity and the login fell back to a single US consumer device for this - # one-time action. Future activity continues to use the selected `proxy_country`; - # the field is omitted on normal logins. + # Sanitized X account summary returned by connect and reauth. sig do params( id: String, @@ -56,8 +43,7 @@ module XTwitterScraper XTwitterScraper::Models::X::AccountCreateResponse::Health::OrSymbol, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String ).returns(T.attached_class) end def self.new( @@ -66,11 +52,7 @@ module XTwitterScraper health:, status:, x_user_id:, - x_username:, - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - login_country: nil + x_username: ) end @@ -83,8 +65,7 @@ module XTwitterScraper XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } ) 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 f1b4103..2707a3b 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi @@ -29,13 +29,6 @@ module XTwitterScraper sig { params(email: String).void } attr_writer :email - # Two-letter country code for login proxy region - sig { returns(T.nilable(String)) } - attr_reader :proxy_country - - sig { params(proxy_country: String).void } - attr_writer :proxy_country - # TOTP secret for 2FA re-authentication sig { returns(T.nilable(String)) } attr_reader :totp_secret @@ -48,7 +41,6 @@ module XTwitterScraper id: String, password: String, email: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) @@ -59,8 +51,6 @@ module XTwitterScraper password:, # Email for the X account (updates stored email) email: nil, - # Two-letter country code for login proxy region - proxy_country: nil, # TOTP secret for 2FA re-authentication totp_secret: nil, request_options: {} @@ -73,7 +63,6 @@ module XTwitterScraper id: String, password: String, email: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi index bac6c89..db7fce2 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi @@ -34,20 +34,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :x_username - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - sig { returns(T.nilable(String)) } - attr_reader :login_country - - sig { params(login_country: String).void } - attr_writer :login_country - - # Sanitized X account summary returned by connect and reauth. Includes an optional - # `loginCountry` field surfaced only when the declared proxy region had no Driver - # capacity and the login fell back to a single US consumer device for this - # one-time action. Future activity continues to use the selected `proxy_country`; - # the field is omitted on normal logins. + # Sanitized X account summary returned by connect and reauth. sig do params( id: String, @@ -56,8 +43,7 @@ module XTwitterScraper XTwitterScraper::Models::X::AccountReauthResponse::Health::OrSymbol, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String ).returns(T.attached_class) end def self.new( @@ -66,11 +52,7 @@ module XTwitterScraper health:, status:, x_user_id:, - x_username:, - # ISO-3166-1 alpha-2 country code of the Driver consumer device used for this - # login. Present only when the US fallback was triggered because Driver had no - # capacity in the declared region. Omitted otherwise. - login_country: nil + x_username: ) end @@ -83,8 +65,7 @@ module XTwitterScraper XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } ) end diff --git a/rbi/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rbi b/rbi/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rbi index 3be18bc..bce1c3c 100644 --- a/rbi/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rbi +++ b/rbi/x_twitter_scraper/models/x/bookmark_retrieve_folders_response.rbi @@ -21,9 +21,11 @@ module XTwitterScraper end attr_accessor :folders + # Always false for the current bookmark folder route sig { returns(T::Boolean) } attr_accessor :has_next_page + # Always empty for the current bookmark folder route sig { returns(String) } attr_accessor :next_cursor @@ -37,7 +39,13 @@ module XTwitterScraper next_cursor: String ).returns(T.attached_class) end - def self.new(folders:, has_next_page:, next_cursor:) + def self.new( + folders:, + # Always false for the current bookmark folder route + has_next_page:, + # Always empty for the current bookmark folder route + next_cursor: + ) end sig do 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 new file mode 100644 index 0000000..f44d3d3 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi @@ -0,0 +1,30 @@ +# 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(T::Boolean) } + attr_accessor :success + + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success: true) + end + + sig { override.returns({ success: T::Boolean }) } + def to_hash + end + end + end + end + end +end 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 new file mode 100644 index 0000000..caec047 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi @@ -0,0 +1,30 @@ +# 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(T::Boolean) } + attr_accessor :success + + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success: true) + end + + sig { override.returns({ success: T::Boolean }) } + 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 index 49b81e6..e759bd8 100644 --- 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 @@ -26,10 +26,22 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -37,6 +49,12 @@ module XTwitterScraper id:, # Pagination cursor for community tweets cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -46,6 +64,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 7e7f7d2..fb58417 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,38 +16,75 @@ module XTwitterScraper ) end - # Search query for cross-community tweets + # Numeric ID of the community to search + sig { returns(String) } + attr_accessor :community_id + + # Keyword query within the selected community sig { returns(String) } attr_accessor :q - # Pagination cursor for cross-community results + # Pagination cursor for community results sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor - # Sort order for cross-community results (Latest or Top) - sig { returns(T.nilable(String)) } + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Sort order for community results (Latest or Top) + sig do + returns( + T.nilable( + XTwitterScraper::X::Communities::TweetListParams::QueryType::OrSymbol + ) + ) + end attr_reader :query_type - sig { params(query_type: String).void } + sig do + params( + query_type: + XTwitterScraper::X::Communities::TweetListParams::QueryType::OrSymbol + ).void + end attr_writer :query_type sig do params( + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::Communities::TweetListParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Search query for cross-community tweets + # Numeric ID of the community to search + community_id:, + # Keyword query within the selected community q:, - # Pagination cursor for cross-community results + # Pagination cursor for community results cursor: nil, - # Sort order for cross-community results (Latest or Top) + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Sort order for community results (Latest or Top) query_type: nil, request_options: {} ) @@ -56,15 +93,53 @@ module XTwitterScraper sig do override.returns( { + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::Communities::TweetListParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Sort order for community results (Latest or Top) + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::Communities::TweetListParams::QueryType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LATEST = + T.let( + :Latest, + XTwitterScraper::X::Communities::TweetListParams::QueryType::TaggedSymbol + ) + TOP = + T.let( + :Top, + XTwitterScraper::X::Communities::TweetListParams::QueryType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::Communities::TweetListParams::QueryType::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/community_action_result.rbi b/rbi/x_twitter_scraper/models/x/community_action_result.rbi deleted file mode 100644 index c9e818b..0000000 --- a/rbi/x_twitter_scraper/models/x/community_action_result.rbi +++ /dev/null @@ -1,49 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Models - module X - class CommunityActionResult < XTwitterScraper::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - XTwitterScraper::X::CommunityActionResult, - 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 - - # Result of a community join or leave action. - 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 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 d439ba8..8190b8f 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 @@ -78,6 +78,23 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator + ) + ) + end + attr_reader :creator + + sig do + params( + creator: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator::OrHash + ).void + end + attr_writer :creator + # About text for the community sig { returns(T.nilable(String)) } attr_reader :description @@ -85,6 +102,27 @@ module XTwitterScraper sig { params(description: String).void } attr_writer :description + # Invitation policy + sig { returns(T.nilable(String)) } + attr_reader :invites_policy + + sig { params(invites_policy: String).void } + attr_writer :invites_policy + + # Whether the authenticated viewer is a member + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_member + + sig { params(is_member: T::Boolean).void } + attr_writer :is_member + + # Whether the community is marked sensitive + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_nsfw + + sig { params(is_nsfw: T::Boolean).void } + attr_writer :is_nsfw + # Join policy (open or restricted) sig { returns(T.nilable(String)) } attr_reader :join_policy @@ -131,6 +169,13 @@ module XTwitterScraper end attr_writer :primary_topic + # Authenticated viewer's community role + sig { returns(T.nilable(String)) } + attr_reader :role + + sig { params(role: String).void } + attr_writer :role + # Community rules sig do returns( @@ -159,13 +204,19 @@ module XTwitterScraper id: String, banner_url: String, created_at: String, + creator: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator::OrHash, description: String, + invites_policy: String, + is_member: T::Boolean, + is_nsfw: T::Boolean, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic::OrHash, + role: String, rules: T::Array[ XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule::OrHash @@ -179,8 +230,15 @@ module XTwitterScraper banner_url: nil, # Community creation timestamp created_at: nil, + creator: nil, # About text for the community description: nil, + # Invitation policy + invites_policy: nil, + # Whether the authenticated viewer is a member + is_member: nil, + # Whether the community is marked sensitive + is_nsfw: nil, # Join policy (open or restricted) join_policy: nil, # Total member count @@ -191,6 +249,8 @@ module XTwitterScraper name: nil, # Primary topic primary_topic: nil, + # Authenticated viewer's community role + role: nil, # Community rules rules: nil ) @@ -202,13 +262,19 @@ module XTwitterScraper id: String, banner_url: String, created_at: String, + creator: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, + invites_policy: String, + is_member: T::Boolean, + is_nsfw: T::Boolean, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + role: String, rules: T::Array[ XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule @@ -219,6 +285,55 @@ module XTwitterScraper def to_hash end + class Creator < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + sig { returns(T::Boolean) } + attr_accessor :verified + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + id: String, + username: String, + verified: T::Boolean, + name: String + ).returns(T.attached_class) + end + def self.new(id:, username:, verified:, name: nil) + end + + sig do + override.returns( + { + id: String, + username: String, + verified: T::Boolean, + name: String + } + ) + end + def to_hash + end + end + class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi index 799a56a..4b2fce2 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_members_params.rbi @@ -25,7 +25,9 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Items per page (20-200, default 20) + # Items per page (20-200, default 20). This is an upper bound for paid + # authenticated calls: remaining credits can reduce the returned page size, and + # zero affordable results returns 402 insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -44,7 +46,9 @@ module XTwitterScraper id:, # Pagination cursor cursor: nil, - # Items per page (20-200, default 20) + # Items per page (20-200, default 20). This is an upper bound for paid + # authenticated calls: remaining credits can reduce the returned page size, and + # zero affordable results returns 402 insufficient_credits. page_size: 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 140bd60..5669add 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 @@ -15,6 +15,10 @@ module XTwitterScraper ) end + # Numeric ID of the community whose posts to search + sig { returns(String) } + attr_accessor :community_id + # Search query sig { returns(String) } attr_accessor :q @@ -26,26 +30,59 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + # Sort order (Latest or Top) - sig { returns(T.nilable(String)) } + sig do + returns( + T.nilable( + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::OrSymbol + ) + ) + end attr_reader :query_type - sig { params(query_type: String).void } + sig do + params( + query_type: + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::OrSymbol + ).void + end attr_writer :query_type sig do params( + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Numeric ID of the community whose posts to search + community_id:, # Search query q:, # Pagination cursor for community search cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, # Sort order (Latest or Top) query_type: nil, request_options: {} @@ -55,15 +92,53 @@ module XTwitterScraper sig do override.returns( { + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Sort order (Latest or Top) + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LATEST = + T.let( + :Latest, + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::TaggedSymbol + ) + TOP = + T.let( + :Top, + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::TaggedSymbol + ] + ) + end + def self.values + end + end end end end 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 2bd7107..b1918c8 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,6 +18,11 @@ module XTwitterScraper sig { returns(String) } attr_accessor :user_id + # X handle (without the `@` prefix) of the connected X account used to read the + # conversation. The account must be a participant in the conversation. + sig { returns(String) } + attr_accessor :account + # Pagination cursor for DM history sig { returns(T.nilable(String)) } attr_reader :cursor @@ -35,6 +40,7 @@ module XTwitterScraper sig do params( user_id: String, + account: String, cursor: String, max_id: String, request_options: XTwitterScraper::RequestOptions::OrHash @@ -42,6 +48,9 @@ module XTwitterScraper end def self.new( user_id:, + # X handle (without the `@` prefix) of the connected X account used to read the + # conversation. The account must be a participant in the conversation. + account:, # Pagination cursor for DM history cursor: nil, # Legacy pagination cursor (backward compat) @@ -54,6 +63,7 @@ module XTwitterScraper override.returns( { user_id: String, + account: String, cursor: String, max_id: String, request_options: XTwitterScraper::RequestOptions diff --git a/rbi/x_twitter_scraper/models/x/dm_retrieve_history_response.rbi b/rbi/x_twitter_scraper/models/x/dm_retrieve_history_response.rbi index f2d46d6..7e43f73 100644 --- a/rbi/x_twitter_scraper/models/x/dm_retrieve_history_response.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_retrieve_history_response.rbi @@ -67,23 +67,25 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + sig { returns(String) } + attr_accessor :receiver_id + + sig { returns(String) } + attr_accessor :sender_id + sig { returns(T.nilable(String)) } attr_reader :created_at sig { params(created_at: String).void } attr_writer :created_at + # URL of attached media (image, GIF, or video). Omitted when the message has no + # media attachment. sig { returns(T.nilable(String)) } - attr_reader :receiver_id + attr_reader :media_url - sig { params(receiver_id: String).void } - attr_writer :receiver_id - - sig { returns(T.nilable(String)) } - attr_reader :sender_id - - sig { params(sender_id: String).void } - attr_writer :sender_id + sig { params(media_url: String).void } + attr_writer :media_url sig { returns(T.nilable(String)) } attr_reader :text @@ -94,17 +96,21 @@ module XTwitterScraper sig do params( id: String, - created_at: String, receiver_id: String, sender_id: String, + created_at: String, + media_url: String, text: String ).returns(T.attached_class) end def self.new( id:, + receiver_id:, + sender_id:, created_at: nil, - receiver_id: nil, - sender_id: nil, + # URL of attached media (image, GIF, or video). Omitted when the message has no + # media attachment. + media_url: nil, text: nil ) end @@ -113,9 +119,10 @@ module XTwitterScraper override.returns( { id: String, - created_at: String, receiver_id: String, sender_id: String, + created_at: String, + media_url: String, text: String } ) 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 3433611..4a15731 100644 --- a/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_send_params.rbi @@ -25,25 +25,19 @@ module XTwitterScraper sig { returns(String) } attr_accessor :text + # Optional array containing exactly 1 uploaded media ID. sig { returns(T.nilable(T::Array[String])) } attr_reader :media_ids sig { params(media_ids: T::Array[String]).void } attr_writer :media_ids - sig { returns(T.nilable(String)) } - attr_reader :reply_to_message_id - - sig { params(reply_to_message_id: String).void } - attr_writer :reply_to_message_id - sig do params( user_id: String, account: String, text: String, media_ids: T::Array[String], - reply_to_message_id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -52,8 +46,8 @@ module XTwitterScraper # X account (@username or ID) sending the DM account:, text:, + # Optional array containing exactly 1 uploaded media ID. media_ids: nil, - reply_to_message_id: nil, request_options: {} ) end @@ -65,7 +59,6 @@ module XTwitterScraper account: String, text: String, media_ids: T::Array[String], - reply_to_message_id: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/follower_check_params.rbi b/rbi/x_twitter_scraper/models/x/follower_check_params.rbi index 4f5601e..11c07cd 100644 --- a/rbi/x_twitter_scraper/models/x/follower_check_params.rbi +++ b/rbi/x_twitter_scraper/models/x/follower_check_params.rbi @@ -15,11 +15,11 @@ module XTwitterScraper ) end - # Username to check (without @) + # Source username, @username, or X or Twitter profile URL sig { returns(String) } attr_accessor :source - # Target username (without @) + # Target username, @username, or X or Twitter profile URL sig { returns(String) } attr_accessor :target @@ -31,9 +31,9 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Username to check (without @) + # Source username, @username, or X or Twitter profile URL source:, - # Target username (without @) + # Target username, @username, or X or Twitter profile URL target:, request_options: {} ) 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 c40f9ea..4db0580 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 @@ -25,10 +25,21 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +47,11 @@ module XTwitterScraper id:, # Pagination cursor for list followers cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +61,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 0c532b7..86a30a6 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 @@ -32,6 +32,17 @@ module XTwitterScraper sig { params(include_replies: T::Boolean).void } attr_writer :include_replies + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + # Unix timestamp - filter after sig { returns(T.nilable(String)) } attr_reader :since_time @@ -51,6 +62,7 @@ module XTwitterScraper id: String, cursor: String, include_replies: T::Boolean, + page_size: Integer, since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash @@ -62,6 +74,12 @@ module XTwitterScraper cursor: nil, # Include replies (default false) include_replies: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, # Unix timestamp - filter after since_time: nil, # Unix timestamp - filter before @@ -76,6 +94,7 @@ module XTwitterScraper id: String, cursor: String, include_replies: T::Boolean, + page_size: Integer, since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions diff --git a/rbi/x_twitter_scraper/models/x/media_download_params.rbi b/rbi/x_twitter_scraper/models/x/media_download_params.rbi index 438786e..96a0ae0 100644 --- a/rbi/x_twitter_scraper/models/x/media_download_params.rbi +++ b/rbi/x_twitter_scraper/models/x/media_download_params.rbi @@ -15,7 +15,14 @@ module XTwitterScraper ) end - # Array of tweet URLs or IDs (bulk, max 50) + # Numeric tweet ID alias for tweetInput + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + # Array of tweet URLs or IDs (bulk, max 50 string items) sig { returns(T.nilable(T::Array[String])) } attr_reader :tweet_ids @@ -29,18 +36,31 @@ module XTwitterScraper sig { params(tweet_input: String).void } attr_writer :tweet_input + # Tweet URL alias for tweetInput + sig { returns(T.nilable(String)) } + attr_reader :tweet_url + + sig { params(tweet_url: String).void } + attr_writer :tweet_url + sig do params( + tweet_id: String, tweet_ids: T::Array[String], tweet_input: String, + tweet_url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Array of tweet URLs or IDs (bulk, max 50) + # Numeric tweet ID alias for tweetInput + tweet_id: nil, + # Array of tweet URLs or IDs (bulk, max 50 string items) tweet_ids: nil, # Tweet URL or ID (single tweet) tweet_input: nil, + # Tweet URL alias for tweetInput + tweet_url: nil, request_options: {} ) end @@ -48,8 +68,10 @@ module XTwitterScraper sig do override.returns( { + tweet_id: String, tweet_ids: T::Array[String], tweet_input: String, + tweet_url: String, request_options: XTwitterScraper::RequestOptions } ) 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 262efb4..16da9f1 100644 --- a/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +++ b/rbi/x_twitter_scraper/models/x/media_upload_params.rbi @@ -15,34 +15,26 @@ module XTwitterScraper ) end - # X account (@username or ID) uploading media + # X account (@username or ID) uploading media from URL sig { returns(String) } attr_accessor :account - # Media file to upload - sig { returns(XTwitterScraper::Internal::FileInput) } - attr_accessor :file - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :is_long_video - - sig { params(is_long_video: T::Boolean).void } - attr_writer :is_long_video + # HTTPS URL to download and upload as media + sig { returns(String) } + attr_accessor :url sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, - is_long_video: T::Boolean, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # X account (@username or ID) uploading media + # X account (@username or ID) uploading media from URL account:, - # Media file to upload - file:, - is_long_video: nil, + # HTTPS URL to download and upload as media + url:, request_options: {} ) end @@ -51,8 +43,7 @@ module XTwitterScraper override.returns( { account: String, - file: XTwitterScraper::Internal::FileInput, - is_long_video: T::Boolean, + url: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/media_upload_response.rbi b/rbi/x_twitter_scraper/models/x/media_upload_response.rbi index 17cefe6..c84fa01 100644 --- a/rbi/x_twitter_scraper/models/x/media_upload_response.rbi +++ b/rbi/x_twitter_scraper/models/x/media_upload_response.rbi @@ -15,18 +15,33 @@ module XTwitterScraper sig { returns(String) } attr_accessor :media_id + # Public media URL for tweet `media` arrays. + sig { returns(String) } + attr_accessor :media_url + sig { returns(T::Boolean) } attr_accessor :success sig do - params(media_id: String, success: T::Boolean).returns( - T.attached_class - ) + params( + media_id: String, + media_url: String, + success: T::Boolean + ).returns(T.attached_class) end - def self.new(media_id:, success: true) + def self.new( + media_id:, + # Public media URL for tweet `media` arrays. + media_url:, + success: true + ) end - sig { override.returns({ media_id: String, success: T::Boolean }) } + sig do + override.returns( + { media_id: String, media_url: String, success: T::Boolean } + ) + end def to_hash end end 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 f635d4b..007d17c 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,26 +15,26 @@ module XTwitterScraper ) end - # X account (@username or ID) for avatar update + # X account (@username or ID) receiving avatar from URL sig { returns(String) } attr_accessor :account - # Avatar image (max 716KB) - sig { returns(XTwitterScraper::Internal::FileInput) } - attr_accessor :file + # HTTPS URL to the avatar image to download + sig { returns(String) } + attr_accessor :url sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # X account (@username or ID) for avatar update + # X account (@username or ID) receiving avatar from URL account:, - # Avatar image (max 716KB) - file:, + # HTTPS URL to the avatar image to download + url:, request_options: {} ) end @@ -43,7 +43,7 @@ module XTwitterScraper override.returns( { account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions } ) 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 d9c3ec1..595c077 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,26 +15,26 @@ module XTwitterScraper ) end - # X account (@username or ID) for banner update + # X account (@username or ID) receiving banner from URL sig { returns(String) } attr_accessor :account - # Banner image (max 2MB) - sig { returns(XTwitterScraper::Internal::FileInput) } - attr_accessor :file + # HTTPS URL to the banner image to download + sig { returns(String) } + attr_accessor :url sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # X account (@username or ID) for banner update + # X account (@username or ID) receiving banner from URL account:, - # Banner image (max 2MB) - file:, + # HTTPS URL to the banner image to download + url:, request_options: {} ) end @@ -43,7 +43,7 @@ module XTwitterScraper override.returns( { account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_author.rbi b/rbi/x_twitter_scraper/models/x/tweet_author.rbi index 0c8c7f1..539887b 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_author.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_author.rbi @@ -3,7 +3,7 @@ module XTwitterScraper module Models module X - class TweetAuthor < XTwitterScraper::Internal::Type::BaseModel + class TweetAuthor < XTwitterScraper::Models::UserProfile OrHash = T.type_alias do T.any( @@ -12,54 +12,23 @@ module XTwitterScraper ) 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 - - # Author of a tweet with follower count and verification status. + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. sig do - params( - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - ).returns(T.attached_class) + params(followers: Integer, verified: T::Boolean).returns( + T.attached_class + ) end - def self.new( - id:, - followers:, - username:, - verified:, - profile_picture: nil - ) + def self.new(followers:, verified:) end - sig do - override.returns( - { - id: String, - followers: Integer, - username: String, - verified: T::Boolean, - profile_picture: String - } - ) - end + sig { override.returns({ followers: Integer, verified: T::Boolean }) } def to_hash end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi index c345ad6..6da3333 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi @@ -37,8 +37,9 @@ module XTwitterScraper sig { params(is_note_tweet: T::Boolean).void } attr_writer :is_note_tweet - # Array of public image URLs to attach (max 4). Each URL must be publicly - # reachable - the browser composer fetches them directly. + # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 + # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 + # credits per started MB across all files. sig { returns(T.nilable(T::Array[String])) } attr_reader :media @@ -76,8 +77,9 @@ module XTwitterScraper attachment_url: nil, community_id: nil, is_note_tweet: nil, - # Array of public image URLs to attach (max 4). Each URL must be publicly - # reachable - the browser composer fetches them directly. + # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 + # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 + # credits per started MB across all files. media: nil, reply_to_tweet_id: nil, # Tweet text (optional when media is provided) diff --git a/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi index 33161dc..4d9027f 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi @@ -12,21 +12,57 @@ module XTwitterScraper ) end + sig { returns(T::Boolean) } + attr_accessor :charged + + # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; + # attached media adds 2 credits per started MB. + sig { returns(String) } + attr_accessor :charged_credits + sig { returns(T::Boolean) } attr_accessor :success sig { returns(String) } attr_accessor :tweet_id + sig { returns(T.nilable(String)) } + attr_reader :write_action_id + + sig { params(write_action_id: String).void } + attr_writer :write_action_id + sig do - params(tweet_id: String, success: T::Boolean).returns( - T.attached_class - ) + params( + charged: T::Boolean, + charged_credits: String, + tweet_id: String, + write_action_id: String, + success: T::Boolean + ).returns(T.attached_class) end - def self.new(tweet_id:, success: true) + def self.new( + charged:, + # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; + # attached media adds 2 credits per started MB. + charged_credits:, + tweet_id:, + write_action_id: nil, + success: true + ) end - sig { override.returns({ success: T::Boolean, tweet_id: String }) } + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + success: T::Boolean, + tweet_id: String, + write_action_id: String + } + ) + end def to_hash end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi index 5e1e78d..0b7ac2c 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi @@ -36,6 +36,26 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :view_count + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. + sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } + attr_reader :author + + sig { params(author: XTwitterScraper::X::TweetAuthor::OrHash).void } + attr_writer :author + + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } + attr_reader :content_disclosure + + sig do + params( + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash + ).void + end + attr_writer :content_disclosure + # ID of the root tweet in the conversation thread sig { returns(T.nilable(String)) } attr_reader :conversation_id @@ -49,6 +69,13 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at + # Start and end offsets for rendered tweet text + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :display_text_range + + sig { params(display_text_range: T::Array[Integer]).void } + attr_writer :display_text_range + # Parsed entities from the tweet text (URLs, mentions, hashtags, media) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :entities @@ -56,6 +83,34 @@ module XTwitterScraper sig { params(entities: T::Hash[Symbol, T.anything]).void } attr_writer :entities + # Tweet ID being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_id + + sig { params(in_reply_to_id: String).void } + attr_writer :in_reply_to_id + + # User ID being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_user_id + + sig { params(in_reply_to_user_id: String).void } + attr_writer :in_reply_to_user_id + + # Username being replied to + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_username + + sig { params(in_reply_to_username: String).void } + attr_writer :in_reply_to_username + + # Whether replies are limited for this tweet + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_limited_reply + + sig { params(is_limited_reply: T::Boolean).void } + attr_writer :is_limited_reply + # 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 @@ -77,26 +132,44 @@ module XTwitterScraper sig { params(is_reply: T::Boolean).void } attr_writer :is_reply + # Tweet language code + sig { returns(T.nilable(String)) } + attr_reader :lang + + sig { params(lang: String).void } + attr_writer :lang + # Attached media items, omitted when the tweet has no media - sig do - returns(T.nilable(T::Array[XTwitterScraper::X::TweetDetail::Media])) - end + sig { returns(T.nilable(T::Array[XTwitterScraper::TweetMedia])) } attr_reader :media sig do - params( - media: T::Array[XTwitterScraper::X::TweetDetail::Media::OrHash] - ).void + params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void end attr_writer :media - # The quoted tweet object, present when isQuoteStatus is true - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } attr_reader :quoted_tweet - sig { params(quoted_tweet: T::Hash[Symbol, T.anything]).void } + sig do + params(quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash).void + end attr_writer :quoted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } + attr_reader :retweeted_tweet + + sig do + params(retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash).void + end + attr_writer :retweeted_tweet + # Client application used to post this tweet sig { returns(T.nilable(String)) } attr_reader :source @@ -104,7 +177,22 @@ module XTwitterScraper sig { params(source: String).void } attr_writer :source - # Full tweet with text, engagement metrics, media, and metadata. + # Tweet result type + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + # Tweet permalink URL + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # mean X did not report the count. sig do params( id: String, @@ -115,15 +203,26 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + author: XTwitterScraper::X::TweetAuthor::OrHash, + content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, conversation_id: String, created_at: String, + display_text_range: T::Array[Integer], entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, 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 + lang: String, + media: T::Array[XTwitterScraper::TweetMedia::OrHash], + quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, + retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, + source: String, + type: String, + url: String ).returns(T.attached_class) end def self.new( @@ -135,23 +234,51 @@ module XTwitterScraper retweet_count:, text:, view_count:, + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. + author: nil, + # Content disclosure metadata shown by X when a tweet is labeled as paid + # partnership content or AI-generated media. + content_disclosure: nil, # ID of the root tweet in the conversation thread conversation_id: nil, created_at: nil, + # Start and end offsets for rendered tweet text + display_text_range: nil, # Parsed entities from the tweet text (URLs, mentions, hashtags, media) entities: nil, + # Tweet ID being replied to + in_reply_to_id: nil, + # User ID being replied to + in_reply_to_user_id: nil, + # Username being replied to + in_reply_to_username: nil, + # Whether replies are limited for this tweet + is_limited_reply: 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, + # Tweet language code + lang: nil, # Attached media items, omitted when the tweet has no media media: nil, - # The quoted tweet object, present when isQuoteStatus is true + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. quoted_tweet: nil, + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + retweeted_tweet: nil, # Client application used to post this tweet - source: nil + source: nil, + # Tweet result type + type: nil, + # Tweet permalink URL + url: nil ) end @@ -166,117 +293,31 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + author: XTwitterScraper::X::TweetAuthor, + content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, + display_text_range: T::Array[Integer], entities: T::Hash[Symbol, T.anything], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: T::Boolean, 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 + lang: String, + media: T::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: 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 d558120..1060db3 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 @@ -25,10 +25,21 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +47,11 @@ module XTwitterScraper id:, # Pagination cursor for favoriters cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +61,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 1cba663..73c9a26 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for quote tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,6 +47,34 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + # Include reply quotes (default false) sig { returns(T.nilable(T::Boolean)) } attr_reader :include_replies @@ -32,6 +82,157 @@ module XTwitterScraper sig { params(include_replies: T::Boolean).void } attr_writer :include_replies + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetQuotesParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::TweetGetQuotesParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetQuotesParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: XTwitterScraper::X::TweetGetQuotesParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetQuotesParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: XTwitterScraper::X::TweetGetQuotesParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetQuotesParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::TweetGetQuotesParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + # Unix timestamp - return quotes posted after this time sig { returns(T.nilable(String)) } attr_reader :since_time @@ -39,6 +240,20 @@ module XTwitterScraper sig { params(since_time: String).void } attr_writer :since_time + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + # Unix timestamp - return quotes posted before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -46,26 +261,126 @@ module XTwitterScraper sig { params(until_time: String).void } attr_writer :until_time + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetQuotesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::X::TweetGetQuotesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetQuotesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetQuotesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for quote tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, # Include reply quotes (default false) include_replies: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return quotes posted after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return quotes posted before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -74,16 +389,209 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetQuotesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::TweetGetQuotesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetQuotesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetQuotesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetQuotesParams::MediaType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetQuotesParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetQuotesParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetQuotesParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetQuotesParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetQuotesParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetQuotesParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetQuotesParams::Replies) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetQuotesParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetQuotesParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetQuotesParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetQuotesParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetQuotesParams::Retweets) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetQuotesParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetQuotesParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetQuotesParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetQuotesParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + 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 0b843f9..7dcf07a 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for tweet replies sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,6 +47,186 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetRepliesParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::TweetGetRepliesParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetRepliesParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::TweetGetRepliesParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + # Unix timestamp - return replies posted after this time sig { returns(T.nilable(String)) } attr_reader :since_time @@ -32,6 +234,20 @@ module XTwitterScraper sig { params(since_time: String).void } attr_writer :since_time + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + # Unix timestamp - return replies posted before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -39,23 +255,123 @@ module XTwitterScraper sig { params(until_time: String).void } attr_writer :until_time + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for tweet replies cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return replies posted after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return replies posted before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -64,15 +380,211 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::TweetGetRepliesParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetRepliesParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetRepliesParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetRepliesParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetRepliesParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetRepliesParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetRepliesParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetRepliesParams::Replies) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetRepliesParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetRepliesParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetRepliesParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetRepliesParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetRepliesParams::Retweets) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetRepliesParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetRepliesParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetRepliesParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetRepliesParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + 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 bb917f0..e9fe8ac 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 @@ -25,10 +25,21 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +47,11 @@ module XTwitterScraper id:, # Pagination cursor for retweeters cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +61,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 29ed811..57cc0eb 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 @@ -25,10 +25,22 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +48,12 @@ module XTwitterScraper id:, # Pagination cursor for thread tweets cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +63,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 c906d98..ef5a622 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_retrieve_response.rbi @@ -12,14 +12,16 @@ module XTwitterScraper ) end - # Full tweet with text, engagement metrics, media, and metadata. + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # mean X did not report the count. sig { returns(XTwitterScraper::X::TweetDetail) } attr_reader :tweet sig { params(tweet: XTwitterScraper::X::TweetDetail::OrHash).void } attr_writer :tweet - # Author of a tweet with follower count and verification status. + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } attr_reader :author @@ -33,9 +35,11 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Full tweet with text, engagement metrics, media, and metadata. + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can + # mean X did not report the count. tweet:, - # Author of a tweet with follower count and verification status. + # Tweet author profile. The lookup route always includes follower count and + # verification state. Other profile fields appear when available. author: nil ) 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 ba4fd04..2672401 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi @@ -19,6 +19,42 @@ module XTwitterScraper sig { returns(String) } attr_accessor :q + # Raw advanced search query appended as-is. + sig { returns(T.nilable(String)) } + attr_reader :advanced_query + + sig { params(advanced_query: String).void } + attr_writer :advanced_query + + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + sig { returns(T.nilable(String)) } + attr_reader :bounding_box + + sig { params(bounding_box: String).void } + attr_writer :bounding_box + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor from previous response sig { returns(T.nilable(String)) } attr_reader :cursor @@ -26,13 +62,139 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + # Max tweets to return (server paginates internally). Omit for single page (~20). + # This is an upper bound for paid authenticated calls: remaining credits can + # reduce the returned page size, and zero affordable results returns 402 + # insufficient_credits. sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit + # Search within a list ID. + sig { returns(T.nilable(String)) } + attr_reader :list_id + + sig { params(list_id: String).void } + attr_writer :list_id + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetSearchParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::TweetSearchParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Search within a place ID. + sig { returns(T.nilable(String)) } + attr_reader :place + + sig { params(place: String).void } + attr_writer :place + + # Search within a country code. + sig { returns(T.nilable(String)) } + attr_reader :place_country + + sig { params(place_country: String).void } + attr_writer :place_country + + # Geo point radius, e.g. -73.99 40.73 25mi. + sig { returns(T.nilable(String)) } + attr_reader :point_radius + + sig { params(point_radius: String).void } + attr_writer :point_radius + # Sort order - Latest (chronological) or Top (engagement-ranked) sig do returns( @@ -51,6 +213,72 @@ module XTwitterScraper end attr_writer :query_type + # Quote mode. + sig do + returns( + T.nilable(XTwitterScraper::X::TweetSearchParams::Quotes::OrSymbol) + ) + end + attr_reader :quotes + + sig do + params( + quotes: XTwitterScraper::X::TweetSearchParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable(XTwitterScraper::X::TweetSearchParams::Replies::OrSymbol) + ) + end + attr_reader :replies + + sig do + params( + replies: XTwitterScraper::X::TweetSearchParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable(XTwitterScraper::X::TweetSearchParams::Retweets::OrSymbol) + ) + end + attr_reader :retweets + + sig do + params( + retweets: XTwitterScraper::X::TweetSearchParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + # ISO 8601 timestamp - only return tweets after this time sig { returns(T.nilable(String)) } attr_reader :since_time @@ -58,6 +286,20 @@ module XTwitterScraper sig { params(since_time: String).void } attr_writer :since_time + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + # ISO 8601 timestamp - only return tweets before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -65,31 +307,143 @@ module XTwitterScraper sig { params(until_time: String).void } attr_writer :until_time + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( q: String, + advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, limit: Integer, + list_id: String, + media_type: + XTwitterScraper::X::TweetSearchParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, query_type: XTwitterScraper::X::TweetSearchParams::QueryType::OrSymbol, + quotes: XTwitterScraper::X::TweetSearchParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::X::TweetSearchParams::Replies::OrSymbol, + retweets: XTwitterScraper::X::TweetSearchParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # Search query (keywords, q:, + # Raw advanced search query appended as-is. + advanced_query: nil, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + bounding_box: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor from previous response cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, # Max tweets to return (server paginates internally). Omit for single page (~20). + # This is an upper bound for paid authenticated calls: remaining credits can + # reduce the returned page size, and zero affordable results returns 402 + # insufficient_credits. limit: nil, + # Search within a list ID. + list_id: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Search within a place ID. + place: nil, + # Search within a country code. + place_country: nil, + # Geo point radius, e.g. -73.99 40.73 25mi. + point_radius: nil, # Sort order - Latest (chronological) or Top (engagement-ranked) query_type: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # ISO 8601 timestamp - only return tweets after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # ISO 8601 timestamp - only return tweets before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -98,12 +452,45 @@ module XTwitterScraper override.returns( { q: String, + advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, limit: Integer, + list_id: String, + media_type: + XTwitterScraper::X::TweetSearchParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, query_type: XTwitterScraper::X::TweetSearchParams::QueryType::OrSymbol, + quotes: XTwitterScraper::X::TweetSearchParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::X::TweetSearchParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetSearchParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) @@ -111,6 +498,58 @@ module XTwitterScraper def to_hash end + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetSearchParams::MediaType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetSearchParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + # Sort order - Latest (chronological) or Top (engagement-ranked) module QueryType extend XTwitterScraper::Internal::Type::Enum @@ -142,6 +581,117 @@ module XTwitterScraper def self.values end end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetSearchParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetSearchParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetSearchParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetSearchParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetSearchParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetSearchParams::Replies) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetSearchParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetSearchParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetSearchParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetSearchParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetSearchParams::Retweets) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetSearchParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetSearchParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetSearchParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetSearchParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi b/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi new file mode 100644 index 0000000..cba2c86 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class UserRemoveFollowerParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::UserRemoveFollowerParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # X account identifier (@username or account ID) + sig { returns(String) } + attr_accessor :account + + sig do + params( + id: String, + account: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # X account identifier (@username or account ID) + account:, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + account: String, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi b/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi new file mode 100644 index 0000000..7802724 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class UserRemoveFollowerResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :success + + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success: true) + end + + sig { override.returns({ success: T::Boolean }) } + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_batch_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_batch_params.rbi index a5f4a1c..4d97136 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_batch_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_batch_params.rbi @@ -15,7 +15,8 @@ module XTwitterScraper ) end - # Comma-separated user IDs (max 100) + # Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while + # preserving first-seen order. sig { returns(String) } attr_accessor :ids @@ -26,7 +27,8 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Comma-separated user IDs (max 100) + # Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while + # preserving first-seen order. ids:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_batch_response.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_batch_response.rbi new file mode 100644 index 0000000..51adb83 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_batch_response.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class UserRetrieveBatchResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRetrieveBatchResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + # Batch lookups never paginate. + sig { returns(T::Boolean) } + attr_accessor :has_next_page + + # Empty because batch lookups never paginate. + sig { returns(String) } + attr_accessor :next_cursor + + # Number of requested IDs included in the lookup. + sig { returns(Integer) } + attr_accessor :processed_count + + # Number of unique IDs requested. + sig { returns(Integer) } + attr_accessor :requested_count + + # Number of user profiles returned and charged. + sig { returns(Integer) } + attr_accessor :returned_count + + # Processed IDs with no returned profile, in first-seen request order. + sig { returns(T::Array[String]) } + attr_accessor :unavailable_ids + + # Requested IDs skipped because available credits limited processing. Retry these + # IDs after adding credits. + sig { returns(T::Array[String]) } + attr_accessor :unprocessed_ids + + sig { returns(T::Array[XTwitterScraper::UserProfile]) } + attr_accessor :users + + # Batch user lookup results. Duplicate requested IDs are ignored while preserving + # first-seen order. unavailable_ids identifies processed IDs with no returned + # profile. unprocessed_ids identifies IDs skipped when available credits limit + # processing. + sig do + params( + next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: T::Array[String], + unprocessed_ids: T::Array[String], + users: T::Array[XTwitterScraper::UserProfile::OrHash], + has_next_page: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Empty because batch lookups never paginate. + next_cursor:, + # Number of requested IDs included in the lookup. + processed_count:, + # Number of unique IDs requested. + requested_count:, + # Number of user profiles returned and charged. + returned_count:, + # Processed IDs with no returned profile, in first-seen request order. + unavailable_ids:, + # Requested IDs skipped because available credits limited processing. Retry these + # IDs after adding credits. + unprocessed_ids:, + users:, + # Batch lookups never paginate. + has_next_page: false + ) + end + + sig do + override.returns( + { + has_next_page: T::Boolean, + next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: T::Array[String], + unprocessed_ids: T::Array[String], + users: T::Array[XTwitterScraper::UserProfile] + } + ) + end + def to_hash + end + end + end + end +end 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 565020c..2328394 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,6 +18,13 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Legacy cursor alias. Prefer cursor. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + # Pagination cursor for followers list sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,7 +32,17 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Items per page (20-200, default 200) + # Legacy integer page size alias for following lists. Prefer pageSize. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -35,16 +52,25 @@ module XTwitterScraper sig do params( id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Legacy cursor alias. Prefer cursor. + after: nil, # Pagination cursor for followers list cursor: nil, - # Items per page (20-200, default 200) + # Legacy integer page size alias for following lists. Prefer pageSize. + limit: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. page_size: nil, request_options: {} ) @@ -54,7 +80,9 @@ module XTwitterScraper override.returns( { id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions } 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 28b1f85..b18f8c3 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 @@ -25,10 +25,21 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +47,11 @@ module XTwitterScraper id:, # Pagination cursor for followers-you-know cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +61,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) 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 5d5ccfc..ea179de 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,6 +18,13 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Legacy cursor alias. Prefer cursor. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + # Pagination cursor for following list sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,7 +32,17 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Results per page (20-200, default 200) + # Legacy page size alias. Prefer pageSize. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -35,16 +52,25 @@ module XTwitterScraper sig do params( id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Legacy cursor alias. Prefer cursor. + after: nil, # Pagination cursor for following list cursor: nil, - # Results per page (20-200, default 200) + # Legacy page size alias. Prefer pageSize. + limit: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. page_size: nil, request_options: {} ) @@ -54,7 +80,9 @@ module XTwitterScraper override.returns( { id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions } 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 264ebca..492f406 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for liked tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,17 +47,313 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveLikesParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::UserRetrieveLikesParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveLikesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for liked tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -44,13 +362,215 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveLikesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::UserRetrieveLikesParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveLikesParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveLikesParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveLikesParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveLikesParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveLikesParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveLikesParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + 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 ea7d8f7..e8e3543 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for media tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,17 +47,313 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMediaParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::UserRetrieveMediaParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMediaParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for media tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -44,13 +362,215 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMediaParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::UserRetrieveMediaParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMediaParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMediaParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMediaParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMediaParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMediaParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMediaParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + 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 adbb1a3..6f0d3cd 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for mentions sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,6 +47,187 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + # Unix timestamp - return mentions after this time sig { returns(T.nilable(String)) } attr_reader :since_time @@ -32,6 +235,20 @@ module XTwitterScraper sig { params(since_time: String).void } attr_writer :since_time + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + # Unix timestamp - return mentions before this time sig { returns(T.nilable(String)) } attr_reader :until_time @@ -39,23 +256,124 @@ module XTwitterScraper sig { params(until_time: String).void } attr_writer :until_time + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for mentions cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return mentions after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return mentions before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -64,15 +382,220 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMentionsParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi new file mode 100644 index 0000000..e2f2f5e --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi @@ -0,0 +1,591 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::UserRetrieveRepliesParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + + # Pagination cursor for user replies + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Include parent tweet for replies + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_parent_tweet + + sig { params(include_parent_tweet: T::Boolean).void } + attr_writer :include_parent_tweet + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + + sig do + params( + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + include_parent_tweet: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, + # Pagination cursor for user replies + cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Include parent tweet for replies + include_parent_tweet: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + include_parent_tweet: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, + request_options: XTwitterScraper::RequestOptions + } + ) + end + def to_hash + end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveRepliesParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end 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 f24685f..5445789 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,6 +18,28 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for user tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -25,6 +47,34 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + # Include parent tweet for replies sig { returns(T.nilable(T::Boolean)) } attr_reader :include_parent_tweet @@ -39,23 +89,291 @@ module XTwitterScraper sig { params(include_replies: T::Boolean).void } attr_writer :include_replies + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum likes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_parent_tweet: T::Boolean, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for user tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, # Include parent tweet for replies include_parent_tweet: nil, # Include reply tweets include_replies: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -64,15 +382,220 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_parent_tweet: T::Boolean, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveTweetsParams::Replies + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + 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 fd8c245..2b5f72d 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 @@ -25,10 +25,21 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + sig do params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -36,6 +47,11 @@ module XTwitterScraper id:, # Pagination cursor for verified followers cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -45,6 +61,7 @@ module XTwitterScraper { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/write_action_retrieve_params.rbi b/rbi/x_twitter_scraper/models/x/write_action_retrieve_params.rbi new file mode 100644 index 0000000..360f1cf --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/write_action_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class WriteActionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::WriteActionRetrieveParams, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: XTwitterScraper::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi new file mode 100644 index 0000000..d9e6f3a --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi @@ -0,0 +1,313 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :action + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media + ) + end + attr_reader :media + + sig do + params( + media: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::OrHash + ).void + end + attr_writer :media + + sig { returns(T::Boolean) } + attr_accessor :retryable + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :write_action_id + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(String)) } + attr_accessor :confirmation_source + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig do + params( + action: String, + charged: T::Boolean, + charged_credits: String, + created_at: Time, + media: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::OrHash, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::OrSymbol, + write_action_id: String, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmation_source: T.nilable(String), + confirmed_at: Time, + message: String, + message_id: String, + send_dispatched_at: Time, + target_id: T.nilable(String), + tweet_id: String, + retryable: T::Boolean + ).returns(T.attached_class) + end + def self.new( + action:, + charged:, + charged_credits:, + created_at:, + media:, + send_dispatched:, + status:, + write_action_id:, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmation_source: nil, + confirmed_at: nil, + message: nil, + message_id: nil, + send_dispatched_at: nil, + target_id: nil, + tweet_id: nil, + retryable: false + ) + end + + sig do + override.returns( + { + action: String, + charged: T::Boolean, + charged_credits: String, + created_at: Time, + media: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + retryable: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol, + write_action_id: String, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmation_source: T.nilable(String), + confirmed_at: Time, + message: String, + message_id: String, + send_dispatched_at: Time, + target_id: T.nilable(String), + tweet_id: String + } + ) + end + def to_hash + end + + class Media < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :count + + sig { returns(String) } + attr_accessor :credits + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + ) + end + attr_accessor :kind + + sig { returns(String) } + attr_accessor :total_bytes + + sig do + params( + count: Integer, + credits: String, + kind: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::OrSymbol, + total_bytes: String + ).returns(T.attached_class) + end + def self.new(count:, credits:, kind:, total_bytes:) + end + + sig do + override.returns( + { + count: Integer, + credits: String, + kind: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol, + total_bytes: String + } + ) + end + def to_hash + end + + module Kind + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NONE = + T.let( + :none, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + ) + IMAGE = + T.let( + :image, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + ) + VIDEO = + T.let( + :video, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/models/x/x_account.rbi b/rbi/x_twitter_scraper/models/x/x_account.rbi index f4f9601..8d964ae 100644 --- a/rbi/x_twitter_scraper/models/x/x_account.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account.rbi @@ -31,21 +31,32 @@ module XTwitterScraper sig { returns(String) } attr_accessor :status + sig { returns(Time) } + attr_accessor :updated_at + sig { returns(String) } attr_accessor :x_user_id sig { returns(String) } attr_accessor :x_username - # Linked X account summary with username and connection status. + sig { returns(T.nilable(Time)) } + attr_reader :cookies_obtained_at + + sig { params(cookies_obtained_at: Time).void } + attr_writer :cookies_obtained_at + + # Linked X account summary with connection status, health, and timestamp metadata. sig do params( id: String, created_at: Time, health: XTwitterScraper::X::XAccount::Health::OrSymbol, status: String, + updated_at: Time, x_user_id: String, - x_username: String + x_username: String, + cookies_obtained_at: Time ).returns(T.attached_class) end def self.new( @@ -58,8 +69,10 @@ module XTwitterScraper # shortly. health:, status:, + updated_at:, x_user_id:, - x_username: + x_username:, + cookies_obtained_at: nil ) end @@ -70,8 +83,10 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::X::XAccount::Health::TaggedSymbol, status: String, + updated_at: Time, x_user_id: String, - x_username: String + x_username: String, + cookies_obtained_at: Time } ) end 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 88f7fc9..8201186 100644 --- a/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account_detail.rbi @@ -40,19 +40,13 @@ module XTwitterScraper 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 - # Full X account details including proxy, cookies, and update timestamp. + # Full X account details with status, cookies, and update timestamp. sig do params( id: String, @@ -62,7 +56,6 @@ module XTwitterScraper x_user_id: String, x_username: String, cookies_obtained_at: Time, - proxy_country: String, updated_at: Time ).returns(T.attached_class) end @@ -74,7 +67,6 @@ module XTwitterScraper x_user_id:, x_username:, cookies_obtained_at: nil, - proxy_country: nil, updated_at: nil ) end @@ -89,7 +81,6 @@ module XTwitterScraper x_user_id: String, x_username: String, cookies_obtained_at: Time, - proxy_country: String, updated_at: Time } ) 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 5601add..74d20a4 100644 --- a/rbi/x_twitter_scraper/models/x_get_article_response.rbi +++ b/rbi/x_twitter_scraper/models/x_get_article_response.rbi @@ -21,23 +21,29 @@ module XTwitterScraper end attr_writer :article - # Author of a tweet with follower count and verification status. - sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } + # X Article author profile fields returned when available. + sig do + returns(T.nilable(XTwitterScraper::Models::XGetArticleResponse::Author)) + end attr_reader :author - sig { params(author: XTwitterScraper::X::TweetAuthor::OrHash).void } + sig do + params( + author: XTwitterScraper::Models::XGetArticleResponse::Author::OrHash + ).void + end attr_writer :author sig do params( article: XTwitterScraper::Models::XGetArticleResponse::Article::OrHash, - author: XTwitterScraper::X::TweetAuthor::OrHash + author: XTwitterScraper::Models::XGetArticleResponse::Author::OrHash ).returns(T.attached_class) end def self.new( article:, - # Author of a tweet with follower count and verification status. + # X Article author profile fields returned when available. author: nil ) end @@ -46,7 +52,7 @@ module XTwitterScraper override.returns( { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::X::TweetAuthor + author: XTwitterScraper::Models::XGetArticleResponse::Author } ) end @@ -62,6 +68,13 @@ module XTwitterScraper ) end + # Plain text joined from all article blocks + sig { returns(T.nilable(String)) } + attr_reader :body_text + + sig { params(body_text: String).void } + attr_writer :body_text + sig do returns( T.nilable( @@ -133,6 +146,7 @@ module XTwitterScraper sig do params( + body_text: String, contents: T::Array[ XTwitterScraper::Models::XGetArticleResponse::Article::Content::OrHash @@ -148,6 +162,8 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Plain text joined from all article blocks + body_text: nil, contents: nil, cover_image_url: nil, created_at: nil, @@ -163,6 +179,7 @@ module XTwitterScraper sig do override.returns( { + body_text: String, contents: T::Array[ XTwitterScraper::Models::XGetArticleResponse::Article::Content @@ -196,21 +213,51 @@ module XTwitterScraper sig { params(height: Integer).void } attr_writer :height + # Inline text formatting ranges + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange + ] + ) + ) + end + attr_reader :inline_style_ranges + + sig do + params( + inline_style_ranges: + T::Array[ + XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange::OrHash + ] + ).void + end + attr_writer :inline_style_ranges + + # Preview image URL for media blocks + sig { returns(T.nilable(String)) } + attr_reader :preview_url + + sig { params(preview_url: String).void } + attr_writer :preview_url + sig { returns(T.nilable(String)) } attr_reader :text sig { params(text: String).void } attr_writer :text - # Block type: unstyled, header-one, header-two, header-three, unordered-list-item, - # ordered-list-item, image, gif, divider + # Block type: paragraph, header-one, header-two, header-three, header-four, + # header-five, header-six, unordered-list-item, ordered-list-item, blockquote, + # code-block, media, divider sig { returns(T.nilable(String)) } attr_reader :type sig { params(type: String).void } attr_writer :type - # Media URL for image/gif blocks + # Media URL for media blocks sig { returns(T.nilable(String)) } attr_reader :url @@ -226,6 +273,11 @@ module XTwitterScraper sig do params( height: Integer, + inline_style_ranges: + T::Array[ + XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange::OrHash + ], + preview_url: String, text: String, type: String, url: String, @@ -234,11 +286,16 @@ module XTwitterScraper end def self.new( height: nil, + # Inline text formatting ranges + inline_style_ranges: nil, + # Preview image URL for media blocks + preview_url: nil, text: nil, - # Block type: unstyled, header-one, header-two, header-three, unordered-list-item, - # ordered-list-item, image, gif, divider + # Block type: paragraph, header-one, header-two, header-three, header-four, + # header-five, header-six, unordered-list-item, ordered-list-item, blockquote, + # code-block, media, divider type: nil, - # Media URL for image/gif blocks + # Media URL for media blocks url: nil, width: nil ) @@ -248,6 +305,11 @@ module XTwitterScraper override.returns( { height: Integer, + inline_style_ranges: + T::Array[ + XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange + ], + preview_url: String, text: String, type: String, url: String, @@ -257,6 +319,240 @@ module XTwitterScraper end def to_hash end + + class InlineStyleRange < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_reader :length + + sig { params(length: Integer).void } + attr_writer :length + + sig { returns(T.nilable(Integer)) } + attr_reader :offset + + sig { params(offset: Integer).void } + attr_writer :offset + + sig { returns(T.nilable(String)) } + attr_reader :style + + sig { params(style: String).void } + attr_writer :style + + sig do + params(length: Integer, offset: Integer, style: String).returns( + T.attached_class + ) + end + def self.new(length: nil, offset: nil, style: nil) + end + + sig do + override.returns( + { length: Integer, offset: Integer, style: String } + ) + end + def to_hash + end + 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(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :username + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :can_dm + + sig { params(can_dm: T::Boolean).void } + attr_writer :can_dm + + 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 :favourites_count + + sig { params(favourites_count: Integer).void } + attr_writer :favourites_count + + sig { returns(T.nilable(Integer)) } + attr_reader :followers_count + + sig { params(followers_count: Integer).void } + attr_writer :followers_count + + sig { returns(T.nilable(Integer)) } + attr_reader :following_count + + sig { params(following_count: Integer).void } + attr_writer :following_count + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_blue_verified + + sig { params(is_blue_verified: T::Boolean).void } + attr_writer :is_blue_verified + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_translator + + sig { params(is_translator: T::Boolean).void } + attr_writer :is_translator + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_verified + + sig { params(is_verified: T::Boolean).void } + attr_writer :is_verified + + sig { returns(T.nilable(String)) } + attr_reader :location + + sig { params(location: String).void } + attr_writer :location + + sig { returns(T.nilable(Integer)) } + attr_reader :media_count + + sig { params(media_count: Integer).void } + attr_writer :media_count + + sig { returns(T.nilable(String)) } + attr_reader :profile_banner_url + + sig { params(profile_banner_url: String).void } + attr_writer :profile_banner_url + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture + + sig { params(profile_picture: String).void } + attr_writer :profile_picture + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :protected + + sig { params(protected: T::Boolean).void } + attr_writer :protected + + sig { returns(T.nilable(Integer)) } + attr_reader :statuses_count + + sig { params(statuses_count: Integer).void } + attr_writer :statuses_count + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # X Article author profile fields returned when available. + sig do + params( + id: String, + name: String, + username: String, + can_dm: T::Boolean, + created_at: String, + description: String, + favourites_count: Integer, + followers_count: Integer, + following_count: Integer, + is_blue_verified: T::Boolean, + is_translator: T::Boolean, + is_verified: T::Boolean, + location: String, + media_count: Integer, + profile_banner_url: String, + profile_picture: String, + protected: T::Boolean, + statuses_count: Integer, + url: String + ).returns(T.attached_class) + end + def self.new( + id:, + name:, + username:, + can_dm: nil, + created_at: nil, + description: nil, + favourites_count: nil, + followers_count: nil, + following_count: nil, + is_blue_verified: nil, + is_translator: nil, + is_verified: nil, + location: nil, + media_count: nil, + profile_banner_url: nil, + profile_picture: nil, + protected: nil, + statuses_count: nil, + url: nil + ) + end + + sig do + override.returns( + { + id: String, + name: String, + username: String, + can_dm: T::Boolean, + created_at: String, + description: String, + favourites_count: Integer, + followers_count: Integer, + following_count: Integer, + is_blue_verified: T::Boolean, + is_translator: T::Boolean, + is_verified: T::Boolean, + location: String, + media_count: Integer, + profile_banner_url: String, + profile_picture: String, + protected: T::Boolean, + statuses_count: Integer, + url: String + } + ) + end + def to_hash 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 fedf3af..bbe9af4 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 @@ -21,7 +21,7 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Comma-separated tweet IDs to exclude from results + # Comma-separated tweet IDs to exclude from results. Empty entries are ignored. sig { returns(T.nilable(String)) } attr_reader :seen_tweet_ids @@ -38,7 +38,7 @@ module XTwitterScraper def self.new( # Pagination cursor for timeline cursor: nil, - # Comma-separated tweet IDs to exclude from results + # Comma-separated tweet IDs to exclude from results. Empty entries are ignored. seen_tweet_ids: nil, request_options: {} ) 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 bf41d84..49a46ed 100644 --- a/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi +++ b/rbi/x_twitter_scraper/models/x_get_notifications_params.rbi @@ -21,7 +21,7 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. sig do returns( T.nilable(XTwitterScraper::XGetNotificationsParams::Type::OrSymbol) @@ -46,7 +46,7 @@ module XTwitterScraper def self.new( # Pagination cursor for notifications cursor: nil, - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. type: nil, request_options: {} ) @@ -64,7 +64,7 @@ module XTwitterScraper def to_hash end - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. module Type extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/resources/api_keys.rbi b/rbi/x_twitter_scraper/resources/api_keys.rbi deleted file mode 100644 index 2463612..0000000 --- a/rbi/x_twitter_scraper/resources/api_keys.rbi +++ /dev/null @@ -1,46 +0,0 @@ -# typed: strong - -module XTwitterScraper - module Resources - # API key management (session auth only) - class APIKeys - # Create API key - sig do - params( - name: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::APIKeyCreateResponse) - end - def create(name: nil, request_options: {}) - end - - # List API keys - sig do - params( - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::APIKeyListResponse) - end - def list(request_options: {}) - end - - # Revoke API key - sig do - params( - id: String, - request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::Models::APIKeyRevokeResponse) - end - def revoke( - # Resource ID (stringified bigint) - id, - request_options: {} - ) - end - - # @api private - sig { params(client: XTwitterScraper::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/x_twitter_scraper/resources/credits.rbi b/rbi/x_twitter_scraper/resources/credits.rbi index f71b052..2daa192 100644 --- a/rbi/x_twitter_scraper/resources/credits.rbi +++ b/rbi/x_twitter_scraper/resources/credits.rbi @@ -4,6 +4,20 @@ module XTwitterScraper module Resources # Subscription, billing, and credits class Credits + # Redirect to an active top-up payment page + sig do + params( + session_id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).void + end + def redirect_topup_checkout( + # Billing session ID returned by the top-up billing flow. + session_id:, + request_options: {} + ) + end + # Get credits balance sig do params( @@ -13,16 +27,34 @@ module XTwitterScraper def retrieve_balance(request_options: {}) end - # Top up credits balance + # Get top-up billing status + sig do + params( + session_id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::CreditRetrieveTopupStatusResponse) + end + def retrieve_topup_status( + # Billing session ID returned by the top-up billing flow. + session_id:, + request_options: {} + ) + end + + # Create a Stripe Checkout session only after the user confirms. The request never + # completes payment or adds credits by itself. sig do params( - amount: Integer, + dollars: Integer, + locale: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::CreditTopupBalanceResponse) end def topup_balance( - # Amount to top up in credits - amount:, + # Amount to top up in US dollars. Minimum 10. + dollars:, + # Optional checkout locale. Defaults to en. + locale: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/drafts.rbi b/rbi/x_twitter_scraper/resources/drafts.rbi index f425024..6a58ede 100644 --- a/rbi/x_twitter_scraper/resources/drafts.rbi +++ b/rbi/x_twitter_scraper/resources/drafts.rbi @@ -24,7 +24,7 @@ module XTwitterScraper ).returns(XTwitterScraper::DraftDetail) end def retrieve( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -41,7 +41,10 @@ module XTwitterScraper def list( # Cursor for pagination after_cursor: nil, - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, request_options: {} ) @@ -55,7 +58,7 @@ module XTwitterScraper ).void end def delete( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/draws.rbi b/rbi/x_twitter_scraper/resources/draws.rbi index 419c84a..3c37a00 100644 --- a/rbi/x_twitter_scraper/resources/draws.rbi +++ b/rbi/x_twitter_scraper/resources/draws.rbi @@ -12,7 +12,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::DrawRetrieveResponse) end def retrieve( - # Resource ID (stringified bigint) + # Draw public ID returned by create and list draw responses. id, request_options: {} ) @@ -21,15 +21,18 @@ module XTwitterScraper # List draws sig do params( - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::DrawListResponse) end def list( - # Cursor for keyset pagination - after: nil, - # Maximum number of items to return (1-100, default 50) + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, request_options: {} ) @@ -45,17 +48,20 @@ module XTwitterScraper ).returns(StringIO) end def export( - # Resource ID (stringified bigint) + # Draw public ID returned by create and list draw responses. id, # Export output format - format_: nil, + format_:, # Export winners or all entries type: nil, request_options: {} ) end - # Run giveaway draw + # Runs a giveaway draw from a source tweet. The draw first checks the minimum + # credits needed to inspect the source tweet and at least one candidate. Remaining + # credits cap how many replies and retweeters can be inspected before filters and + # winner selection run. sig do params( tweet_url: String, diff --git a/rbi/x_twitter_scraper/resources/events.rbi b/rbi/x_twitter_scraper/resources/events.rbi index 559e4fa..aa6ad87 100644 --- a/rbi/x_twitter_scraper/resources/events.rbi +++ b/rbi/x_twitter_scraper/resources/events.rbi @@ -12,7 +12,7 @@ module XTwitterScraper ).returns(XTwitterScraper::EventDetail) end def retrieve( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -21,7 +21,7 @@ module XTwitterScraper # List events sig do params( - after: String, + cursor: String, event_type: XTwitterScraper::EventType::OrSymbol, limit: Integer, monitor_id: String, @@ -29,11 +29,14 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::EventListResponse) end def list( - # Cursor for keyset pagination - after: nil, + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, # Filter events by type event_type: nil, - # Maximum number of items to return (1-100, default 50) + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, # Filter events by monitor ID monitor_id: nil, diff --git a/rbi/x_twitter_scraper/resources/extractions.rbi b/rbi/x_twitter_scraper/resources/extractions.rbi index 0ce3584..040376f 100644 --- a/rbi/x_twitter_scraper/resources/extractions.rbi +++ b/rbi/x_twitter_scraper/resources/extractions.rbi @@ -2,13 +2,13 @@ module XTwitterScraper module Resources - # Bulk data extraction (20 tool types) + # Bulk data extraction (23 tool types) class Extractions # Get extraction results sig do params( id: String, - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::ExtractionRetrieveResponse) @@ -16,8 +16,8 @@ module XTwitterScraper def retrieve( # Extraction public ID (UUID) id, - # Cursor for keyset pagination - after: nil, + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, # Maximum number of results to return (1-1000, default 100) limit: nil, request_options: {} @@ -27,7 +27,7 @@ module XTwitterScraper # List extraction jobs sig do params( - after: String, + cursor: String, limit: Integer, status: XTwitterScraper::ExtractionListParams::Status::OrSymbol, tool_type: XTwitterScraper::ExtractionListParams::ToolType::OrSymbol, @@ -35,9 +35,12 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::ExtractionListResponse) end def list( - # Cursor for keyset pagination - after: nil, - # Maximum number of items to return (1-100, default 50) + # Cursor for keyset pagination from prior response next_cursor + cursor: nil, + # Maximum number of items to return (1-100, default 50). For paid per-result + # endpoints, the returned count may be lower when remaining credits cannot cover + # the requested page. If zero paid results are affordable, the endpoint returns + # 402 insufficient_credits. limit: nil, # Filter by job status status: nil, @@ -53,14 +56,47 @@ module XTwitterScraper tool_type: XTwitterScraper::ExtractionEstimateCostParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: + XTwitterScraper::ExtractionEstimateCostParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: + XTwitterScraper::ExtractionEstimateCostParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::ExtractionEstimateCostParams::Replies::OrSymbol, + results_limit: Integer, + retweets: + XTwitterScraper::ExtractionEstimateCostParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::ExtractionEstimateCostResponse) end @@ -69,16 +105,84 @@ module XTwitterScraper tool_type:, # Raw advanced query string appended to the estimate (tweet_search_extractor) advanced_query: nil, + # Alternative words or quoted phrases for estimated results. Separate with spaces, + # commas, or lines. + any_words: nil, + # Geo bounding box used for estimation, e.g. -74.1 40.6 -73.9 40.8 + # (tweet_search_extractor) + bounding_box: nil, + # Cashtags applied to the estimate, separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter used for estimation (tweet_search_extractor) + conversation_id: nil, # Exact phrase filter for search estimation exact_phrase: nil, - # Words excluded from estimated search results + # Words or quoted phrases excluded from estimated results. Separate with spaces, + # commas, or lines. exclude_words: nil, + # Estimate only tweets from this author username (tweet_search_extractor) + from_user: nil, + # Hashtags applied to the estimate, separated by spaces, commas, or lines. + hashtags: nil, + # Estimate only replies to this tweet ID (tweet_search_extractor) + in_reply_to_tweet_id: nil, + # Language code used for estimate filtering (tweet_search_extractor) + language: nil, + # Estimate search results within this list ID (tweet_search_extractor) + list_id: nil, + # Media type used for estimate filtering (tweet_search_extractor) + media_type: nil, + # Estimate tweets mentioning this username (tweet_search_extractor) + mentioning: nil, + # Minimum likes threshold for estimated results (tweet_search_extractor) + min_faves: nil, + # Minimum quote count threshold for estimated results (tweet_search_extractor) + min_quotes: nil, + # Minimum replies threshold for estimated results (tweet_search_extractor) + min_replies: nil, + # Minimum retweets threshold for estimated results (tweet_search_extractor) + min_retweets: nil, + # Estimate search results within this place ID (tweet_search_extractor) + place: nil, + # Estimate search results within this country code (tweet_search_extractor) + place_country: nil, + # Geo point radius used for estimation, e.g. -73.99 40.73 25mi + # (tweet_search_extractor) + point_radius: nil, + # Quote mode used for estimation (tweet_search_extractor) + quotes: nil, + # Estimate only quotes of this tweet ID (tweet_search_extractor) + quotes_of_tweet_id: nil, + # Reply mode used for estimation (tweet_search_extractor) + replies: nil, + # Maximum number of results to estimate. When set, the estimate caps projected + # results to this value. + results_limit: nil, + # Retweet mode used for estimation (tweet_search_extractor) + retweets: nil, + # Estimate only retweets of this tweet ID (tweet_search_extractor) + retweets_of_tweet_id: nil, + # Required for tweet_search_extractor & community_search. search_query: nil, + # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) + since_date: nil, + # Required for community_post_extractor & community_search. target_community_id: nil, + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. target_list_id: nil, + # Required for space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, + # Estimate replies sent to this username (tweet_search_extractor) + to_user: nil, + # Estimate end date in YYYY-MM-DD format (tweet_search_extractor) + until_date: nil, + # URL substring or domain filter used for estimation (tweet_search_extractor) + url: nil, + # Estimate only verified authors (tweet_search_extractor) + verified_only: nil, request_options: {} ) end @@ -96,7 +200,7 @@ module XTwitterScraper # Extraction public ID id, # Export file format - format_: nil, + format_:, request_options: {} ) end @@ -106,14 +210,43 @@ module XTwitterScraper params( tool_type: XTwitterScraper::ExtractionRunParams::ToolType::OrSymbol, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::ExtractionRunParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::ExtractionRunParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::ExtractionRunParams::Replies::OrSymbol, + results_limit: Integer, + retweets: XTwitterScraper::ExtractionRunParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::ExtractionRunResponse) end @@ -122,16 +255,82 @@ module XTwitterScraper tool_type:, # Raw advanced search query appended as-is (tweet_search_extractor) advanced_query: nil, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. (tweet_search_extractor) + any_words: nil, + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8 (tweet_search_extractor) + bounding_box: nil, + # Cashtags separated by spaces, commas, or lines. (tweet_search_extractor) + cashtags: nil, + # Conversation ID filter (tweet_search_extractor) + conversation_id: nil, # Exact phrase to match (tweet_search_extractor) exact_phrase: nil, - # Words to exclude from results (tweet_search_extractor) + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # (tweet_search_extractor) exclude_words: nil, + # Filter by author username (tweet_search_extractor) + from_user: nil, + # Hashtags separated by spaces, commas, or lines. (tweet_search_extractor) + hashtags: nil, + # Only replies to this tweet ID (tweet_search_extractor) + in_reply_to_tweet_id: nil, + # Language code filter (tweet_search_extractor) + language: nil, + # Search within a list ID (tweet_search_extractor) + list_id: nil, + # Media type filter (tweet_search_extractor) + media_type: nil, + # Filter tweets mentioning a username (tweet_search_extractor) + mentioning: nil, + # Minimum likes threshold (tweet_search_extractor) + min_faves: nil, + # Minimum quote count threshold (tweet_search_extractor) + min_quotes: nil, + # Minimum replies threshold (tweet_search_extractor) + min_replies: nil, + # Minimum retweets threshold (tweet_search_extractor) + min_retweets: nil, + # Search within a place ID (tweet_search_extractor) + place: nil, + # Search within a country code (tweet_search_extractor) + place_country: nil, + # Geo point radius, e.g. -73.99 40.73 25mi (tweet_search_extractor) + point_radius: nil, + # Quote mode (tweet_search_extractor) + quotes: nil, + # Only quotes of this tweet ID (tweet_search_extractor) + quotes_of_tweet_id: nil, + # Reply mode (tweet_search_extractor) + replies: nil, + # Maximum number of results to extract. When set, the extraction stops after + # reaching this limit. + results_limit: nil, + # Retweet mode (tweet_search_extractor) + retweets: nil, + # Only retweets of this tweet ID (tweet_search_extractor) + retweets_of_tweet_id: nil, + # Required for tweet_search_extractor & community_search. search_query: nil, + # Start date YYYY-MM-DD (tweet_search_extractor) + since_date: nil, + # Required for community_post_extractor & community_search. target_community_id: nil, + # Required for list_follower_explorer, list_member_extractor & + # list_post_extractor. target_list_id: nil, + # Required for space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, + # Filter replies sent to a username (tweet_search_extractor) + to_user: nil, + # End date YYYY-MM-DD (tweet_search_extractor) + until_date: nil, + # URL substring or domain filter (tweet_search_extractor) + url: nil, + # Only verified authors (tweet_search_extractor) + verified_only: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/guest_wallets.rbi b/rbi/x_twitter_scraper/resources/guest_wallets.rbi new file mode 100644 index 0000000..e2003b5 --- /dev/null +++ b/rbi/x_twitter_scraper/resources/guest_wallets.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module XTwitterScraper + module Resources + # Accountless prepaid access for paid read endpoints + class GuestWallets + # Create a one-use Stripe-hosted checkout after the user explicitly confirms a + # $10-$250 USD amount. This request creates no charge by itself. The user opens + # checkout_url on Stripe. This endpoint returns the paid-read API key without + # requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent + # replay returns the same key. + sig do + params( + amount_minor: Integer, + idempotency_key: String, + currency: Symbol, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::GuestWalletCreateResponse) + end + def create( + # Body param: Confirmed USD amount in cents. + amount_minor:, + # Header param: Generate a cryptographically random UUID v4. Reuse it only to + # retry the same wallet and amount request. Initial wallet creation can recover + # the API key from this value, so store it as a secret and never log it. + idempotency_key:, + # Body param + currency: :usd, + request_options: {} + ) + end + + # Poll after Stripe payment. Use usable to decide whether paid reads can run. An + # active wallet can remain usable while a top-up is pending. A new wallet becomes + # usable only after verified webhook fulfillment. Send the guest key as + # Authorization: Bearer. + sig do + params( + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::GuestWalletRetrieveStatusResponse) + end + def retrieve_status(request_options: {}) + end + + # Create a one-use Stripe-hosted checkout for an existing paid-read guest key + # after the user explicitly confirms a $10-$250 USD amount. The key remains the + # same. This request creates no charge by itself and never redirects through an + # Xquik web page. + sig do + params( + amount_minor: Integer, + idempotency_key: String, + currency: Symbol, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::GuestWalletTopupResponse) + end + def topup( + # Body param: Confirmed USD amount in cents. + amount_minor:, + # Header param: Generate a cryptographically random UUID v4. Reuse it only to + # retry the same wallet and amount request. Initial wallet creation can recover + # the API key from this value, so store it as a secret and never log it. + idempotency_key:, + # Body param + currency: :usd, + request_options: {} + ) + end + + # @api private + sig { params(client: XTwitterScraper::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/x_twitter_scraper/resources/monitors.rbi b/rbi/x_twitter_scraper/resources/monitors.rbi index 2351361..1e47af1 100644 --- a/rbi/x_twitter_scraper/resources/monitors.rbi +++ b/rbi/x_twitter_scraper/resources/monitors.rbi @@ -4,7 +4,14 @@ module XTwitterScraper module Resources # Real-time X account monitoring class Monitors - # Create monitor + # Real-time X account monitoring + sig { returns(XTwitterScraper::Resources::Monitors::Keywords) } + attr_reader :keywords + + # Creates an instant monitor. Monitors are unlimited. Active monitors check every + # 1 second and cost 21 credits per hour. Events and webhook deliveries are + # included. Creation requires available credits for the first hourly charge and + # username lookup. sig do params( event_types: T::Array[XTwitterScraper::EventType::OrSymbol], @@ -29,7 +36,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Monitor) end def retrieve( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -45,7 +52,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Monitor) end def update( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # Array of event types to subscribe to. event_types: nil, @@ -63,7 +70,7 @@ module XTwitterScraper def list(request_options: {}) end - # Deactivate monitor + # Delete monitor sig do params( id: String, @@ -71,7 +78,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::MonitorDeactivateResponse) end def deactivate( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/monitors/keywords.rbi b/rbi/x_twitter_scraper/resources/monitors/keywords.rbi new file mode 100644 index 0000000..bdb7081 --- /dev/null +++ b/rbi/x_twitter_scraper/resources/monitors/keywords.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module XTwitterScraper + module Resources + class Monitors + # Real-time X account monitoring + class Keywords + # Creates an instant keyword monitor. Keyword monitors are unlimited. Active + # monitors check every 1 second and cost 21 credits per hour. Events and webhook + # deliveries are included. Creation requires available credits for the first + # hourly charge. + sig do + params( + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + query: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::Monitors::KeywordCreateResponse) + end + def create( + # Array of event types to subscribe to. + event_types:, + # X search query to monitor. Whitespace is normalized. + query:, + request_options: {} + ) + end + + # Get keyword monitor + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::Monitors::KeywordRetrieveResponse) + end + def retrieve( + # Resource ID returned by the matching create or list endpoint. + id, + request_options: {} + ) + end + + # Update keyword monitor + sig do + params( + id: String, + event_types: T::Array[XTwitterScraper::EventType::OrSymbol], + is_active: T::Boolean, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::Monitors::KeywordUpdateResponse) + end + def update( + # Resource ID returned by the matching create or list endpoint. + id, + # Array of event types to subscribe to. + event_types: nil, + is_active: nil, + request_options: {} + ) + end + + # List keyword monitors + sig do + params( + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::Monitors::KeywordListResponse) + end + def list(request_options: {}) + end + + # Delete keyword monitor + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns( + XTwitterScraper::Models::Monitors::KeywordDeactivateResponse + ) + end + def deactivate( + # Resource ID returned by the matching create or list endpoint. + id, + request_options: {} + ) + end + + # @api private + sig do + params(client: XTwitterScraper::Client).returns(T.attached_class) + end + def self.new(client:) + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/resources/radar.rbi b/rbi/x_twitter_scraper/resources/radar.rbi index e8b6b5d..77db2a5 100644 --- a/rbi/x_twitter_scraper/resources/radar.rbi +++ b/rbi/x_twitter_scraper/resources/radar.rbi @@ -23,11 +23,11 @@ module XTwitterScraper after: nil, # Filter by category. category: nil, - # Lookback window in hours (1-168, default 24). + # Lookback window in hours (1-72, default 6). hours: nil, # Number of items to return (1-100, default 50). limit: nil, - # Region filter (us, global, etc.) + # Region filter. Use `global` or a region code such as `US`, `GB`, `TR`, or `ES`. region: nil, # Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, # trustmrr, wikipedia diff --git a/rbi/x_twitter_scraper/resources/subscribe.rbi b/rbi/x_twitter_scraper/resources/subscribe.rbi index fb2f3da..78f3ebb 100644 --- a/rbi/x_twitter_scraper/resources/subscribe.rbi +++ b/rbi/x_twitter_scraper/resources/subscribe.rbi @@ -4,13 +4,19 @@ module XTwitterScraper module Resources # Subscription, billing, and credits class Subscribe - # Get checkout or billing URL + # Create a subscription checkout or billing-management URL only after the user + # confirms. The request never completes payment by itself. sig do params( + tier: XTwitterScraper::SubscribeCreateParams::Tier::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::SubscribeCreateResponse) end - def create(request_options: {}) + def create( + # Subscription tier to pre-select. + tier: nil, + request_options: {} + ) end # @api private diff --git a/rbi/x_twitter_scraper/resources/support/tickets.rbi b/rbi/x_twitter_scraper/resources/support/tickets.rbi index 619afea..8cedfbf 100644 --- a/rbi/x_twitter_scraper/resources/support/tickets.rbi +++ b/rbi/x_twitter_scraper/resources/support/tickets.rbi @@ -24,7 +24,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::Support::TicketRetrieveResponse) end def retrieve( - # Support ticket ID + # Support ticket public ID id, request_options: {} ) @@ -40,7 +40,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::Support::TicketUpdateResponse) end def update( - # Support ticket ID to update + # Support ticket public ID to update id, status:, request_options: {} @@ -65,7 +65,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::Support::TicketReplyResponse) end def reply( - # Support ticket ID for the reply + # Support ticket public ID for the reply id, body:, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/webhooks.rbi b/rbi/x_twitter_scraper/resources/webhooks.rbi index 5699050..12c3046 100644 --- a/rbi/x_twitter_scraper/resources/webhooks.rbi +++ b/rbi/x_twitter_scraper/resources/webhooks.rbi @@ -32,7 +32,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Webhook) end def update( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # Array of event types to subscribe to. event_types: nil, @@ -59,7 +59,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::WebhookDeactivateResponse) end def deactivate( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -73,7 +73,21 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::WebhookListDeliveriesResponse) end def list_deliveries( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. + id, + request_options: {} + ) + end + + # Test and resume webhook endpoint + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::WebhookResumeResponse) + end + def resume( + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -87,7 +101,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::WebhookTestResponse) end def test_( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x.rbi b/rbi/x_twitter_scraper/resources/x.rbi index b770676..65b7489 100644 --- a/rbi/x_twitter_scraper/resources/x.rbi +++ b/rbi/x_twitter_scraper/resources/x.rbi @@ -3,10 +3,13 @@ module XTwitterScraper module Resources class X + # X write actions (tweets, likes, follows, DMs) + sig { returns(XTwitterScraper::Resources::X::WriteActions) } + attr_reader :write_actions + sig { returns(XTwitterScraper::Resources::X::Tweets) } attr_reader :tweets - # Look up, search, and explore user profiles and relationships sig { returns(XTwitterScraper::Resources::X::Users) } attr_reader :users @@ -32,6 +35,12 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Accounts) } attr_reader :accounts + # Connected X account management + sig do + returns(XTwitterScraper::Resources::X::AccountConnectionChallenges) + end + attr_reader :account_connection_challenges + # Look up, search, and analyze individual tweets sig { returns(XTwitterScraper::Resources::X::Bookmarks) } attr_reader :bookmarks @@ -40,7 +49,8 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Lists) } attr_reader :lists - # Retrieve the full content of an X Article (long-form post) by tweet ID. + # Retrieve the full content of an X Article (long-form post) by numeric tweet ID. + # Returns article_not_found when the tweet is valid but is not an X Article. sig do params( tweet_id: String, @@ -48,7 +58,8 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::XGetArticleResponse) end def get_article( - # Tweet ID of the article + # Numeric tweet ID of the article, 15-20 digits. If you have a tweet URL, use the + # final status ID. tweet_id, request_options: {} ) @@ -65,7 +76,7 @@ module XTwitterScraper def get_home_timeline( # Pagination cursor for timeline cursor: nil, - # Comma-separated tweet IDs to exclude from results + # Comma-separated tweet IDs to exclude from results. Empty entries are ignored. seen_tweet_ids: nil, request_options: {} ) @@ -82,7 +93,7 @@ module XTwitterScraper def get_notifications( # Pagination cursor for notifications cursor: nil, - # Notification type filter + # Notification type filter. Unrecognized values fall back to All. type: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/account_connection_challenges.rbi b/rbi/x_twitter_scraper/resources/x/account_connection_challenges.rbi new file mode 100644 index 0000000..2a610ae --- /dev/null +++ b/rbi/x_twitter_scraper/resources/x/account_connection_challenges.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module XTwitterScraper + module Resources + class X + # Connected X account management + class AccountConnectionChallenges + # Submit X account email verification code + sig do + params( + id: String, + email_code: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns( + XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse + ) + end + def submit( + # Resource ID returned by the matching create or list endpoint. + id, + # Code sent to the account email. + email_code:, + request_options: {} + ) + end + + # @api private + sig do + params(client: XTwitterScraper::Client).returns(T.attached_class) + end + def self.new(client:) + end + end + end + end +end diff --git a/rbi/x_twitter_scraper/resources/x/accounts.rbi b/rbi/x_twitter_scraper/resources/x/accounts.rbi index 921842e..6a58009 100644 --- a/rbi/x_twitter_scraper/resources/x/accounts.rbi +++ b/rbi/x_twitter_scraper/resources/x/accounts.rbi @@ -11,7 +11,6 @@ module XTwitterScraper email: String, password: String, username: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::AccountCreateResponse) @@ -23,8 +22,6 @@ module XTwitterScraper password:, # X username username:, - # Proxy country code - proxy_country: nil, # TOTP secret for 2FA totp_secret: nil, request_options: {} @@ -39,7 +36,7 @@ module XTwitterScraper ).returns(XTwitterScraper::X::XAccountDetail) end def retrieve( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -62,7 +59,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::AccountDeleteResponse) end def delete( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, request_options: {} ) @@ -84,20 +81,17 @@ module XTwitterScraper id: String, password: String, email: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::AccountReauthResponse) end def reauth( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # Updated account password password:, # Email for the X account (updates stored email) email: nil, - # Two-letter country code for login proxy region - proxy_country: nil, # TOTP secret for 2FA re-authentication totp_secret: nil, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index c797005..9d91758 100644 --- a/rbi/x_twitter_scraper/resources/x/communities.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities.rbi @@ -42,7 +42,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::CommunityDeleteResponse) end def delete( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # X account (@username or ID) deleting the community account:, @@ -80,7 +80,9 @@ module XTwitterScraper id, # Pagination cursor cursor: nil, - # Items per page (20-200, default 20) + # Items per page (20-200, default 20). This is an upper bound for paid + # authenticated calls: remaining credits can reduce the returned page size, and + # zero affordable results returns 402 insufficient_credits. page_size: nil, request_options: {} ) @@ -103,20 +105,31 @@ module XTwitterScraper ) end - # Search for communities by keyword + # Returns tweets, not community records. Requires a Community ID. sig do params( + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::CommunityRetrieveSearchParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_search( + # Numeric ID of the community whose posts to search + community_id:, # Search query q:, # Pagination cursor for community search cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, # Sort order (Latest or Top) query_type: nil, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/x/communities/join.rbi b/rbi/x_twitter_scraper/resources/x/communities/join.rbi index b0a4137..9bd1d07 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/join.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/join.rbi @@ -12,10 +12,12 @@ module XTwitterScraper id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::X::CommunityActionResult) + ).returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse + ) end def create( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # X account identifier (@username or account ID) account:, @@ -29,10 +31,12 @@ module XTwitterScraper id: String, account: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::X::CommunityActionResult) + ).returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse + ) end def delete_all( - # Resource ID (stringified bigint) + # Resource ID returned by the matching create or list endpoint. id, # X account identifier (@username or account ID) account:, diff --git a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi index 89d33bf..062931f 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi @@ -6,21 +6,32 @@ module XTwitterScraper class Communities # X Community info, members, and tweets class Tweets - # List tweets across all communities + # Requires a Community ID and keyword query. sig do params( + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: + XTwitterScraper::X::Communities::TweetListParams::QueryType::OrSymbol, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def list( - # Search query for cross-community tweets + # Numeric ID of the community to search + community_id:, + # Keyword query within the selected community q:, - # Pagination cursor for cross-community results + # Pagination cursor for community results cursor: nil, - # Sort order for cross-community results (Latest or Top) + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Sort order for community results (Latest or Top) query_type: nil, request_options: {} ) @@ -31,6 +42,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end @@ -39,6 +51,12 @@ module XTwitterScraper id, # Pagination cursor for community tweets cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/dm.rbi b/rbi/x_twitter_scraper/resources/x/dm.rbi index 7a5b6b7..0643b0b 100644 --- a/rbi/x_twitter_scraper/resources/x/dm.rbi +++ b/rbi/x_twitter_scraper/resources/x/dm.rbi @@ -8,6 +8,7 @@ module XTwitterScraper sig do params( user_id: String, + account: String, cursor: String, max_id: String, request_options: XTwitterScraper::RequestOptions::OrHash @@ -16,6 +17,9 @@ module XTwitterScraper def retrieve_history( # Target user ID user_id, + # X handle (without the `@` prefix) of the connected X account used to read the + # conversation. The account must be a participant in the conversation. + account:, # Pagination cursor for DM history cursor: nil, # Legacy pagination cursor (backward compat) @@ -31,7 +35,6 @@ module XTwitterScraper account: String, text: String, media_ids: T::Array[String], - reply_to_message_id: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::DmSendResponse) end @@ -41,8 +44,8 @@ module XTwitterScraper # X account (@username or ID) sending the DM account:, text:, + # Optional array containing exactly 1 uploaded media ID. media_ids: nil, - reply_to_message_id: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/followers.rbi b/rbi/x_twitter_scraper/resources/x/followers.rbi index c0936b6..e303797 100644 --- a/rbi/x_twitter_scraper/resources/x/followers.rbi +++ b/rbi/x_twitter_scraper/resources/x/followers.rbi @@ -14,9 +14,9 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::FollowerCheckResponse) end def check( - # Username to check (without @) + # Source username, @username, or X or Twitter profile URL source:, - # Target username (without @) + # Target username, @username, or X or Twitter profile URL target:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/lists.rbi b/rbi/x_twitter_scraper/resources/x/lists.rbi index 6441106..b2d9578 100644 --- a/rbi/x_twitter_scraper/resources/x/lists.rbi +++ b/rbi/x_twitter_scraper/resources/x/lists.rbi @@ -10,6 +10,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -18,6 +19,11 @@ module XTwitterScraper id, # Pagination cursor for list followers cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -48,6 +54,7 @@ module XTwitterScraper id: String, cursor: String, include_replies: T::Boolean, + page_size: Integer, since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions::OrHash @@ -60,6 +67,12 @@ module XTwitterScraper cursor: nil, # Include replies (default false) include_replies: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, # Unix timestamp - filter after since_time: nil, # Unix timestamp - filter before diff --git a/rbi/x_twitter_scraper/resources/x/media.rbi b/rbi/x_twitter_scraper/resources/x/media.rbi index 1d62a03..32f8fb1 100644 --- a/rbi/x_twitter_scraper/resources/x/media.rbi +++ b/rbi/x_twitter_scraper/resources/x/media.rbi @@ -8,16 +8,22 @@ module XTwitterScraper # Download images & videos from tweets sig do params( + tweet_id: String, tweet_ids: T::Array[String], tweet_input: String, + tweet_url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::MediaDownloadResponse) end def download( - # Array of tweet URLs or IDs (bulk, max 50) + # Numeric tweet ID alias for tweetInput + tweet_id: nil, + # Array of tweet URLs or IDs (bulk, max 50 string items) tweet_ids: nil, # Tweet URL or ID (single tweet) tweet_input: nil, + # Tweet URL alias for tweetInput + tweet_url: nil, request_options: {} ) end @@ -26,17 +32,15 @@ module XTwitterScraper sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, - is_long_video: T::Boolean, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::MediaUploadResponse) end def upload( - # X account (@username or ID) uploading media + # X account (@username or ID) uploading media from URL account:, - # Media file to upload - file:, - is_long_video: nil, + # HTTPS URL to download and upload as media + url:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/profile.rbi b/rbi/x_twitter_scraper/resources/x/profile.rbi index 35c688f..448cf44 100644 --- a/rbi/x_twitter_scraper/resources/x/profile.rbi +++ b/rbi/x_twitter_scraper/resources/x/profile.rbi @@ -34,15 +34,15 @@ module XTwitterScraper sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::ProfileUpdateAvatarResponse) end def update_avatar( - # X account (@username or ID) for avatar update + # X account (@username or ID) receiving avatar from URL account:, - # Avatar image (max 716KB) - file:, + # HTTPS URL to the avatar image to download + url:, request_options: {} ) end @@ -51,15 +51,15 @@ module XTwitterScraper sig do params( account: String, - file: XTwitterScraper::Internal::FileInput, + url: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::ProfileUpdateBannerResponse) end def update_banner( - # X account (@username or ID) for banner update + # X account (@username or ID) receiving banner from URL account:, - # Banner image (max 2MB) - file:, + # HTTPS URL to the banner image to download + url:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index 042fc0b..c396595 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -31,8 +31,9 @@ module XTwitterScraper attachment_url: nil, community_id: nil, is_note_tweet: nil, - # Array of public image URLs to attach (max 4). Each URL must be publicly - # reachable - the browser composer fetches them directly. + # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 + # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 + # credits per started MB across all files. media: nil, reply_to_tweet_id: nil, # Tweet text (optional when media is provided) @@ -49,7 +50,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::TweetRetrieveResponse) end def retrieve( - # Tweet ID + # Numeric tweet ID, 15-20 digits id, request_options: {} ) @@ -91,6 +92,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -99,6 +101,11 @@ module XTwitterScraper id, # Pagination cursor for favoriters cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -107,24 +114,110 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetQuotesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::X::TweetGetQuotesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetQuotesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetQuotesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def get_quotes( - # Tweet ID to get quotes + # Numeric tweet ID to get quotes, 15-20 digits id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for quote tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, # Include reply quotes (default false) include_replies: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return quotes posted after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return quotes posted before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -133,21 +226,107 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def get_replies( # Tweet ID to get replies id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for tweet replies cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return replies posted after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return replies posted before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -157,6 +336,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -165,6 +345,11 @@ module XTwitterScraper id, # Pagination cursor for retweeters cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -174,6 +359,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end @@ -182,36 +368,140 @@ module XTwitterScraper id, # Pagination cursor for thread tweets cursor: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, request_options: {} ) end - # Search tweets with X query operators & pagination + # Search tweets by query, Tweet ID, X status URL, or account date window sig do params( q: String, + advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, limit: Integer, + list_id: String, + media_type: + XTwitterScraper::X::TweetSearchParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, query_type: XTwitterScraper::X::TweetSearchParams::QueryType::OrSymbol, + quotes: XTwitterScraper::X::TweetSearchParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: XTwitterScraper::X::TweetSearchParams::Replies::OrSymbol, + retweets: XTwitterScraper::X::TweetSearchParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def search( # Search query (keywords, q:, + # Raw advanced search query appended as-is. + advanced_query: nil, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Geo bounding box, e.g. -74.1 40.6 -73.9 40.8. + bounding_box: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor from previous response cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, # Max tweets to return (server paginates internally). Omit for single page (~20). + # This is an upper bound for paid authenticated calls: remaining credits can + # reduce the returned page size, and zero affordable results returns 402 + # insufficient_credits. limit: nil, + # Search within a list ID. + list_id: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Search within a place ID. + place: nil, + # Search within a country code. + place_country: nil, + # Geo point radius, e.g. -73.99 40.73 25mi. + point_radius: nil, # Sort order - Latest (chronological) or Top (engagement-ranked) query_type: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # ISO 8601 timestamp - only return tweets after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # ISO 8601 timestamp - only return tweets before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index 7ac08be..d8eb1f5 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -3,7 +3,6 @@ module XTwitterScraper module Resources class X - # Look up, search, and explore user profiles and relationships class Users # X write actions (tweets, likes, follows, DMs) sig { returns(XTwitterScraper::Resources::X::Users::Follow) } @@ -23,15 +22,33 @@ module XTwitterScraper ) end + # Remove follower + sig do + params( + id: String, + account: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::X::UserRemoveFollowerResponse) + end + def remove_follower( + # User ID to remove from your followers + id, + # X account identifier (@username or account ID) + account:, + request_options: {} + ) + end + # Look up multiple users by IDs in one call sig do params( ids: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::PaginatedUsers) + ).returns(XTwitterScraper::Models::X::UserRetrieveBatchResponse) end def retrieve_batch( - # Comma-separated user IDs (max 100) + # Comma-separated numeric user IDs (1-100 values). Duplicate IDs are ignored while + # preserving first-seen order. ids:, request_options: {} ) @@ -41,7 +58,9 @@ module XTwitterScraper sig do params( id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) @@ -49,9 +68,16 @@ module XTwitterScraper def retrieve_followers( # User ID or username id, + # Legacy cursor alias. Prefer cursor. + after: nil, # Pagination cursor for followers list cursor: nil, - # Items per page (20-200, default 200) + # Legacy integer page size alias for following lists. Prefer pageSize. + limit: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. page_size: nil, request_options: {} ) @@ -62,6 +88,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -70,6 +97,11 @@ module XTwitterScraper id, # Pagination cursor for followers-you-know cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end @@ -78,7 +110,9 @@ module XTwitterScraper sig do params( id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) @@ -86,9 +120,16 @@ module XTwitterScraper def retrieve_following( # User ID or username for following lookup id, + # Legacy cursor alias. Prefer cursor. + after: nil, # Pagination cursor for following list cursor: nil, - # Results per page (20-200, default 200) + # Legacy page size alias. Prefer pageSize. + limit: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. page_size: nil, request_options: {} ) @@ -98,15 +139,102 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveLikesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveLikesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveLikesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveLikesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_likes( - # User ID + # User ID or username id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for liked tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -115,15 +243,102 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMediaParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMediaParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMediaParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMediaParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_media( - # User ID for media lookup + # User ID or username for media lookup id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for media tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -132,21 +347,215 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveMentionsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveMentionsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveMentionsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveMentionsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_mentions( # User ID or username for mentions lookup id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for mentions cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, # Unix timestamp - return mentions after this time since_time: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, # Unix timestamp - return mentions before this time until_time: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, + request_options: {} + ) + end + + # Returns the user's timeline with replies included by default. + sig do + params( + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + include_parent_tweet: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveRepliesParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveRepliesParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveRepliesParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveRepliesParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::PaginatedTweets) + end + def retrieve_replies( + # X user ID or username + id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, + # Pagination cursor for user replies + cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Include parent tweet for replies + include_parent_tweet: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -172,21 +581,108 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_parent_tweet: T::Boolean, include_replies: T::Boolean, + in_reply_to_tweet_id: String, + language: String, + media_type: + XTwitterScraper::X::UserRetrieveTweetsParams::MediaType::OrSymbol, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: + XTwitterScraper::X::UserRetrieveTweetsParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::UserRetrieveTweetsParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::UserRetrieveTweetsParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_tweets( # X user ID or username id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for user tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, # Include parent tweet for replies include_parent_tweet: nil, # Include reply tweets include_replies: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum likes threshold. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Maximum items requested from this page (1-100, default 20). The response can + # contain fewer items because the source returned fewer, filters removed items, or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true, even when a page is empty. The deprecated limit and count + # aliases remain accepted. + page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -196,6 +692,7 @@ module XTwitterScraper params( id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedUsers) end @@ -204,6 +701,11 @@ module XTwitterScraper id, # Pagination cursor for verified followers cursor: nil, + # Maximum user profiles requested from this page (20-200, default 200). The + # response can contain fewer profiles because the source returned fewer or + # remaining credits cover fewer results. Keep requesting next_cursor while + # has_next_page is true. The deprecated limit and count aliases remain accepted. + page_size: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/write_actions.rbi b/rbi/x_twitter_scraper/resources/x/write_actions.rbi new file mode 100644 index 0000000..b1ea1c7 --- /dev/null +++ b/rbi/x_twitter_scraper/resources/x/write_actions.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module XTwitterScraper + module Resources + class X + # X write actions (tweets, likes, follows, DMs) + class WriteActions + # Get write action status + sig do + params( + id: String, + request_options: XTwitterScraper::RequestOptions::OrHash + ).returns(XTwitterScraper::Models::X::WriteActionRetrieveResponse) + end + def retrieve( + # Write action ID returned by a pending write response. + id, + request_options: {} + ) + end + + # @api private + sig do + params(client: XTwitterScraper::Client).returns(T.attached_class) + end + def self.new(client:) + end + end + end + end +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..8278dc1 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,70 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "ruby", + "version-file": "lib/x_twitter_scraper/version.rb", + "extra-files": [ + { + "type": "ruby-readme", + "path": "README.md" + } + ] +} \ No newline at end of file diff --git a/sig/x_twitter_scraper/client.rbs b/sig/x_twitter_scraper/client.rbs index 4dd52cf..cf7ef16 100644 --- a/sig/x_twitter_scraper/client.rbs +++ b/sig/x_twitter_scraper/client.rbs @@ -14,8 +14,6 @@ module XTwitterScraper attr_reader account: XTwitterScraper::Resources::Account - attr_reader api_keys: XTwitterScraper::Resources::APIKeys - attr_reader subscribe: XTwitterScraper::Resources::Subscribe attr_reader compose: XTwitterScraper::Resources::Compose @@ -44,7 +42,11 @@ module XTwitterScraper attr_reader credits: XTwitterScraper::Resources::Credits - private def auth_headers: -> ::Hash[String, String] + attr_reader guest_wallets: XTwitterScraper::Resources::GuestWallets + + private def auth_headers: ( + security: { auth_api_key: bool, oauth_bearer: bool } + ) -> ::Hash[String, String] private def auth_api_key: -> ::Hash[String, String] diff --git a/sig/x_twitter_scraper/internal/transport/base_client.rbs b/sig/x_twitter_scraper/internal/transport/base_client.rbs index 4de0c9e..ae83c6f 100644 --- a/sig/x_twitter_scraper/internal/transport/base_client.rbs +++ b/sig/x_twitter_scraper/internal/transport/base_client.rbs @@ -20,6 +20,7 @@ module XTwitterScraper page: Class?, stream: Class?, model: XTwitterScraper::Internal::Type::Converter::input?, + security: { auth_api_key: bool, oauth_bearer: bool }?, options: XTwitterScraper::request_opts? } type request_input = @@ -123,6 +124,7 @@ module XTwitterScraper ?page: Class?, ?stream: Class?, ?model: XTwitterScraper::Internal::Type::Converter::input?, + ?security: { auth_api_key: bool, oauth_bearer: bool }?, ?options: XTwitterScraper::request_opts? ) -> top diff --git a/sig/x_twitter_scraper/models.rbs b/sig/x_twitter_scraper/models.rbs index ab6aab2..3dc9387 100644 --- a/sig/x_twitter_scraper/models.rbs +++ b/sig/x_twitter_scraper/models.rbs @@ -5,18 +5,16 @@ module XTwitterScraper class AccountUpdateLocaleParams = XTwitterScraper::Models::AccountUpdateLocaleParams - class APIKey = XTwitterScraper::Models::APIKey - - class APIKeyCreateParams = XTwitterScraper::Models::APIKeyCreateParams - - class APIKeyListParams = XTwitterScraper::Models::APIKeyListParams + class ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams - class APIKeyRevokeParams = XTwitterScraper::Models::APIKeyRevokeParams + class ContentDisclosure = XTwitterScraper::Models::ContentDisclosure - class ComposeCreateParams = XTwitterScraper::Models::ComposeCreateParams + class CreditRedirectTopupCheckoutParams = XTwitterScraper::Models::CreditRedirectTopupCheckoutParams class CreditRetrieveBalanceParams = XTwitterScraper::Models::CreditRetrieveBalanceParams + class CreditRetrieveTopupStatusParams = XTwitterScraper::Models::CreditRetrieveTopupStatusParams + class CreditTopupBalanceParams = XTwitterScraper::Models::CreditTopupBalanceParams class Delivery = XTwitterScraper::Models::Delivery @@ -45,6 +43,8 @@ module XTwitterScraper class DrawRunParams = XTwitterScraper::Models::DrawRunParams + class EmbeddedTweet = XTwitterScraper::Models::EmbeddedTweet + class Error = XTwitterScraper::Models::Error class Event = XTwitterScraper::Models::Event @@ -69,6 +69,14 @@ module XTwitterScraper class ExtractionRunParams = XTwitterScraper::Models::ExtractionRunParams + class GuestWalletAmount = XTwitterScraper::Models::GuestWalletAmount + + class GuestWalletCreateParams = XTwitterScraper::Models::GuestWalletCreateParams + + class GuestWalletRetrieveStatusParams = XTwitterScraper::Models::GuestWalletRetrieveStatusParams + + class GuestWalletTopupParams = XTwitterScraper::Models::GuestWalletTopupParams + class Monitor = XTwitterScraper::Models::Monitor class MonitorCreateParams = XTwitterScraper::Models::MonitorCreateParams @@ -79,6 +87,8 @@ module XTwitterScraper class MonitorRetrieveParams = XTwitterScraper::Models::MonitorRetrieveParams + module Monitors = XTwitterScraper::Models::Monitors + class MonitorUpdateParams = XTwitterScraper::Models::MonitorUpdateParams class PaginatedTweets = XTwitterScraper::Models::PaginatedTweets @@ -115,6 +125,8 @@ module XTwitterScraper class TrendListParams = XTwitterScraper::Models::TrendListParams + class TweetMedia = XTwitterScraper::Models::TweetMedia + class UserProfile = XTwitterScraper::Models::UserProfile class Webhook = XTwitterScraper::Models::Webhook @@ -127,6 +139,8 @@ module XTwitterScraper class WebhookListParams = XTwitterScraper::Models::WebhookListParams + class WebhookResumeParams = XTwitterScraper::Models::WebhookResumeParams + class WebhookTestParams = XTwitterScraper::Models::WebhookTestParams class WebhookUpdateParams = XTwitterScraper::Models::WebhookUpdateParams diff --git a/sig/x_twitter_scraper/models/account_retrieve_response.rbs b/sig/x_twitter_scraper/models/account_retrieve_response.rbs index ae85137..e3ca282 100644 --- a/sig/x_twitter_scraper/models/account_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/account_retrieve_response.rbs @@ -2,6 +2,7 @@ module XTwitterScraper module Models type account_retrieve_response = { + monitor_billing: XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, @@ -10,6 +11,8 @@ module XTwitterScraper } class AccountRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor monitor_billing: XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling + attr_accessor monitors_allowed: Integer attr_accessor monitors_used: Integer @@ -27,6 +30,7 @@ module XTwitterScraper def x_username=: (String) -> String def initialize: ( + monitor_billing: XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, @@ -35,6 +39,7 @@ module XTwitterScraper ) -> void def to_hash: -> { + monitor_billing: XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::plan, @@ -42,6 +47,53 @@ module XTwitterScraper x_username: String } + type monitor_billing = + { + active_daily_estimate: String, + active_hourly_burn: String, + credits_per_active_monitor_day: String, + credits_per_active_monitor_hour: String, + events_included: bool, + instant_check_interval_seconds: Integer, + unlimited_slots: bool + } + + class MonitorBilling < XTwitterScraper::Internal::Type::BaseModel + attr_accessor active_daily_estimate: String + + attr_accessor active_hourly_burn: String + + attr_accessor credits_per_active_monitor_day: String + + attr_accessor credits_per_active_monitor_hour: String + + attr_accessor events_included: bool + + attr_accessor instant_check_interval_seconds: Integer + + attr_accessor unlimited_slots: bool + + def initialize: ( + active_daily_estimate: String, + active_hourly_burn: String, + credits_per_active_monitor_day: String, + credits_per_active_monitor_hour: String, + events_included: bool, + instant_check_interval_seconds: Integer, + unlimited_slots: bool + ) -> void + + def to_hash: -> { + active_daily_estimate: String, + active_hourly_burn: String, + credits_per_active_monitor_day: String, + credits_per_active_monitor_hour: String, + events_included: bool, + instant_check_interval_seconds: Integer, + unlimited_slots: bool + } + end + type plan = :active | :inactive module Plan @@ -55,33 +107,43 @@ module XTwitterScraper type credit_info = { + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } class CreditInfo < XTwitterScraper::Internal::Type::BaseModel + attr_accessor auto_topup_amount_dollars: Float + attr_accessor auto_topup_enabled: bool - attr_accessor balance: Integer + attr_accessor auto_topup_threshold: String + + attr_accessor balance: String - attr_accessor lifetime_purchased: Integer + attr_accessor lifetime_purchased: String - attr_accessor lifetime_used: Integer + attr_accessor lifetime_used: String def initialize: ( + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String ) -> void def to_hash: -> { + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } end end diff --git a/sig/x_twitter_scraper/models/api_key.rbs b/sig/x_twitter_scraper/models/api_key.rbs deleted file mode 100644 index 61d6d6f..0000000 --- a/sig/x_twitter_scraper/models/api_key.rbs +++ /dev/null @@ -1,47 +0,0 @@ -module XTwitterScraper - module Models - type api_key = - { - id: String, - created_at: Time, - is_active: bool, - name: String, - prefix: String, - last_used_at: Time - } - - class APIKey < 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 - end -end diff --git a/sig/x_twitter_scraper/models/api_key_create_response.rbs b/sig/x_twitter_scraper/models/api_key_create_response.rbs deleted file mode 100644 index 767c304..0000000 --- a/sig/x_twitter_scraper/models/api_key_create_response.rbs +++ /dev/null @@ -1,40 +0,0 @@ -module XTwitterScraper - module Models - type api_key_create_response = - { - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - } - - class APIKeyCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor full_key: String - - attr_accessor name: String - - attr_accessor prefix: String - - def initialize: ( - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - } - end - end -end diff --git a/sig/x_twitter_scraper/models/api_key_list_response.rbs b/sig/x_twitter_scraper/models/api_key_list_response.rbs deleted file mode 100644 index 106f4ec..0000000 --- a/sig/x_twitter_scraper/models/api_key_list_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module XTwitterScraper - module Models - type api_key_list_response = { keys: ::Array[XTwitterScraper::APIKey] } - - class APIKeyListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor keys: ::Array[XTwitterScraper::APIKey] - - def initialize: (keys: ::Array[XTwitterScraper::APIKey]) -> void - - def to_hash: -> { keys: ::Array[XTwitterScraper::APIKey] } - end - end -end diff --git a/sig/x_twitter_scraper/models/api_key_revoke_response.rbs b/sig/x_twitter_scraper/models/api_key_revoke_response.rbs deleted file mode 100644 index cfea503..0000000 --- a/sig/x_twitter_scraper/models/api_key_revoke_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module XTwitterScraper - module Models - type api_key_revoke_response = { success: true } - - class APIKeyRevokeResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true - - def initialize: (?success: true) -> void - - def to_hash: -> { success: true } - end - end -end diff --git a/sig/x_twitter_scraper/models/content_disclosure.rbs b/sig/x_twitter_scraper/models/content_disclosure.rbs new file mode 100644 index 0000000..10727d5 --- /dev/null +++ b/sig/x_twitter_scraper/models/content_disclosure.rbs @@ -0,0 +1,78 @@ +module XTwitterScraper + module Models + type content_disclosure = + { + advertising: XTwitterScraper::ContentDisclosure::Advertising, + ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated + } + + class ContentDisclosure < XTwitterScraper::Internal::Type::BaseModel + attr_reader advertising: XTwitterScraper::ContentDisclosure::Advertising? + + def advertising=: ( + XTwitterScraper::ContentDisclosure::Advertising + ) -> XTwitterScraper::ContentDisclosure::Advertising + + attr_reader ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated? + + def ai_generated=: ( + XTwitterScraper::ContentDisclosure::AIGenerated + ) -> XTwitterScraper::ContentDisclosure::AIGenerated + + def initialize: ( + ?advertising: XTwitterScraper::ContentDisclosure::Advertising, + ?ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated + ) -> void + + def to_hash: -> { + advertising: XTwitterScraper::ContentDisclosure::Advertising, + ai_generated: XTwitterScraper::ContentDisclosure::AIGenerated + } + + type advertising = { is_paid_promotion: bool } + + class Advertising < XTwitterScraper::Internal::Type::BaseModel + attr_reader is_paid_promotion: bool? + + def is_paid_promotion=: (bool) -> bool + + def initialize: (?is_paid_promotion: bool) -> void + + def to_hash: -> { is_paid_promotion: bool } + end + + type ai_generated = + { + can_edit: bool, + detection_source: String, + has_ai_generated_media: bool + } + + class AIGenerated < XTwitterScraper::Internal::Type::BaseModel + attr_reader can_edit: bool? + + def can_edit=: (bool) -> bool + + attr_reader detection_source: String? + + def detection_source=: (String) -> String + + attr_reader has_ai_generated_media: bool? + + def has_ai_generated_media=: (bool) -> bool + + def initialize: ( + ?can_edit: bool, + ?detection_source: String, + ?has_ai_generated_media: bool + ) -> void + + def to_hash: -> { + can_edit: bool, + detection_source: String, + has_ai_generated_media: bool + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbs b/sig/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbs new file mode 100644 index 0000000..fab0582 --- /dev/null +++ b/sig/x_twitter_scraper/models/credit_redirect_topup_checkout_params.rbs @@ -0,0 +1,24 @@ +module XTwitterScraper + module Models + type credit_redirect_topup_checkout_params = + { session_id: String } + & XTwitterScraper::Internal::Type::request_parameters + + class CreditRedirectTopupCheckoutParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor session_id: String + + def initialize: ( + session_id: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + session_id: String, + request_options: XTwitterScraper::RequestOptions + } + end + end +end diff --git a/sig/x_twitter_scraper/models/credit_retrieve_balance_response.rbs b/sig/x_twitter_scraper/models/credit_retrieve_balance_response.rbs index e832730..f7b4e10 100644 --- a/sig/x_twitter_scraper/models/credit_retrieve_balance_response.rbs +++ b/sig/x_twitter_scraper/models/credit_retrieve_balance_response.rbs @@ -2,33 +2,43 @@ module XTwitterScraper module Models type credit_retrieve_balance_response = { + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } class CreditRetrieveBalanceResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor auto_topup_amount_dollars: Float + attr_accessor auto_topup_enabled: bool - attr_accessor balance: Integer + attr_accessor auto_topup_threshold: String + + attr_accessor balance: String - attr_accessor lifetime_purchased: Integer + attr_accessor lifetime_purchased: String - attr_accessor lifetime_used: Integer + attr_accessor lifetime_used: String def initialize: ( + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String ) -> void def to_hash: -> { + auto_topup_amount_dollars: Float, auto_topup_enabled: bool, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String } end end diff --git a/sig/x_twitter_scraper/models/api_key_create_params.rbs b/sig/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbs similarity index 54% rename from sig/x_twitter_scraper/models/api_key_create_params.rbs rename to sig/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbs index 29da315..25226ed 100644 --- a/sig/x_twitter_scraper/models/api_key_create_params.rbs +++ b/sig/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbs @@ -1,23 +1,22 @@ module XTwitterScraper module Models - type api_key_create_params = - { name: String } & XTwitterScraper::Internal::Type::request_parameters + type credit_retrieve_topup_status_params = + { session_id: String } + & XTwitterScraper::Internal::Type::request_parameters - class APIKeyCreateParams < XTwitterScraper::Internal::Type::BaseModel + class CreditRetrieveTopupStatusParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_reader name: String? - - def name=: (String) -> String + attr_accessor session_id: String def initialize: ( - ?name: String, + session_id: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - name: String, + session_id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbs b/sig/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbs new file mode 100644 index 0000000..d4c6fb1 --- /dev/null +++ b/sig/x_twitter_scraper/models/credit_retrieve_topup_status_response.rbs @@ -0,0 +1,45 @@ +module XTwitterScraper + module Models + type credit_retrieve_topup_status_response = + { + status: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::status, + amount_dollars: Integer?, + credits: String + } + + class CreditRetrieveTopupStatusResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor status: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::status + + attr_accessor amount_dollars: Integer? + + attr_reader credits: String? + + def credits=: (String) -> String + + def initialize: ( + status: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::status, + ?amount_dollars: Integer?, + ?credits: String + ) -> void + + def to_hash: -> { + status: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::status, + amount_dollars: Integer?, + credits: String + } + + type status = :paid | :processing | :failed | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + PAID: :paid + PROCESSING: :processing + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::status] + end + end + end +end diff --git a/sig/x_twitter_scraper/models/credit_topup_balance_params.rbs b/sig/x_twitter_scraper/models/credit_topup_balance_params.rbs index a510c99..b767735 100644 --- a/sig/x_twitter_scraper/models/credit_topup_balance_params.rbs +++ b/sig/x_twitter_scraper/models/credit_topup_balance_params.rbs @@ -1,21 +1,28 @@ module XTwitterScraper module Models type credit_topup_balance_params = - { amount: Integer } & XTwitterScraper::Internal::Type::request_parameters + { dollars: Integer, locale: String } + & XTwitterScraper::Internal::Type::request_parameters class CreditTopupBalanceParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_accessor amount: Integer + attr_accessor dollars: Integer + + attr_reader locale: String? + + def locale=: (String) -> String def initialize: ( - amount: Integer, + dollars: Integer, + ?locale: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - amount: Integer, + dollars: Integer, + locale: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/credit_topup_balance_response.rbs b/sig/x_twitter_scraper/models/credit_topup_balance_response.rbs index b0c8b25..7b12632 100644 --- a/sig/x_twitter_scraper/models/credit_topup_balance_response.rbs +++ b/sig/x_twitter_scraper/models/credit_topup_balance_response.rbs @@ -1,13 +1,15 @@ module XTwitterScraper module Models - type credit_topup_balance_response = { success: true } + type credit_topup_balance_response = { redirect_url: String, url: String } class CreditTopupBalanceResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor redirect_url: String - def initialize: (?success: true) -> void + attr_accessor url: String - def to_hash: -> { success: true } + def initialize: (redirect_url: String, url: String) -> void + + def to_hash: -> { redirect_url: String, url: String } end end end diff --git a/sig/x_twitter_scraper/models/draw_export_params.rbs b/sig/x_twitter_scraper/models/draw_export_params.rbs index 6d54b82..298c4b4 100644 --- a/sig/x_twitter_scraper/models/draw_export_params.rbs +++ b/sig/x_twitter_scraper/models/draw_export_params.rbs @@ -14,11 +14,7 @@ module XTwitterScraper attr_accessor id: String - attr_reader format_: XTwitterScraper::Models::DrawExportParams::format_? - - def format_=: ( - XTwitterScraper::Models::DrawExportParams::format_ - ) -> XTwitterScraper::Models::DrawExportParams::format_ + attr_accessor format_: XTwitterScraper::Models::DrawExportParams::format_ attr_reader type: XTwitterScraper::Models::DrawExportParams::type_? @@ -28,7 +24,7 @@ module XTwitterScraper def initialize: ( id: String, - ?format_: XTwitterScraper::Models::DrawExportParams::format_, + format_: XTwitterScraper::Models::DrawExportParams::format_, ?type: XTwitterScraper::Models::DrawExportParams::type_, ?request_options: XTwitterScraper::request_opts ) -> void diff --git a/sig/x_twitter_scraper/models/draw_list_params.rbs b/sig/x_twitter_scraper/models/draw_list_params.rbs index f2551bd..d8f4cd9 100644 --- a/sig/x_twitter_scraper/models/draw_list_params.rbs +++ b/sig/x_twitter_scraper/models/draw_list_params.rbs @@ -1,29 +1,29 @@ module XTwitterScraper module Models type draw_list_params = - { after: String, limit: Integer } + { cursor: String, limit: Integer } & XTwitterScraper::Internal::Type::request_parameters class DrawListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_reader after: String? + attr_reader cursor: String? - def after=: (String) -> String + def cursor=: (String) -> String attr_reader limit: Integer? def limit=: (Integer) -> Integer def initialize: ( - ?after: String, + ?cursor: String, ?limit: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/embedded_tweet.rbs b/sig/x_twitter_scraper/models/embedded_tweet.rbs new file mode 100644 index 0000000..9099ba4 --- /dev/null +++ b/sig/x_twitter_scraper/models/embedded_tweet.rbs @@ -0,0 +1,187 @@ +module XTwitterScraper + module Models + type embedded_tweet = + { + id: String, + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer, + text: String, + view_count: Integer, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: ::Array[Integer], + entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + source: String, + type: String, + url: String + } + + class EmbeddedTweet < 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 author: XTwitterScraper::UserProfile? + + def author=: ( + XTwitterScraper::UserProfile + ) -> XTwitterScraper::UserProfile + + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? + + def content_disclosure=: ( + XTwitterScraper::ContentDisclosure + ) -> XTwitterScraper::ContentDisclosure + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_reader display_text_range: ::Array[Integer]? + + def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader in_reply_to_id: String? + + def in_reply_to_id=: (String) -> String + + attr_reader in_reply_to_user_id: String? + + def in_reply_to_user_id=: (String) -> String + + attr_reader in_reply_to_username: String? + + def in_reply_to_username=: (String) -> String + + attr_reader is_limited_reply: bool? + + def is_limited_reply=: (bool) -> bool + + 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 lang: String? + + def lang=: (String) -> String + + attr_reader media: ::Array[XTwitterScraper::TweetMedia]? + + def media=: ( + ::Array[XTwitterScraper::TweetMedia] + ) -> ::Array[XTwitterScraper::TweetMedia] + + attr_reader source: String? + + def source=: (String) -> String + + attr_reader type: String? + + def type=: (String) -> String + + attr_reader url: String? + + def url=: (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, + ?author: XTwitterScraper::UserProfile, + ?content_disclosure: XTwitterScraper::ContentDisclosure, + ?conversation_id: String, + ?created_at: String, + ?display_text_range: ::Array[Integer], + ?entities: ::Hash[Symbol, top], + ?in_reply_to_id: String, + ?in_reply_to_user_id: String, + ?in_reply_to_username: String, + ?is_limited_reply: bool, + ?is_note_tweet: bool, + ?is_quote_status: bool, + ?is_reply: bool, + ?lang: String, + ?media: ::Array[XTwitterScraper::TweetMedia], + ?source: String, + ?type: String, + ?url: 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, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: ::Array[Integer], + entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + source: String, + type: String, + url: String + } + end + end +end diff --git a/sig/x_twitter_scraper/models/error.rbs b/sig/x_twitter_scraper/models/error.rbs index 04c853a..3cdbfad 100644 --- a/sig/x_twitter_scraper/models/error.rbs +++ b/sig/x_twitter_scraper/models/error.rbs @@ -10,64 +10,349 @@ module XTwitterScraper def to_hash: -> { error: XTwitterScraper::Models::Error::error } type error = - :internal_error - | :invalid_format - | :invalid_id - | :invalid_input - | :invalid_params - | :invalid_tool_type - | :invalid_tweet_id - | :invalid_tweet_url - | :invalid_username - | :insufficient_credits - | :missing_params - | :missing_query - | :monitor_already_exists - | :monitor_limit_reached - | :no_credits - | :no_subscription - | :not_found - | :subscription_inactive - | :tweet_not_found - | :unauthenticated - | :unsupported_field - | :user_not_found - | :webhook_inactive - | :x_api_rate_limited - | :x_api_unavailable - | :x_api_unauthorized + XTwitterScraper::Models::Error::Error::legacy_error_code + | XTwitterScraper::Error::Error::StructuredError module Error - extend XTwitterScraper::Internal::Type::Enum - - INTERNAL_ERROR: :internal_error - INVALID_FORMAT: :invalid_format - INVALID_ID: :invalid_id - INVALID_INPUT: :invalid_input - INVALID_PARAMS: :invalid_params - INVALID_TOOL_TYPE: :invalid_tool_type - INVALID_TWEET_ID: :invalid_tweet_id - INVALID_TWEET_URL: :invalid_tweet_url - INVALID_USERNAME: :invalid_username - INSUFFICIENT_CREDITS: :insufficient_credits - MISSING_PARAMS: :missing_params - MISSING_QUERY: :missing_query - MONITOR_ALREADY_EXISTS: :monitor_already_exists - MONITOR_LIMIT_REACHED: :monitor_limit_reached - NO_CREDITS: :no_credits - NO_SUBSCRIPTION: :no_subscription - NOT_FOUND: :not_found - SUBSCRIPTION_INACTIVE: :subscription_inactive - TWEET_NOT_FOUND: :tweet_not_found - UNAUTHENTICATED: :unauthenticated - UNSUPPORTED_FIELD: :unsupported_field - USER_NOT_FOUND: :user_not_found - WEBHOOK_INACTIVE: :webhook_inactive - X_API_RATE_LIMITED: :x_api_rate_limited - X_API_UNAVAILABLE: :x_api_unavailable - X_API_UNAUTHORIZED: :x_api_unauthorized - - def self?.values: -> ::Array[XTwitterScraper::Models::Error::error] + extend XTwitterScraper::Internal::Type::Union + + type legacy_error_code = + :internal_error + | :account_already_connected + | :account_needs_reauth + | :account_not_found + | :account_required + | :account_restricted + | :api_key_limit_reached + | :article_not_found + | :dm_not_permitted + | :invalid_format + | :invalid_id + | :invalid_input + | :invalid_params + | :invalid_tool_type + | :invalid_tweet_id + | :invalid_tweet_url + | :invalid_user_id + | :invalid_user_ids + | :invalid_username + | :invalid_json + | :insufficient_credits + | :login_cooldown + | :login_failed + | :media_download_failed + | :missing_params + | :missing_query + | :monitor_already_exists + | :no_media + | :no_credits + | :no_subscription + | :not_found + | :payment_failed + | :rate_limit_exceeded + | :service_unavailable + | :style_not_found + | :subscription_inactive + | :tweet_not_found + | :unauthenticated + | :unsupported_field + | :user_not_found + | :x_account_feature_required + | :x_account_protected + | :x_account_suspended + | :x_api_rate_limited + | :x_api_unavailable + | :x_api_unauthorized + | :x_auth_failure + | :x_content_too_long + | :x_daily_limit + | :x_dm_not_allowed + | :x_duplicate_action + | :x_login_auth_failed + | :x_login_challenge + | :x_login_denied + | :x_login_failed + | :x_login_proxy_error + | :x_login_rate_limited + | :x_login_service_unavailable + | :x_login_suspended + | :x_rate_limited + | :x_rejected + | :x_target_not_found + | :x_transient_error + | :x_user_lookup_failed + | :x_write_ambiguous + | :x_write_failed + | :x_write_unconfirmed + + module LegacyErrorCode + extend XTwitterScraper::Internal::Type::Enum + + INTERNAL_ERROR: :internal_error + ACCOUNT_ALREADY_CONNECTED: :account_already_connected + ACCOUNT_NEEDS_REAUTH: :account_needs_reauth + ACCOUNT_NOT_FOUND: :account_not_found + ACCOUNT_REQUIRED: :account_required + ACCOUNT_RESTRICTED: :account_restricted + API_KEY_LIMIT_REACHED: :api_key_limit_reached + ARTICLE_NOT_FOUND: :article_not_found + DM_NOT_PERMITTED: :dm_not_permitted + INVALID_FORMAT: :invalid_format + INVALID_ID: :invalid_id + INVALID_INPUT: :invalid_input + INVALID_PARAMS: :invalid_params + INVALID_TOOL_TYPE: :invalid_tool_type + INVALID_TWEET_ID: :invalid_tweet_id + INVALID_TWEET_URL: :invalid_tweet_url + INVALID_USER_ID: :invalid_user_id + INVALID_USER_IDS: :invalid_user_ids + INVALID_USERNAME: :invalid_username + INVALID_JSON: :invalid_json + INSUFFICIENT_CREDITS: :insufficient_credits + LOGIN_COOLDOWN: :login_cooldown + LOGIN_FAILED: :login_failed + MEDIA_DOWNLOAD_FAILED: :media_download_failed + MISSING_PARAMS: :missing_params + MISSING_QUERY: :missing_query + MONITOR_ALREADY_EXISTS: :monitor_already_exists + NO_MEDIA: :no_media + NO_CREDITS: :no_credits + NO_SUBSCRIPTION: :no_subscription + NOT_FOUND: :not_found + PAYMENT_FAILED: :payment_failed + RATE_LIMIT_EXCEEDED: :rate_limit_exceeded + SERVICE_UNAVAILABLE: :service_unavailable + STYLE_NOT_FOUND: :style_not_found + SUBSCRIPTION_INACTIVE: :subscription_inactive + TWEET_NOT_FOUND: :tweet_not_found + UNAUTHENTICATED: :unauthenticated + UNSUPPORTED_FIELD: :unsupported_field + USER_NOT_FOUND: :user_not_found + X_ACCOUNT_FEATURE_REQUIRED: :x_account_feature_required + X_ACCOUNT_PROTECTED: :x_account_protected + X_ACCOUNT_SUSPENDED: :x_account_suspended + X_API_RATE_LIMITED: :x_api_rate_limited + X_API_UNAVAILABLE: :x_api_unavailable + X_API_UNAUTHORIZED: :x_api_unauthorized + X_AUTH_FAILURE: :x_auth_failure + X_CONTENT_TOO_LONG: :x_content_too_long + X_DAILY_LIMIT: :x_daily_limit + X_DM_NOT_ALLOWED: :x_dm_not_allowed + X_DUPLICATE_ACTION: :x_duplicate_action + X_LOGIN_AUTH_FAILED: :x_login_auth_failed + X_LOGIN_CHALLENGE: :x_login_challenge + X_LOGIN_DENIED: :x_login_denied + X_LOGIN_FAILED: :x_login_failed + X_LOGIN_PROXY_ERROR: :x_login_proxy_error + X_LOGIN_RATE_LIMITED: :x_login_rate_limited + X_LOGIN_SERVICE_UNAVAILABLE: :x_login_service_unavailable + X_LOGIN_SUSPENDED: :x_login_suspended + X_RATE_LIMITED: :x_rate_limited + X_REJECTED: :x_rejected + X_TARGET_NOT_FOUND: :x_target_not_found + X_TRANSIENT_ERROR: :x_transient_error + X_USER_LOOKUP_FAILED: :x_user_lookup_failed + X_WRITE_AMBIGUOUS: :x_write_ambiguous + X_WRITE_FAILED: :x_write_failed + X_WRITE_UNCONFIRMED: :x_write_unconfirmed + + def self?.values: -> ::Array[XTwitterScraper::Models::Error::Error::legacy_error_code] + end + + type structured_error = + { + code: XTwitterScraper::Models::Error::Error::StructuredError::code, + message: String, + type: XTwitterScraper::Models::Error::Error::StructuredError::type_ + } + + class StructuredError < XTwitterScraper::Internal::Type::BaseModel + attr_accessor code: XTwitterScraper::Models::Error::Error::StructuredError::code + + attr_accessor message: String + + attr_accessor type: XTwitterScraper::Models::Error::Error::StructuredError::type_ + + def initialize: ( + code: XTwitterScraper::Models::Error::Error::StructuredError::code, + message: String, + type: XTwitterScraper::Models::Error::Error::StructuredError::type_ + ) -> void + + def to_hash: -> { + code: XTwitterScraper::Models::Error::Error::StructuredError::code, + message: String, + type: XTwitterScraper::Models::Error::Error::StructuredError::type_ + } + + type code = + :internal_error + | :account_already_connected + | :account_needs_reauth + | :account_not_found + | :account_required + | :account_restricted + | :api_key_limit_reached + | :article_not_found + | :dm_not_permitted + | :invalid_format + | :invalid_id + | :invalid_input + | :invalid_params + | :invalid_tool_type + | :invalid_tweet_id + | :invalid_tweet_url + | :invalid_user_id + | :invalid_user_ids + | :invalid_username + | :invalid_json + | :insufficient_credits + | :login_cooldown + | :login_failed + | :media_download_failed + | :missing_params + | :missing_query + | :monitor_already_exists + | :no_media + | :no_credits + | :no_subscription + | :not_found + | :payment_failed + | :rate_limit_exceeded + | :service_unavailable + | :style_not_found + | :subscription_inactive + | :tweet_not_found + | :unauthenticated + | :unsupported_field + | :user_not_found + | :x_account_feature_required + | :x_account_protected + | :x_account_suspended + | :x_api_rate_limited + | :x_api_unavailable + | :x_api_unauthorized + | :x_auth_failure + | :x_content_too_long + | :x_daily_limit + | :x_dm_not_allowed + | :x_duplicate_action + | :x_login_auth_failed + | :x_login_challenge + | :x_login_denied + | :x_login_failed + | :x_login_proxy_error + | :x_login_rate_limited + | :x_login_service_unavailable + | :x_login_suspended + | :x_rate_limited + | :x_rejected + | :x_target_not_found + | :x_transient_error + | :x_user_lookup_failed + | :x_write_ambiguous + | :x_write_failed + | :x_write_unconfirmed + + module Code + extend XTwitterScraper::Internal::Type::Enum + + INTERNAL_ERROR: :internal_error + ACCOUNT_ALREADY_CONNECTED: :account_already_connected + ACCOUNT_NEEDS_REAUTH: :account_needs_reauth + ACCOUNT_NOT_FOUND: :account_not_found + ACCOUNT_REQUIRED: :account_required + ACCOUNT_RESTRICTED: :account_restricted + API_KEY_LIMIT_REACHED: :api_key_limit_reached + ARTICLE_NOT_FOUND: :article_not_found + DM_NOT_PERMITTED: :dm_not_permitted + INVALID_FORMAT: :invalid_format + INVALID_ID: :invalid_id + INVALID_INPUT: :invalid_input + INVALID_PARAMS: :invalid_params + INVALID_TOOL_TYPE: :invalid_tool_type + INVALID_TWEET_ID: :invalid_tweet_id + INVALID_TWEET_URL: :invalid_tweet_url + INVALID_USER_ID: :invalid_user_id + INVALID_USER_IDS: :invalid_user_ids + INVALID_USERNAME: :invalid_username + INVALID_JSON: :invalid_json + INSUFFICIENT_CREDITS: :insufficient_credits + LOGIN_COOLDOWN: :login_cooldown + LOGIN_FAILED: :login_failed + MEDIA_DOWNLOAD_FAILED: :media_download_failed + MISSING_PARAMS: :missing_params + MISSING_QUERY: :missing_query + MONITOR_ALREADY_EXISTS: :monitor_already_exists + NO_MEDIA: :no_media + NO_CREDITS: :no_credits + NO_SUBSCRIPTION: :no_subscription + NOT_FOUND: :not_found + PAYMENT_FAILED: :payment_failed + RATE_LIMIT_EXCEEDED: :rate_limit_exceeded + SERVICE_UNAVAILABLE: :service_unavailable + STYLE_NOT_FOUND: :style_not_found + SUBSCRIPTION_INACTIVE: :subscription_inactive + TWEET_NOT_FOUND: :tweet_not_found + UNAUTHENTICATED: :unauthenticated + UNSUPPORTED_FIELD: :unsupported_field + USER_NOT_FOUND: :user_not_found + X_ACCOUNT_FEATURE_REQUIRED: :x_account_feature_required + X_ACCOUNT_PROTECTED: :x_account_protected + X_ACCOUNT_SUSPENDED: :x_account_suspended + X_API_RATE_LIMITED: :x_api_rate_limited + X_API_UNAVAILABLE: :x_api_unavailable + X_API_UNAUTHORIZED: :x_api_unauthorized + X_AUTH_FAILURE: :x_auth_failure + X_CONTENT_TOO_LONG: :x_content_too_long + X_DAILY_LIMIT: :x_daily_limit + X_DM_NOT_ALLOWED: :x_dm_not_allowed + X_DUPLICATE_ACTION: :x_duplicate_action + X_LOGIN_AUTH_FAILED: :x_login_auth_failed + X_LOGIN_CHALLENGE: :x_login_challenge + X_LOGIN_DENIED: :x_login_denied + X_LOGIN_FAILED: :x_login_failed + X_LOGIN_PROXY_ERROR: :x_login_proxy_error + X_LOGIN_RATE_LIMITED: :x_login_rate_limited + X_LOGIN_SERVICE_UNAVAILABLE: :x_login_service_unavailable + X_LOGIN_SUSPENDED: :x_login_suspended + X_RATE_LIMITED: :x_rate_limited + X_REJECTED: :x_rejected + X_TARGET_NOT_FOUND: :x_target_not_found + X_TRANSIENT_ERROR: :x_transient_error + X_USER_LOOKUP_FAILED: :x_user_lookup_failed + X_WRITE_AMBIGUOUS: :x_write_ambiguous + X_WRITE_FAILED: :x_write_failed + X_WRITE_UNCONFIRMED: :x_write_unconfirmed + + def self?.values: -> ::Array[XTwitterScraper::Models::Error::Error::StructuredError::code] + end + + type type_ = + :api_error + | :authentication_error + | :billing_error + | :dependency_error + | :invalid_request_error + | :permission_error + | :rate_limit_error + + module Type + extend XTwitterScraper::Internal::Type::Enum + + API_ERROR: :api_error + AUTHENTICATION_ERROR: :authentication_error + BILLING_ERROR: :billing_error + DEPENDENCY_ERROR: :dependency_error + INVALID_REQUEST_ERROR: :invalid_request_error + PERMISSION_ERROR: :permission_error + RATE_LIMIT_ERROR: :rate_limit_error + + def self?.values: -> ::Array[XTwitterScraper::Models::Error::Error::StructuredError::type_] + end + end + + def self?.variants: -> ::Array[XTwitterScraper::Models::Error::error] end end end diff --git a/sig/x_twitter_scraper/models/event.rbs b/sig/x_twitter_scraper/models/event.rbs index 846a758..3d61e17 100644 --- a/sig/x_twitter_scraper/models/event.rbs +++ b/sig/x_twitter_scraper/models/event.rbs @@ -5,8 +5,11 @@ module XTwitterScraper id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::Event::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, + keyword_monitor_id: String, + query: String, username: String } @@ -17,29 +20,58 @@ module XTwitterScraper attr_accessor monitor_id: String + attr_accessor monitor_type: XTwitterScraper::Models::Event::monitor_type + attr_accessor occurred_at: Time attr_accessor type: XTwitterScraper::Models::event_type - attr_accessor username: String + attr_reader keyword_monitor_id: String? + + def keyword_monitor_id=: (String) -> String + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String def initialize: ( id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::Event::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, - username: String + ?keyword_monitor_id: String, + ?query: String, + ?username: String ) -> void def to_hash: -> { id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::Event::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, + keyword_monitor_id: String, + query: String, username: String } + + type monitor_type = :account | :keyword + + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + ACCOUNT: :account + KEYWORD: :keyword + + def self?.values: -> ::Array[XTwitterScraper::Models::Event::monitor_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 fd7a97a..264159c 100644 --- a/sig/x_twitter_scraper/models/event_detail.rbs +++ b/sig/x_twitter_scraper/models/event_detail.rbs @@ -5,8 +5,11 @@ module XTwitterScraper id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::EventDetail::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, + keyword_monitor_id: String, + query: String, username: String, x_event_id: String } @@ -18,11 +21,23 @@ module XTwitterScraper attr_accessor monitor_id: String + attr_accessor monitor_type: XTwitterScraper::Models::EventDetail::monitor_type + attr_accessor occurred_at: Time attr_accessor type: XTwitterScraper::Models::event_type - attr_accessor username: String + attr_reader keyword_monitor_id: String? + + def keyword_monitor_id=: (String) -> String + + attr_reader query: String? + + def query=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String attr_reader x_event_id: String? @@ -32,9 +47,12 @@ module XTwitterScraper id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::EventDetail::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, - username: String, + ?keyword_monitor_id: String, + ?query: String, + ?username: String, ?x_event_id: String ) -> void @@ -42,11 +60,25 @@ module XTwitterScraper id: String, data: ::Hash[Symbol, top], monitor_id: String, + monitor_type: XTwitterScraper::Models::EventDetail::monitor_type, occurred_at: Time, type: XTwitterScraper::Models::event_type, + keyword_monitor_id: String, + query: String, username: String, x_event_id: String } + + type monitor_type = :account | :keyword + + module MonitorType + extend XTwitterScraper::Internal::Type::Enum + + ACCOUNT: :account + KEYWORD: :keyword + + def self?.values: -> ::Array[XTwitterScraper::Models::EventDetail::monitor_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 af33e9d..fc4245d 100644 --- a/sig/x_twitter_scraper/models/event_list_params.rbs +++ b/sig/x_twitter_scraper/models/event_list_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models type event_list_params = { - after: String, + cursor: String, event_type: XTwitterScraper::Models::event_type, limit: Integer, monitor_id: String @@ -13,9 +13,9 @@ module XTwitterScraper extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_reader after: String? + attr_reader cursor: String? - def after=: (String) -> String + def cursor=: (String) -> String attr_reader event_type: XTwitterScraper::Models::event_type? @@ -32,7 +32,7 @@ module XTwitterScraper def monitor_id=: (String) -> String def initialize: ( - ?after: String, + ?cursor: String, ?event_type: XTwitterScraper::Models::event_type, ?limit: Integer, ?monitor_id: String, @@ -40,7 +40,7 @@ module XTwitterScraper ) -> void def to_hash: -> { - after: String, + cursor: String, event_type: XTwitterScraper::Models::event_type, limit: Integer, monitor_id: String, diff --git a/sig/x_twitter_scraper/models/event_type.rbs b/sig/x_twitter_scraper/models/event_type.rbs index 451f9f0..bd3ef40 100644 --- a/sig/x_twitter_scraper/models/event_type.rbs +++ b/sig/x_twitter_scraper/models/event_type.rbs @@ -1,7 +1,27 @@ module XTwitterScraper module Models type event_type = - :"tweet.new" | :"tweet.reply" | :"tweet.retweet" | :"tweet.quote" + :"tweet.new" + | :"tweet.reply" + | :"tweet.retweet" + | :"tweet.quote" + | :"tweet.media" + | :"tweet.link" + | :"tweet.poll" + | :"tweet.mention" + | :"tweet.hashtag" + | :"tweet.longform" + | :"profile.avatar.changed" + | :"profile.banner.changed" + | :"profile.name.changed" + | :"profile.username.changed" + | :"profile.bio.changed" + | :"profile.location.changed" + | :"profile.url.changed" + | :"profile.verified.changed" + | :"profile.protected.changed" + | :"profile.pinned_tweet.changed" + | :"profile.unavailable.changed" module EventType extend XTwitterScraper::Internal::Type::Enum @@ -10,6 +30,23 @@ module XTwitterScraper TWEET_REPLY: :"tweet.reply" TWEET_RETWEET: :"tweet.retweet" TWEET_QUOTE: :"tweet.quote" + TWEET_MEDIA: :"tweet.media" + TWEET_LINK: :"tweet.link" + TWEET_POLL: :"tweet.poll" + TWEET_MENTION: :"tweet.mention" + TWEET_HASHTAG: :"tweet.hashtag" + TWEET_LONGFORM: :"tweet.longform" + PROFILE_AVATAR_CHANGED: :"profile.avatar.changed" + PROFILE_BANNER_CHANGED: :"profile.banner.changed" + PROFILE_NAME_CHANGED: :"profile.name.changed" + PROFILE_USERNAME_CHANGED: :"profile.username.changed" + PROFILE_BIO_CHANGED: :"profile.bio.changed" + PROFILE_LOCATION_CHANGED: :"profile.location.changed" + PROFILE_URL_CHANGED: :"profile.url.changed" + PROFILE_VERIFIED_CHANGED: :"profile.verified.changed" + PROFILE_PROTECTED_CHANGED: :"profile.protected.changed" + PROFILE_PINNED_TWEET_CHANGED: :"profile.pinned_tweet.changed" + PROFILE_UNAVAILABLE_CHANGED: :"profile.unavailable.changed" def self?.values: -> ::Array[XTwitterScraper::Models::event_type] end diff --git a/sig/x_twitter_scraper/models/extraction_estimate_cost_params.rbs b/sig/x_twitter_scraper/models/extraction_estimate_cost_params.rbs index a45e75b..7d1fea2 100644 --- a/sig/x_twitter_scraper/models/extraction_estimate_cost_params.rbs +++ b/sig/x_twitter_scraper/models/extraction_estimate_cost_params.rbs @@ -4,14 +4,43 @@ module XTwitterScraper { tool_type: XTwitterScraper::Models::ExtractionEstimateCostParams::tool_type, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::Models::ExtractionEstimateCostParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::Models::ExtractionEstimateCostParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::ExtractionEstimateCostParams::replies, + results_limit: Integer, + retweets: XTwitterScraper::Models::ExtractionEstimateCostParams::retweets, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, - target_username: String + target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -25,6 +54,22 @@ module XTwitterScraper def advanced_query=: (String) -> String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader bounding_box: String? + + def bounding_box=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader exact_phrase: String? def exact_phrase=: (String) -> String @@ -33,10 +78,102 @@ module XTwitterScraper def exclude_words=: (String) -> String + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader list_id: String? + + def list_id=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::ExtractionEstimateCostParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::ExtractionEstimateCostParams::media_type + ) -> XTwitterScraper::Models::ExtractionEstimateCostParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader place: String? + + def place=: (String) -> String + + attr_reader place_country: String? + + def place_country=: (String) -> String + + attr_reader point_radius: String? + + def point_radius=: (String) -> String + + attr_reader quotes: XTwitterScraper::Models::ExtractionEstimateCostParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::ExtractionEstimateCostParams::quotes + ) -> XTwitterScraper::Models::ExtractionEstimateCostParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::ExtractionEstimateCostParams::replies? + + def replies=: ( + XTwitterScraper::Models::ExtractionEstimateCostParams::replies + ) -> XTwitterScraper::Models::ExtractionEstimateCostParams::replies + + attr_reader results_limit: Integer? + + def results_limit=: (Integer) -> Integer + + attr_reader retweets: XTwitterScraper::Models::ExtractionEstimateCostParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::ExtractionEstimateCostParams::retweets + ) -> XTwitterScraper::Models::ExtractionEstimateCostParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + attr_reader search_query: String? def search_query=: (String) -> String + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader target_community_id: String? def target_community_id=: (String) -> String @@ -57,31 +194,105 @@ module XTwitterScraper def target_username=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( tool_type: XTwitterScraper::Models::ExtractionEstimateCostParams::tool_type, ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?exact_phrase: String, ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?list_id: String, + ?media_type: XTwitterScraper::Models::ExtractionEstimateCostParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, + ?quotes: XTwitterScraper::Models::ExtractionEstimateCostParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::ExtractionEstimateCostParams::replies, + ?results_limit: Integer, + ?retweets: XTwitterScraper::Models::ExtractionEstimateCostParams::retweets, + ?retweets_of_tweet_id: String, ?search_query: String, + ?since_date: Date, ?target_community_id: String, ?target_list_id: String, ?target_space_id: String, ?target_tweet_id: String, ?target_username: String, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { tool_type: XTwitterScraper::Models::ExtractionEstimateCostParams::tool_type, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::Models::ExtractionEstimateCostParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::Models::ExtractionEstimateCostParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::ExtractionEstimateCostParams::replies, + results_limit: Integer, + retweets: XTwitterScraper::Models::ExtractionEstimateCostParams::retweets, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } @@ -91,6 +302,7 @@ module XTwitterScraper | :community_moderator_explorer | :community_post_extractor | :community_search + | :favoriters | :follower_explorer | :following_explorer | :list_follower_explorer @@ -105,6 +317,8 @@ module XTwitterScraper | :space_explorer | :thread_extractor | :tweet_search_extractor + | :user_likes + | :user_media | :verified_follower_explorer module ToolType @@ -115,6 +329,7 @@ module XTwitterScraper COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer COMMUNITY_POST_EXTRACTOR: :community_post_extractor COMMUNITY_SEARCH: :community_search + FAVORITERS: :favoriters FOLLOWER_EXPLORER: :follower_explorer FOLLOWING_EXPLORER: :following_explorer LIST_FOLLOWER_EXPLORER: :list_follower_explorer @@ -129,10 +344,63 @@ module XTwitterScraper SPACE_EXPLORER: :space_explorer THREAD_EXTRACTOR: :thread_extractor TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor + USER_LIKES: :user_likes + USER_MEDIA: :user_media VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostParams::tool_type] end + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs b/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs index 187c5c6..c893057 100644 --- a/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs +++ b/sig/x_twitter_scraper/models/extraction_estimate_cost_response.rbs @@ -6,7 +6,7 @@ module XTwitterScraper credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: XTwitterScraper::Models::ExtractionEstimateCostResponse::source, resolved_x_user_id: String } @@ -19,7 +19,7 @@ module XTwitterScraper attr_accessor estimated_results: Integer - attr_accessor source: String + attr_accessor source: XTwitterScraper::Models::ExtractionEstimateCostResponse::source attr_reader resolved_x_user_id: String? @@ -30,7 +30,7 @@ module XTwitterScraper credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: XTwitterScraper::Models::ExtractionEstimateCostResponse::source, ?resolved_x_user_id: String ) -> void @@ -39,9 +39,36 @@ module XTwitterScraper credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: XTwitterScraper::Models::ExtractionEstimateCostResponse::source, resolved_x_user_id: String } + + type source = + :followers + | :following + | :paginationCap + | :posts + | :quoteCount + | :replyCount + | :resultsLimit + | :retweetCount + | :unknown + + module Source + extend XTwitterScraper::Internal::Type::Enum + + FOLLOWERS: :followers + FOLLOWING: :following + PAGINATION_CAP: :paginationCap + POSTS: :posts + QUOTE_COUNT: :quoteCount + REPLY_COUNT: :replyCount + RESULTS_LIMIT: :resultsLimit + RETWEET_COUNT: :retweetCount + UNKNOWN: :unknown + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionEstimateCostResponse::source] + end end end end diff --git a/sig/x_twitter_scraper/models/extraction_export_results_params.rbs b/sig/x_twitter_scraper/models/extraction_export_results_params.rbs index 168c6f4..879766a 100644 --- a/sig/x_twitter_scraper/models/extraction_export_results_params.rbs +++ b/sig/x_twitter_scraper/models/extraction_export_results_params.rbs @@ -13,15 +13,11 @@ module XTwitterScraper attr_accessor id: String - attr_reader format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_? - - def format_=: ( - XTwitterScraper::Models::ExtractionExportResultsParams::format_ - ) -> XTwitterScraper::Models::ExtractionExportResultsParams::format_ + attr_accessor format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_ def initialize: ( id: String, - ?format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_, + format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_, ?request_options: XTwitterScraper::request_opts ) -> void diff --git a/sig/x_twitter_scraper/models/extraction_job.rbs b/sig/x_twitter_scraper/models/extraction_job.rbs index 57813f7..4ddf6c2 100644 --- a/sig/x_twitter_scraper/models/extraction_job.rbs +++ b/sig/x_twitter_scraper/models/extraction_job.rbs @@ -61,6 +61,7 @@ module XTwitterScraper | :community_moderator_explorer | :community_post_extractor | :community_search + | :favoriters | :follower_explorer | :following_explorer | :list_follower_explorer @@ -75,6 +76,8 @@ module XTwitterScraper | :space_explorer | :thread_extractor | :tweet_search_extractor + | :user_likes + | :user_media | :verified_follower_explorer module ToolType @@ -85,6 +88,7 @@ module XTwitterScraper COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer COMMUNITY_POST_EXTRACTOR: :community_post_extractor COMMUNITY_SEARCH: :community_search + FAVORITERS: :favoriters FOLLOWER_EXPLORER: :follower_explorer FOLLOWING_EXPLORER: :following_explorer LIST_FOLLOWER_EXPLORER: :list_follower_explorer @@ -99,6 +103,8 @@ module XTwitterScraper SPACE_EXPLORER: :space_explorer THREAD_EXTRACTOR: :thread_extractor TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor + USER_LIKES: :user_likes + USER_MEDIA: :user_media VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionJob::tool_type] diff --git a/sig/x_twitter_scraper/models/extraction_list_params.rbs b/sig/x_twitter_scraper/models/extraction_list_params.rbs index 7fe2291..ae88b56 100644 --- a/sig/x_twitter_scraper/models/extraction_list_params.rbs +++ b/sig/x_twitter_scraper/models/extraction_list_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models type extraction_list_params = { - after: String, + cursor: String, limit: Integer, status: XTwitterScraper::Models::ExtractionListParams::status, tool_type: XTwitterScraper::Models::ExtractionListParams::tool_type @@ -13,9 +13,9 @@ module XTwitterScraper extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - attr_reader after: String? + attr_reader cursor: String? - def after=: (String) -> String + def cursor=: (String) -> String attr_reader limit: Integer? @@ -34,7 +34,7 @@ module XTwitterScraper ) -> XTwitterScraper::Models::ExtractionListParams::tool_type def initialize: ( - ?after: String, + ?cursor: String, ?limit: Integer, ?status: XTwitterScraper::Models::ExtractionListParams::status, ?tool_type: XTwitterScraper::Models::ExtractionListParams::tool_type, @@ -42,7 +42,7 @@ module XTwitterScraper ) -> void def to_hash: -> { - after: String, + cursor: String, limit: Integer, status: XTwitterScraper::Models::ExtractionListParams::status, tool_type: XTwitterScraper::Models::ExtractionListParams::tool_type, @@ -67,6 +67,7 @@ module XTwitterScraper | :community_moderator_explorer | :community_post_extractor | :community_search + | :favoriters | :follower_explorer | :following_explorer | :list_follower_explorer @@ -81,6 +82,8 @@ module XTwitterScraper | :space_explorer | :thread_extractor | :tweet_search_extractor + | :user_likes + | :user_media | :verified_follower_explorer module ToolType @@ -91,6 +94,7 @@ module XTwitterScraper COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer COMMUNITY_POST_EXTRACTOR: :community_post_extractor COMMUNITY_SEARCH: :community_search + FAVORITERS: :favoriters FOLLOWER_EXPLORER: :follower_explorer FOLLOWING_EXPLORER: :following_explorer LIST_FOLLOWER_EXPLORER: :list_follower_explorer @@ -105,6 +109,8 @@ module XTwitterScraper SPACE_EXPLORER: :space_explorer THREAD_EXTRACTOR: :thread_extractor TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor + USER_LIKES: :user_likes + USER_MEDIA: :user_media VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionListParams::tool_type] diff --git a/sig/x_twitter_scraper/models/extraction_retrieve_params.rbs b/sig/x_twitter_scraper/models/extraction_retrieve_params.rbs index 477d148..63f27c5 100644 --- a/sig/x_twitter_scraper/models/extraction_retrieve_params.rbs +++ b/sig/x_twitter_scraper/models/extraction_retrieve_params.rbs @@ -1,7 +1,7 @@ module XTwitterScraper module Models type extraction_retrieve_params = - { id: String, after: String, limit: Integer } + { id: String, cursor: String, limit: Integer } & XTwitterScraper::Internal::Type::request_parameters class ExtractionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel @@ -10,9 +10,9 @@ module XTwitterScraper attr_accessor id: String - attr_reader after: String? + attr_reader cursor: String? - def after=: (String) -> String + def cursor=: (String) -> String attr_reader limit: Integer? @@ -20,14 +20,14 @@ module XTwitterScraper def initialize: ( id: String, - ?after: String, + ?cursor: String, ?limit: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, - after: String, + cursor: String, limit: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/extraction_run_params.rbs b/sig/x_twitter_scraper/models/extraction_run_params.rbs index 2e3e79d..ce2c77f 100644 --- a/sig/x_twitter_scraper/models/extraction_run_params.rbs +++ b/sig/x_twitter_scraper/models/extraction_run_params.rbs @@ -4,14 +4,43 @@ module XTwitterScraper { tool_type: XTwitterScraper::Models::ExtractionRunParams::tool_type, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::Models::ExtractionRunParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::Models::ExtractionRunParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::ExtractionRunParams::replies, + results_limit: Integer, + retweets: XTwitterScraper::Models::ExtractionRunParams::retweets, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, - target_username: String + target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -25,6 +54,22 @@ module XTwitterScraper def advanced_query=: (String) -> String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader bounding_box: String? + + def bounding_box=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader exact_phrase: String? def exact_phrase=: (String) -> String @@ -33,10 +78,102 @@ module XTwitterScraper def exclude_words=: (String) -> String + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader list_id: String? + + def list_id=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::ExtractionRunParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::ExtractionRunParams::media_type + ) -> XTwitterScraper::Models::ExtractionRunParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader place: String? + + def place=: (String) -> String + + attr_reader place_country: String? + + def place_country=: (String) -> String + + attr_reader point_radius: String? + + def point_radius=: (String) -> String + + attr_reader quotes: XTwitterScraper::Models::ExtractionRunParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::ExtractionRunParams::quotes + ) -> XTwitterScraper::Models::ExtractionRunParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::ExtractionRunParams::replies? + + def replies=: ( + XTwitterScraper::Models::ExtractionRunParams::replies + ) -> XTwitterScraper::Models::ExtractionRunParams::replies + + attr_reader results_limit: Integer? + + def results_limit=: (Integer) -> Integer + + attr_reader retweets: XTwitterScraper::Models::ExtractionRunParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::ExtractionRunParams::retweets + ) -> XTwitterScraper::Models::ExtractionRunParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + attr_reader search_query: String? def search_query=: (String) -> String + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader target_community_id: String? def target_community_id=: (String) -> String @@ -57,31 +194,105 @@ module XTwitterScraper def target_username=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( tool_type: XTwitterScraper::Models::ExtractionRunParams::tool_type, ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?exact_phrase: String, ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?list_id: String, + ?media_type: XTwitterScraper::Models::ExtractionRunParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, + ?quotes: XTwitterScraper::Models::ExtractionRunParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::ExtractionRunParams::replies, + ?results_limit: Integer, + ?retweets: XTwitterScraper::Models::ExtractionRunParams::retweets, + ?retweets_of_tweet_id: String, ?search_query: String, + ?since_date: Date, ?target_community_id: String, ?target_list_id: String, ?target_space_id: String, ?target_tweet_id: String, ?target_username: String, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { tool_type: XTwitterScraper::Models::ExtractionRunParams::tool_type, advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, exact_phrase: String, exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + list_id: String, + media_type: XTwitterScraper::Models::ExtractionRunParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, + quotes: XTwitterScraper::Models::ExtractionRunParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::ExtractionRunParams::replies, + results_limit: Integer, + retweets: XTwitterScraper::Models::ExtractionRunParams::retweets, + retweets_of_tweet_id: String, search_query: String, + since_date: Date, target_community_id: String, target_list_id: String, target_space_id: String, target_tweet_id: String, target_username: String, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } @@ -91,6 +302,7 @@ module XTwitterScraper | :community_moderator_explorer | :community_post_extractor | :community_search + | :favoriters | :follower_explorer | :following_explorer | :list_follower_explorer @@ -105,6 +317,8 @@ module XTwitterScraper | :space_explorer | :thread_extractor | :tweet_search_extractor + | :user_likes + | :user_media | :verified_follower_explorer module ToolType @@ -115,6 +329,7 @@ module XTwitterScraper COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer COMMUNITY_POST_EXTRACTOR: :community_post_extractor COMMUNITY_SEARCH: :community_search + FAVORITERS: :favoriters FOLLOWER_EXPLORER: :follower_explorer FOLLOWING_EXPLORER: :following_explorer LIST_FOLLOWER_EXPLORER: :list_follower_explorer @@ -129,10 +344,63 @@ module XTwitterScraper SPACE_EXPLORER: :space_explorer THREAD_EXTRACTOR: :thread_extractor TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor + USER_LIKES: :user_likes + USER_MEDIA: :user_media VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunParams::tool_type] end + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunParams::retweets] + 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 e2dd402..18be280 100644 --- a/sig/x_twitter_scraper/models/extraction_run_response.rbs +++ b/sig/x_twitter_scraper/models/extraction_run_response.rbs @@ -32,6 +32,7 @@ module XTwitterScraper | :community_moderator_explorer | :community_post_extractor | :community_search + | :favoriters | :follower_explorer | :following_explorer | :list_follower_explorer @@ -46,6 +47,8 @@ module XTwitterScraper | :space_explorer | :thread_extractor | :tweet_search_extractor + | :user_likes + | :user_media | :verified_follower_explorer module ToolType @@ -56,6 +59,7 @@ module XTwitterScraper COMMUNITY_MODERATOR_EXPLORER: :community_moderator_explorer COMMUNITY_POST_EXTRACTOR: :community_post_extractor COMMUNITY_SEARCH: :community_search + FAVORITERS: :favoriters FOLLOWER_EXPLORER: :follower_explorer FOLLOWING_EXPLORER: :following_explorer LIST_FOLLOWER_EXPLORER: :list_follower_explorer @@ -70,6 +74,8 @@ module XTwitterScraper SPACE_EXPLORER: :space_explorer THREAD_EXTRACTOR: :thread_extractor TWEET_SEARCH_EXTRACTOR: :tweet_search_extractor + USER_LIKES: :user_likes + USER_MEDIA: :user_media VERIFIED_FOLLOWER_EXPLORER: :verified_follower_explorer def self?.values: -> ::Array[XTwitterScraper::Models::ExtractionRunResponse::tool_type] diff --git a/sig/x_twitter_scraper/models/guest_wallet_amount.rbs b/sig/x_twitter_scraper/models/guest_wallet_amount.rbs new file mode 100644 index 0000000..166ad43 --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_amount.rbs @@ -0,0 +1,15 @@ +module XTwitterScraper + module Models + type guest_wallet_amount = { amount_minor: Integer, currency: :usd } + + class GuestWalletAmount < XTwitterScraper::Internal::Type::BaseModel + attr_accessor amount_minor: Integer + + attr_accessor currency: :usd + + def initialize: (amount_minor: Integer, ?currency: :usd) -> void + + def to_hash: -> { amount_minor: Integer, currency: :usd } + end + end +end diff --git a/sig/x_twitter_scraper/models/guest_wallet_create_params.rbs b/sig/x_twitter_scraper/models/guest_wallet_create_params.rbs new file mode 100644 index 0000000..deeb46e --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_create_params.rbs @@ -0,0 +1,32 @@ +module XTwitterScraper + module Models + type guest_wallet_create_params = + { amount_minor: Integer, currency: :usd, idempotency_key: String } + & XTwitterScraper::Internal::Type::request_parameters + + class GuestWalletCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor amount_minor: Integer + + attr_accessor currency: :usd + + attr_accessor idempotency_key: String + + def initialize: ( + amount_minor: Integer, + idempotency_key: String, + ?currency: :usd, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + amount_minor: Integer, + currency: :usd, + idempotency_key: String, + request_options: XTwitterScraper::RequestOptions + } + end + end +end diff --git a/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs b/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs new file mode 100644 index 0000000..bb1d99a --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs @@ -0,0 +1,125 @@ +module XTwitterScraper + module Models + type guest_wallet_create_response = + { + account_required: false, + amount: XTwitterScraper::GuestWalletAmount, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + checkout_url: String, + credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", + credits: String, + expires_at: Time, + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + poll_after_seconds: 2, + purchase_id: String, + requires_user_interaction: true, + status: XTwitterScraper::Models::GuestWalletCreateResponse::status, + status_url: :"https://xquik.com/api/v1/guest-wallets/status", + wallet_id: String + } + + class GuestWalletCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor account_required: false + + attr_accessor amount: XTwitterScraper::GuestWalletAmount + + attr_accessor api_key: String + + attr_accessor authorization: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization + + attr_accessor checkout_url: String + + attr_accessor credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available." + + attr_accessor credits: String + + attr_accessor expires_at: Time + + attr_accessor instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending." + + attr_accessor poll_after_seconds: 2 + + attr_accessor purchase_id: String + + attr_accessor requires_user_interaction: true + + attr_accessor status: XTwitterScraper::Models::GuestWalletCreateResponse::status + + attr_accessor status_url: :"https://xquik.com/api/v1/guest-wallets/status" + + attr_accessor wallet_id: String + + def initialize: ( + amount: XTwitterScraper::GuestWalletAmount, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + checkout_url: String, + credits: String, + expires_at: Time, + purchase_id: String, + status: XTwitterScraper::Models::GuestWalletCreateResponse::status, + wallet_id: String, + ?account_required: false, + ?credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", + ?instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + ?poll_after_seconds: 2, + ?requires_user_interaction: true, + ?status_url: :"https://xquik.com/api/v1/guest-wallets/status" + ) -> void + + def to_hash: -> { + account_required: false, + amount: XTwitterScraper::GuestWalletAmount, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + checkout_url: String, + credential_notice: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", + credits: String, + expires_at: Time, + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + poll_after_seconds: 2, + purchase_id: String, + requires_user_interaction: true, + status: XTwitterScraper::Models::GuestWalletCreateResponse::status, + status_url: :"https://xquik.com/api/v1/guest-wallets/status", + wallet_id: String + } + + type authorization = { header: :Authorization, scheme: :Bearer } + + class Authorization < XTwitterScraper::Internal::Type::BaseModel + attr_accessor header: :Authorization + + attr_accessor scheme: :Bearer + + def initialize: (?header: :Authorization, ?scheme: :Bearer) -> void + + def to_hash: -> { header: :Authorization, scheme: :Bearer } + end + + type status = + :creating + | :pending + | :paid + | :expired + | :failed + | :refunded + | :disputed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING: :creating + PENDING: :pending + PAID: :paid + EXPIRED: :expired + FAILED: :failed + REFUNDED: :refunded + DISPUTED: :disputed + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletCreateResponse::status] + end + end + end +end diff --git a/sig/x_twitter_scraper/models/api_key_list_params.rbs b/sig/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbs similarity index 75% rename from sig/x_twitter_scraper/models/api_key_list_params.rbs rename to sig/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbs index ca8fc9d..71963c6 100644 --- a/sig/x_twitter_scraper/models/api_key_list_params.rbs +++ b/sig/x_twitter_scraper/models/guest_wallet_retrieve_status_params.rbs @@ -1,9 +1,9 @@ module XTwitterScraper module Models - type api_key_list_params = + type guest_wallet_retrieve_status_params = { } & XTwitterScraper::Internal::Type::request_parameters - class APIKeyListParams < XTwitterScraper::Internal::Type::BaseModel + class GuestWalletRetrieveStatusParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters diff --git a/sig/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbs b/sig/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbs new file mode 100644 index 0000000..b10eb16 --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_retrieve_status_response.rbs @@ -0,0 +1,163 @@ +module XTwitterScraper + module Models + type guest_wallet_retrieve_status_response = + { + balance: String, + latest_purchase: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase?, + poll_after_seconds: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::poll_after_seconds?, + scope: :paid_reads, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::status, + top_up: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp?, + usable: bool, + wallet_id: String + } + + class GuestWalletRetrieveStatusResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor balance: String + + attr_accessor latest_purchase: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase? + + attr_accessor poll_after_seconds: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::poll_after_seconds? + + attr_accessor scope: :paid_reads + + attr_accessor status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::status + + attr_accessor top_up: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp? + + attr_accessor usable: bool + + attr_accessor wallet_id: String + + def initialize: ( + balance: String, + latest_purchase: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase?, + poll_after_seconds: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::poll_after_seconds?, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::status, + top_up: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp?, + usable: bool, + wallet_id: String, + ?scope: :paid_reads + ) -> void + + def to_hash: -> { + balance: String, + latest_purchase: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase?, + poll_after_seconds: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::poll_after_seconds?, + scope: :paid_reads, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::status, + top_up: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp?, + usable: bool, + wallet_id: String + } + + type latest_purchase = + { + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String?, + credits: String, + expires_at: Time, + purchase_id: String, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::status + } + + class LatestPurchase < XTwitterScraper::Internal::Type::BaseModel + attr_accessor amount: XTwitterScraper::GuestWalletAmount + + attr_accessor checkout_url: String? + + attr_accessor credits: String + + attr_accessor expires_at: Time + + attr_accessor purchase_id: String + + attr_accessor status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::status + + def initialize: ( + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String?, + credits: String, + expires_at: Time, + purchase_id: String, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::status + ) -> void + + def to_hash: -> { + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String?, + credits: String, + expires_at: Time, + purchase_id: String, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::status + } + + type status = + :creating + | :pending + | :paid + | :expired + | :failed + | :refunded + | :disputed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING: :creating + PENDING: :pending + PAID: :paid + EXPIRED: :expired + FAILED: :failed + REFUNDED: :refunded + DISPUTED: :disputed + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase::status] + end + end + + type poll_after_seconds = 2 + + module PollAfterSeconds + extend XTwitterScraper::Internal::Type::Enum + + POLL_AFTER_SECONDS_2: 2 + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::poll_after_seconds] + end + + type status = :active | :pending | :expired | :failed | :frozen | :closed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACTIVE: :active + PENDING: :pending + EXPIRED: :expired + FAILED: :failed + FROZEN: :frozen + CLOSED: :closed + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::status] + end + + type top_up = { method_: :POST, path: :"/api/v1/guest-wallets/topups" } + + class TopUp < XTwitterScraper::Internal::Type::BaseModel + attr_accessor method_: :POST + + attr_accessor path: :"/api/v1/guest-wallets/topups" + + def initialize: ( + ?method_: :POST, + ?path: :"/api/v1/guest-wallets/topups" + ) -> void + + def to_hash: -> { + method_: :POST, + path: :"/api/v1/guest-wallets/topups" + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/guest_wallet_topup_params.rbs b/sig/x_twitter_scraper/models/guest_wallet_topup_params.rbs new file mode 100644 index 0000000..7492940 --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_topup_params.rbs @@ -0,0 +1,32 @@ +module XTwitterScraper + module Models + type guest_wallet_topup_params = + { amount_minor: Integer, currency: :usd, idempotency_key: String } + & XTwitterScraper::Internal::Type::request_parameters + + class GuestWalletTopupParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor amount_minor: Integer + + attr_accessor currency: :usd + + attr_accessor idempotency_key: String + + def initialize: ( + amount_minor: Integer, + idempotency_key: String, + ?currency: :usd, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + amount_minor: Integer, + currency: :usd, + idempotency_key: String, + request_options: XTwitterScraper::RequestOptions + } + end + end +end diff --git a/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs b/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs new file mode 100644 index 0000000..1ddc17e --- /dev/null +++ b/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs @@ -0,0 +1,146 @@ +module XTwitterScraper + module Models + type guest_wallet_topup_response = + { + account_required: false, + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String, + credits: String, + expires_at: Time, + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + poll_after_seconds: 2, + purchase_id: String, + requires_user_interaction: true, + status: XTwitterScraper::Models::GuestWalletTopupResponse::status, + status_url: :"https://xquik.com/api/v1/guest-wallets/status", + wallet_id: String, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, + credential_notice: XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice + } + + class GuestWalletTopupResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor account_required: false + + attr_accessor amount: XTwitterScraper::GuestWalletAmount + + attr_accessor checkout_url: String + + attr_accessor credits: String + + attr_accessor expires_at: Time + + attr_accessor instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending." + + attr_accessor poll_after_seconds: 2 + + attr_accessor purchase_id: String + + attr_accessor requires_user_interaction: true + + attr_accessor status: XTwitterScraper::Models::GuestWalletTopupResponse::status + + attr_accessor status_url: :"https://xquik.com/api/v1/guest-wallets/status" + + attr_accessor wallet_id: String + + attr_reader api_key: String? + + def api_key=: (String) -> String + + attr_reader authorization: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization? + + def authorization=: ( + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization + ) -> XTwitterScraper::Models::GuestWalletTopupResponse::Authorization + + attr_reader credential_notice: XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice? + + def credential_notice=: ( + XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice + ) -> XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice + + def initialize: ( + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String, + credits: String, + expires_at: Time, + purchase_id: String, + status: XTwitterScraper::Models::GuestWalletTopupResponse::status, + wallet_id: String, + ?api_key: String, + ?authorization: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, + ?credential_notice: XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice, + ?account_required: false, + ?instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + ?poll_after_seconds: 2, + ?requires_user_interaction: true, + ?status_url: :"https://xquik.com/api/v1/guest-wallets/status" + ) -> void + + def to_hash: -> { + account_required: false, + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String, + credits: String, + expires_at: Time, + instructions: :"Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", + poll_after_seconds: 2, + purchase_id: String, + requires_user_interaction: true, + status: XTwitterScraper::Models::GuestWalletTopupResponse::status, + status_url: :"https://xquik.com/api/v1/guest-wallets/status", + wallet_id: String, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization, + credential_notice: XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice + } + + type status = + :creating + | :pending + | :paid + | :expired + | :failed + | :refunded + | :disputed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + CREATING: :creating + PENDING: :pending + PAID: :paid + EXPIRED: :expired + FAILED: :failed + REFUNDED: :refunded + DISPUTED: :disputed + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletTopupResponse::status] + end + + type authorization = { header: :Authorization, scheme: :Bearer } + + class Authorization < XTwitterScraper::Internal::Type::BaseModel + attr_accessor header: :Authorization + + attr_accessor scheme: :Bearer + + def initialize: (?header: :Authorization, ?scheme: :Bearer) -> void + + def to_hash: -> { header: :Authorization, scheme: :Bearer } + end + + type credential_notice = + :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available." + + module CredentialNotice + extend XTwitterScraper::Internal::Type::Enum + + STORE_API_KEY_AND_THE_IDEMPOTENCY_KEY_SECURELY_BEFORE_SHARING_CHECKOUT_URL_NO_EMAIL_RECOVERY_IS_AVAILABLE: :"Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available." + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletTopupResponse::credential_notice] + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitor.rbs b/sig/x_twitter_scraper/models/monitor.rbs index 630bad5..8811c99 100644 --- a/sig/x_twitter_scraper/models/monitor.rbs +++ b/sig/x_twitter_scraper/models/monitor.rbs @@ -6,6 +6,7 @@ module XTwitterScraper created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, + next_billing_at: Time, username: String, x_user_id: String } @@ -19,6 +20,8 @@ module XTwitterScraper attr_accessor is_active: bool + attr_accessor next_billing_at: Time + attr_accessor username: String attr_accessor x_user_id: String @@ -28,6 +31,7 @@ module XTwitterScraper created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, + next_billing_at: Time, username: String, x_user_id: String ) -> void @@ -37,6 +41,7 @@ module XTwitterScraper created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], is_active: bool, + next_billing_at: Time, username: String, x_user_id: String } diff --git a/sig/x_twitter_scraper/models/monitor_create_response.rbs b/sig/x_twitter_scraper/models/monitor_create_response.rbs index c6a9155..8e28460 100644 --- a/sig/x_twitter_scraper/models/monitor_create_response.rbs +++ b/sig/x_twitter_scraper/models/monitor_create_response.rbs @@ -5,6 +5,8 @@ module XTwitterScraper id: String, created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, username: String, x_user_id: String } @@ -16,6 +18,10 @@ module XTwitterScraper attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + attr_accessor is_active: bool + + attr_accessor next_billing_at: Time + attr_accessor username: String attr_accessor x_user_id: String @@ -24,6 +30,8 @@ module XTwitterScraper id: String, created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, username: String, x_user_id: String ) -> void @@ -32,6 +40,8 @@ module XTwitterScraper id: String, created_at: Time, event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, username: String, x_user_id: String } diff --git a/sig/x_twitter_scraper/models/monitors/keyword_create_params.rbs b/sig/x_twitter_scraper/models/monitors/keyword_create_params.rbs new file mode 100644 index 0000000..fd95182 --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_create_params.rbs @@ -0,0 +1,33 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_create_params = + { + event_types: ::Array[XTwitterScraper::Models::event_type], + query: String + } + & XTwitterScraper::Internal::Type::request_parameters + + class KeywordCreateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + + attr_accessor query: String + + def initialize: ( + event_types: ::Array[XTwitterScraper::Models::event_type], + query: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + event_types: ::Array[XTwitterScraper::Models::event_type], + query: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_create_response.rbs b/sig/x_twitter_scraper/models/monitors/keyword_create_response.rbs new file mode 100644 index 0000000..647926c --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_create_response.rbs @@ -0,0 +1,47 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_create_response = + { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + + class KeywordCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + + attr_accessor is_active: bool + + attr_accessor next_billing_at: Time + + attr_accessor query: String + + def initialize: ( + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbs b/sig/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbs new file mode 100644 index 0000000..e818ae4 --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_deactivate_params.rbs @@ -0,0 +1,25 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_deactivate_params = + { id: String } & XTwitterScraper::Internal::Type::request_parameters + + class KeywordDeactivateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbs b/sig/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbs new file mode 100644 index 0000000..b8a5a1b --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_deactivate_response.rbs @@ -0,0 +1,15 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_deactivate_response = { success: true } + + class KeywordDeactivateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor success: true + + def initialize: (?success: true) -> void + + def to_hash: -> { success: true } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_list_params.rbs b/sig/x_twitter_scraper/models/monitors/keyword_list_params.rbs new file mode 100644 index 0000000..0eb5cff --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_list_params.rbs @@ -0,0 +1,19 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_list_params = + { } & XTwitterScraper::Internal::Type::request_parameters + + class KeywordListParams < 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/monitors/keyword_list_response.rbs b/sig/x_twitter_scraper/models/monitors/keyword_list_response.rbs new file mode 100644 index 0000000..0a1ba2f --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_list_response.rbs @@ -0,0 +1,69 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_list_response = + { + monitors: ::Array[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor], + total: Integer + } + + class KeywordListResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor monitors: ::Array[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor] + + attr_accessor total: Integer + + def initialize: ( + monitors: ::Array[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor], + total: Integer + ) -> void + + def to_hash: -> { + monitors: ::Array[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor], + total: Integer + } + + type monitor = + { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + + class Monitor < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + + attr_accessor is_active: bool + + attr_accessor next_billing_at: Time + + attr_accessor query: String + + def initialize: ( + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbs b/sig/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbs new file mode 100644 index 0000000..b59d394 --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_retrieve_params.rbs @@ -0,0 +1,25 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_retrieve_params = + { id: String } & XTwitterScraper::Internal::Type::request_parameters + + class KeywordRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbs b/sig/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbs new file mode 100644 index 0000000..d9f842f --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_retrieve_response.rbs @@ -0,0 +1,47 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_retrieve_response = + { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + + class KeywordRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + + attr_accessor is_active: bool + + attr_accessor next_billing_at: Time + + attr_accessor query: String + + def initialize: ( + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_update_params.rbs b/sig/x_twitter_scraper/models/monitors/keyword_update_params.rbs new file mode 100644 index 0000000..b578039 --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_update_params.rbs @@ -0,0 +1,44 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_update_params = + { + id: String, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool + } + & XTwitterScraper::Internal::Type::request_parameters + + class KeywordUpdateParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader event_types: ::Array[XTwitterScraper::Models::event_type]? + + def event_types=: ( + ::Array[XTwitterScraper::Models::event_type] + ) -> ::Array[XTwitterScraper::Models::event_type] + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + def initialize: ( + id: String, + ?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::event_type], + is_active: bool, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/monitors/keyword_update_response.rbs b/sig/x_twitter_scraper/models/monitors/keyword_update_response.rbs new file mode 100644 index 0000000..37fd167 --- /dev/null +++ b/sig/x_twitter_scraper/models/monitors/keyword_update_response.rbs @@ -0,0 +1,47 @@ +module XTwitterScraper + module Models + module Monitors + type keyword_update_response = + { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + + class KeywordUpdateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + + attr_accessor is_active: bool + + attr_accessor next_billing_at: Time + + attr_accessor query: String + + def initialize: ( + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + event_types: ::Array[XTwitterScraper::Models::event_type], + is_active: bool, + next_billing_at: Time, + query: String + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/search_tweet.rbs b/sig/x_twitter_scraper/models/search_tweet.rbs index aec8676..5898b52 100644 --- a/sig/x_twitter_scraper/models/search_tweet.rbs +++ b/sig/x_twitter_scraper/models/search_tweet.rbs @@ -3,117 +3,203 @@ module XTwitterScraper type search_tweet = { id: String, - text: String, - author: XTwitterScraper::SearchTweet::Author, bookmark_count: Integer, - created_at: String, - is_note_tweet: bool, like_count: Integer, quote_count: Integer, reply_count: Integer, retweet_count: Integer, - view_count: Integer + text: String, + view_count: Integer, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: ::Array[Integer], + entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: String } class SearchTweet < 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_reader author: XTwitterScraper::SearchTweet::Author? + attr_accessor view_count: Integer + + attr_reader author: XTwitterScraper::UserProfile? def author=: ( - XTwitterScraper::SearchTweet::Author - ) -> XTwitterScraper::SearchTweet::Author + XTwitterScraper::UserProfile + ) -> XTwitterScraper::UserProfile + + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? + + def content_disclosure=: ( + XTwitterScraper::ContentDisclosure + ) -> XTwitterScraper::ContentDisclosure - attr_reader bookmark_count: Integer? + attr_reader conversation_id: String? - def bookmark_count=: (Integer) -> Integer + def conversation_id=: (String) -> String attr_reader created_at: String? def created_at=: (String) -> String + attr_reader display_text_range: ::Array[Integer]? + + def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader in_reply_to_id: String? + + def in_reply_to_id=: (String) -> String + + attr_reader in_reply_to_user_id: String? + + def in_reply_to_user_id=: (String) -> String + + attr_reader in_reply_to_username: String? + + def in_reply_to_username=: (String) -> String + + attr_reader is_limited_reply: bool? + + def is_limited_reply=: (bool) -> bool + attr_reader is_note_tweet: bool? def is_note_tweet=: (bool) -> bool - attr_reader like_count: Integer? + attr_reader is_quote_status: bool? + + def is_quote_status=: (bool) -> bool - def like_count=: (Integer) -> Integer + attr_reader is_reply: bool? - attr_reader quote_count: Integer? + def is_reply=: (bool) -> bool - def quote_count=: (Integer) -> Integer + attr_reader lang: String? - attr_reader reply_count: Integer? + def lang=: (String) -> String - def reply_count=: (Integer) -> Integer + attr_reader media: ::Array[XTwitterScraper::TweetMedia]? - attr_reader retweet_count: Integer? + def media=: ( + ::Array[XTwitterScraper::TweetMedia] + ) -> ::Array[XTwitterScraper::TweetMedia] - def retweet_count=: (Integer) -> Integer + attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? - attr_reader view_count: Integer? + def quoted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet - def view_count=: (Integer) -> Integer + attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? + + def retweeted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet + + attr_reader source: String? + + def source=: (String) -> String + + attr_reader type: String? + + def type=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String def initialize: ( id: String, + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer, text: String, - ?author: XTwitterScraper::SearchTweet::Author, - ?bookmark_count: Integer, + view_count: Integer, + ?author: XTwitterScraper::UserProfile, + ?content_disclosure: XTwitterScraper::ContentDisclosure, + ?conversation_id: String, ?created_at: String, + ?display_text_range: ::Array[Integer], + ?entities: ::Hash[Symbol, top], + ?in_reply_to_id: String, + ?in_reply_to_user_id: String, + ?in_reply_to_username: String, + ?is_limited_reply: bool, ?is_note_tweet: bool, - ?like_count: Integer, - ?quote_count: Integer, - ?reply_count: Integer, - ?retweet_count: Integer, - ?view_count: Integer + ?is_quote_status: bool, + ?is_reply: bool, + ?lang: String, + ?media: ::Array[XTwitterScraper::TweetMedia], + ?quoted_tweet: XTwitterScraper::EmbeddedTweet, + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, + ?source: String, + ?type: String, + ?url: String ) -> void def to_hash: -> { id: String, - text: String, - author: XTwitterScraper::SearchTweet::Author, bookmark_count: Integer, - created_at: String, - is_note_tweet: bool, like_count: Integer, quote_count: Integer, reply_count: Integer, retweet_count: Integer, - view_count: Integer + text: String, + view_count: Integer, + author: XTwitterScraper::UserProfile, + content_disclosure: XTwitterScraper::ContentDisclosure, + conversation_id: String, + created_at: String, + display_text_range: ::Array[Integer], + entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, + is_note_tweet: bool, + is_quote_status: bool, + is_reply: bool, + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: String } - - 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 diff --git a/sig/x_twitter_scraper/models/subscribe_create_params.rbs b/sig/x_twitter_scraper/models/subscribe_create_params.rbs index 381bfec..bec317a 100644 --- a/sig/x_twitter_scraper/models/subscribe_create_params.rbs +++ b/sig/x_twitter_scraper/models/subscribe_create_params.rbs @@ -1,15 +1,40 @@ module XTwitterScraper module Models type subscribe_create_params = - { } & XTwitterScraper::Internal::Type::request_parameters + { tier: XTwitterScraper::Models::SubscribeCreateParams::tier } + & XTwitterScraper::Internal::Type::request_parameters class SubscribeCreateParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters - def initialize: (?request_options: XTwitterScraper::request_opts) -> void + attr_reader tier: XTwitterScraper::Models::SubscribeCreateParams::tier? - def to_hash: -> { request_options: XTwitterScraper::RequestOptions } + def tier=: ( + XTwitterScraper::Models::SubscribeCreateParams::tier + ) -> XTwitterScraper::Models::SubscribeCreateParams::tier + + def initialize: ( + ?tier: XTwitterScraper::Models::SubscribeCreateParams::tier, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + tier: XTwitterScraper::Models::SubscribeCreateParams::tier, + request_options: XTwitterScraper::RequestOptions + } + + type tier = :starter | :pro | :business + + module Tier + extend XTwitterScraper::Internal::Type::Enum + + STARTER: :starter + PRO: :pro + BUSINESS: :business + + def self?.values: -> ::Array[XTwitterScraper::Models::SubscribeCreateParams::tier] + end end end end diff --git a/sig/x_twitter_scraper/models/subscribe_create_response.rbs b/sig/x_twitter_scraper/models/subscribe_create_response.rbs index 5ebc354..722a2f1 100644 --- a/sig/x_twitter_scraper/models/subscribe_create_response.rbs +++ b/sig/x_twitter_scraper/models/subscribe_create_response.rbs @@ -2,34 +2,28 @@ module XTwitterScraper module Models type subscribe_create_response = { - url: String, message: String, - status: XTwitterScraper::Models::SubscribeCreateResponse::status + status: XTwitterScraper::Models::SubscribeCreateResponse::status, + url: String } class SubscribeCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor url: String - - attr_reader message: String? - - def message=: (String) -> String + attr_accessor message: String - attr_reader status: XTwitterScraper::Models::SubscribeCreateResponse::status? + attr_accessor status: XTwitterScraper::Models::SubscribeCreateResponse::status - def status=: ( - XTwitterScraper::Models::SubscribeCreateResponse::status - ) -> XTwitterScraper::Models::SubscribeCreateResponse::status + attr_accessor url: String def initialize: ( - url: String, - ?message: String, - ?status: XTwitterScraper::Models::SubscribeCreateResponse::status + message: String, + status: XTwitterScraper::Models::SubscribeCreateResponse::status, + url: String ) -> void def to_hash: -> { - url: String, message: String, - status: XTwitterScraper::Models::SubscribeCreateResponse::status + status: XTwitterScraper::Models::SubscribeCreateResponse::status, + url: String } type status = :checkout_created | :already_subscribed | :payment_issue diff --git a/sig/x_twitter_scraper/models/tweet_media.rbs b/sig/x_twitter_scraper/models/tweet_media.rbs new file mode 100644 index 0000000..1350b06 --- /dev/null +++ b/sig/x_twitter_scraper/models/tweet_media.rbs @@ -0,0 +1,72 @@ +module XTwitterScraper + module Models + type tweet_media = + { + media_url: String, + type: XTwitterScraper::Models::TweetMedia::type_, + url: String, + video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + } + + class TweetMedia < XTwitterScraper::Internal::Type::BaseModel + attr_accessor media_url: String + + attr_accessor type: XTwitterScraper::Models::TweetMedia::type_ + + attr_accessor url: String + + attr_reader video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant]? + + def video_variants=: ( + ::Array[XTwitterScraper::TweetMedia::VideoVariant] + ) -> ::Array[XTwitterScraper::TweetMedia::VideoVariant] + + def initialize: ( + media_url: String, + type: XTwitterScraper::Models::TweetMedia::type_, + url: String, + ?video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + ) -> void + + def to_hash: -> { + media_url: String, + type: XTwitterScraper::Models::TweetMedia::type_, + url: String, + video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + } + + 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::TweetMedia::type_] + end + + type video_variant = + { content_type: String, url: String, bitrate: Integer } + + class VideoVariant < XTwitterScraper::Internal::Type::BaseModel + attr_accessor content_type: String + + attr_accessor url: String + + attr_reader bitrate: Integer? + + def bitrate=: (Integer) -> Integer + + def initialize: ( + content_type: String, + url: String, + ?bitrate: Integer + ) -> void + + def to_hash: -> { content_type: String, url: String, bitrate: Integer } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/user_profile.rbs b/sig/x_twitter_scraper/models/user_profile.rbs index ac2c49e..a63b189 100644 --- a/sig/x_twitter_scraper/models/user_profile.rbs +++ b/sig/x_twitter_scraper/models/user_profile.rbs @@ -5,14 +5,37 @@ module XTwitterScraper id: String, name: String, username: String, + automated_by: String, + can_dm: bool, + community_role: String, + cover_picture: String, created_at: String, description: String, + favourites_count: Integer, followers: Integer, following: Integer, + has_custom_timelines: bool, + is_automated: bool, + is_blue_verified: bool, + is_translator: bool, + is_verified: bool, location: String, + media_count: Integer, + pinned_tweet_ids: ::Array[String], + possibly_sensitive: bool, + profile_bio: ::Hash[Symbol, top], + profile_banner_url: String, profile_picture: String, + protected: bool, statuses_count: Integer, - verified: bool + unavailable: bool, + unavailable_reason: String, + url: String, + verified: bool, + verified_type: String, + viewer_followed_by: bool, + viewer_following: bool, + withheld_in_countries: ::Array[String] } class UserProfile < XTwitterScraper::Internal::Type::BaseModel @@ -22,6 +45,22 @@ module XTwitterScraper attr_accessor username: String + attr_reader automated_by: String? + + def automated_by=: (String) -> String + + attr_reader can_dm: bool? + + def can_dm=: (bool) -> bool + + attr_reader community_role: String? + + def community_role=: (String) -> String + + attr_reader cover_picture: String? + + def cover_picture=: (String) -> String + attr_reader created_at: String? def created_at=: (String) -> String @@ -30,6 +69,10 @@ module XTwitterScraper def description=: (String) -> String + attr_reader favourites_count: Integer? + + def favourites_count=: (Integer) -> Integer + attr_reader followers: Integer? def followers=: (Integer) -> Integer @@ -38,48 +81,166 @@ module XTwitterScraper def following=: (Integer) -> Integer + attr_reader has_custom_timelines: bool? + + def has_custom_timelines=: (bool) -> bool + + attr_reader is_automated: bool? + + def is_automated=: (bool) -> bool + + attr_reader is_blue_verified: bool? + + def is_blue_verified=: (bool) -> bool + + attr_reader is_translator: bool? + + def is_translator=: (bool) -> bool + + attr_reader is_verified: bool? + + def is_verified=: (bool) -> bool + attr_reader location: String? def location=: (String) -> String + attr_reader media_count: Integer? + + def media_count=: (Integer) -> Integer + + attr_reader pinned_tweet_ids: ::Array[String]? + + def pinned_tweet_ids=: (::Array[String]) -> ::Array[String] + + attr_reader possibly_sensitive: bool? + + def possibly_sensitive=: (bool) -> bool + + attr_reader profile_bio: ::Hash[Symbol, top]? + + def profile_bio=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader profile_banner_url: String? + + def profile_banner_url=: (String) -> String + attr_reader profile_picture: String? def profile_picture=: (String) -> String + attr_reader protected: bool? + + def protected=: (bool) -> bool + attr_reader statuses_count: Integer? def statuses_count=: (Integer) -> Integer + attr_reader unavailable: bool? + + def unavailable=: (bool) -> bool + + attr_reader unavailable_reason: String? + + def unavailable_reason=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + attr_reader verified: bool? def verified=: (bool) -> bool + attr_reader verified_type: String? + + def verified_type=: (String) -> String + + attr_reader viewer_followed_by: bool? + + def viewer_followed_by=: (bool) -> bool + + attr_reader viewer_following: bool? + + def viewer_following=: (bool) -> bool + + attr_reader withheld_in_countries: ::Array[String]? + + def withheld_in_countries=: (::Array[String]) -> ::Array[String] + def initialize: ( id: String, name: String, username: String, + ?automated_by: String, + ?can_dm: bool, + ?community_role: String, + ?cover_picture: String, ?created_at: String, ?description: String, + ?favourites_count: Integer, ?followers: Integer, ?following: Integer, + ?has_custom_timelines: bool, + ?is_automated: bool, + ?is_blue_verified: bool, + ?is_translator: bool, + ?is_verified: bool, ?location: String, + ?media_count: Integer, + ?pinned_tweet_ids: ::Array[String], + ?possibly_sensitive: bool, + ?profile_bio: ::Hash[Symbol, top], + ?profile_banner_url: String, ?profile_picture: String, + ?protected: bool, ?statuses_count: Integer, - ?verified: bool + ?unavailable: bool, + ?unavailable_reason: String, + ?url: String, + ?verified: bool, + ?verified_type: String, + ?viewer_followed_by: bool, + ?viewer_following: bool, + ?withheld_in_countries: ::Array[String] ) -> void def to_hash: -> { id: String, name: String, username: String, + automated_by: String, + can_dm: bool, + community_role: String, + cover_picture: String, created_at: String, description: String, + favourites_count: Integer, followers: Integer, following: Integer, + has_custom_timelines: bool, + is_automated: bool, + is_blue_verified: bool, + is_translator: bool, + is_verified: bool, location: String, + media_count: Integer, + pinned_tweet_ids: ::Array[String], + possibly_sensitive: bool, + profile_bio: ::Hash[Symbol, top], + profile_banner_url: String, profile_picture: String, + protected: bool, statuses_count: Integer, - verified: bool + unavailable: bool, + unavailable_reason: String, + url: String, + verified: bool, + verified_type: String, + viewer_followed_by: bool, + viewer_following: bool, + withheld_in_countries: ::Array[String] } end end diff --git a/sig/x_twitter_scraper/models/webhook.rbs b/sig/x_twitter_scraper/models/webhook.rbs index fa648e5..08fa11b 100644 --- a/sig/x_twitter_scraper/models/webhook.rbs +++ b/sig/x_twitter_scraper/models/webhook.rbs @@ -3,8 +3,11 @@ module XTwitterScraper type webhook = { id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: XTwitterScraper::Models::Webhook::delivery_status, event_types: ::Array[XTwitterScraper::Models::event_type], + failure_hard_cap: Integer, is_active: bool, url: String } @@ -12,29 +15,53 @@ module XTwitterScraper class Webhook < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String + attr_accessor consecutive_failures: Integer + attr_accessor created_at: Time + attr_accessor delivery_status: XTwitterScraper::Models::Webhook::delivery_status + attr_accessor event_types: ::Array[XTwitterScraper::Models::event_type] + attr_accessor failure_hard_cap: Integer + attr_accessor is_active: bool attr_accessor url: String def initialize: ( id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: XTwitterScraper::Models::Webhook::delivery_status, event_types: ::Array[XTwitterScraper::Models::event_type], + failure_hard_cap: Integer, is_active: bool, url: String ) -> void def to_hash: -> { id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: XTwitterScraper::Models::Webhook::delivery_status, event_types: ::Array[XTwitterScraper::Models::event_type], + failure_hard_cap: Integer, is_active: bool, url: String } + + type delivery_status = :active | :paused | :needs_attention + + module DeliveryStatus + extend XTwitterScraper::Internal::Type::Enum + + ACTIVE: :active + PAUSED: :paused + NEEDS_ATTENTION: :needs_attention + + def self?.values: -> ::Array[XTwitterScraper::Models::Webhook::delivery_status] + end end end end diff --git a/sig/x_twitter_scraper/models/api_key_revoke_params.rbs b/sig/x_twitter_scraper/models/webhook_resume_params.rbs similarity index 83% rename from sig/x_twitter_scraper/models/api_key_revoke_params.rbs rename to sig/x_twitter_scraper/models/webhook_resume_params.rbs index e5cf802..e18383f 100644 --- a/sig/x_twitter_scraper/models/api_key_revoke_params.rbs +++ b/sig/x_twitter_scraper/models/webhook_resume_params.rbs @@ -1,9 +1,9 @@ module XTwitterScraper module Models - type api_key_revoke_params = + type webhook_resume_params = { id: String } & XTwitterScraper::Internal::Type::request_parameters - class APIKeyRevokeParams < XTwitterScraper::Internal::Type::BaseModel + class WebhookResumeParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters diff --git a/sig/x_twitter_scraper/models/webhook_resume_response.rbs b/sig/x_twitter_scraper/models/webhook_resume_response.rbs new file mode 100644 index 0000000..e6ba6e3 --- /dev/null +++ b/sig/x_twitter_scraper/models/webhook_resume_response.rbs @@ -0,0 +1,26 @@ +module XTwitterScraper + module Models + type webhook_resume_response = + { status_code: Integer, success: bool, webhook: XTwitterScraper::Webhook } + + class WebhookResumeResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor status_code: Integer + + attr_accessor success: bool + + attr_accessor webhook: XTwitterScraper::Webhook + + def initialize: ( + status_code: Integer, + success: bool, + webhook: XTwitterScraper::Webhook + ) -> void + + def to_hash: -> { + status_code: Integer, + success: bool, + webhook: XTwitterScraper::Webhook + } + end + end +end diff --git a/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbs b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbs new file mode 100644 index 0000000..07e63e6 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_params.rbs @@ -0,0 +1,30 @@ +module XTwitterScraper + module Models + module X + type account_connection_challenge_submit_params = + { id: String, email_code: String } + & XTwitterScraper::Internal::Type::request_parameters + + class AccountConnectionChallengeSubmitParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_accessor email_code: String + + def initialize: ( + id: String, + email_code: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + email_code: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs new file mode 100644 index 0000000..bab9d98 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs @@ -0,0 +1,68 @@ +module XTwitterScraper + module Models + module X + type account_connection_challenge_submit_response = + { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, + status: String, + x_user_id: String, + x_username: String + } + + class AccountConnectionChallengeSubmitResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health + + attr_accessor status: String + + attr_accessor x_user_id: String + + attr_accessor x_username: String + + def initialize: ( + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, + status: String, + x_user_id: String, + x_username: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, + status: String, + x_user_id: String, + x_username: String + } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue + + def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health] + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/account_create_params.rbs b/sig/x_twitter_scraper/models/x/account_create_params.rbs index 87ef317..7a381b1 100644 --- a/sig/x_twitter_scraper/models/x/account_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/account_create_params.rbs @@ -6,7 +6,6 @@ module XTwitterScraper email: String, password: String, username: String, - proxy_country: String, totp_secret: String } & XTwitterScraper::Internal::Type::request_parameters @@ -21,10 +20,6 @@ module XTwitterScraper attr_accessor username: String - attr_reader proxy_country: String? - - def proxy_country=: (String) -> String - attr_reader totp_secret: String? def totp_secret=: (String) -> String @@ -33,7 +28,6 @@ module XTwitterScraper email: String, password: String, username: String, - ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -42,7 +36,6 @@ module XTwitterScraper email: String, password: String, username: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/account_create_response.rbs b/sig/x_twitter_scraper/models/x/account_create_response.rbs index b176f72..d1b3798 100644 --- a/sig/x_twitter_scraper/models/x/account_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_create_response.rbs @@ -8,8 +8,7 @@ module XTwitterScraper health: XTwitterScraper::Models::X::AccountCreateResponse::health, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel @@ -25,18 +24,13 @@ module XTwitterScraper attr_accessor x_username: String - attr_reader login_country: String? - - def login_country=: (String) -> String - def initialize: ( id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountCreateResponse::health, status: String, x_user_id: String, - x_username: String, - ?login_country: String + x_username: String ) -> void def to_hash: -> { @@ -45,8 +39,7 @@ module XTwitterScraper health: XTwitterScraper::Models::X::AccountCreateResponse::health, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } type health = diff --git a/sig/x_twitter_scraper/models/x/account_reauth_params.rbs b/sig/x_twitter_scraper/models/x/account_reauth_params.rbs index 547f6c4..3eb6da4 100644 --- a/sig/x_twitter_scraper/models/x/account_reauth_params.rbs +++ b/sig/x_twitter_scraper/models/x/account_reauth_params.rbs @@ -2,13 +2,7 @@ module XTwitterScraper module Models module X type account_reauth_params = - { - id: String, - password: String, - email: String, - proxy_country: String, - totp_secret: String - } + { id: String, password: String, email: String, totp_secret: String } & XTwitterScraper::Internal::Type::request_parameters class AccountReauthParams < XTwitterScraper::Internal::Type::BaseModel @@ -23,10 +17,6 @@ module XTwitterScraper def email=: (String) -> String - attr_reader proxy_country: String? - - def proxy_country=: (String) -> String - attr_reader totp_secret: String? def totp_secret=: (String) -> String @@ -35,7 +25,6 @@ module XTwitterScraper id: String, password: String, ?email: String, - ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -44,7 +33,6 @@ module XTwitterScraper id: String, password: String, email: String, - proxy_country: String, totp_secret: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs index 1da44f3..6c1d06f 100644 --- a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs @@ -8,8 +8,7 @@ module XTwitterScraper health: XTwitterScraper::Models::X::AccountReauthResponse::health, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel @@ -25,18 +24,13 @@ module XTwitterScraper attr_accessor x_username: String - attr_reader login_country: String? - - def login_country=: (String) -> String - def initialize: ( id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::health, status: String, x_user_id: String, - x_username: String, - ?login_country: String + x_username: String ) -> void def to_hash: -> { @@ -45,8 +39,7 @@ module XTwitterScraper health: XTwitterScraper::Models::X::AccountReauthResponse::health, status: String, x_user_id: String, - x_username: String, - login_country: String + x_username: String } type health = 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 new file mode 100644 index 0000000..e81339c --- /dev/null +++ b/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs @@ -0,0 +1,17 @@ +module XTwitterScraper + module Models + module X + module Communities + type join_create_response = { success: true } + + class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor success: true + + def initialize: (?success: true) -> void + + def to_hash: -> { 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 new file mode 100644 index 0000000..b92d6b9 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs @@ -0,0 +1,17 @@ +module XTwitterScraper + module Models + module X + module Communities + type join_delete_all_response = { success: true } + + class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor success: true + + def initialize: (?success: true) -> void + + def to_hash: -> { 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 index 5bab1eb..c83d693 100644 --- 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 @@ -3,7 +3,7 @@ module XTwitterScraper module X module Communities type tweet_list_by_community_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel @@ -16,15 +16,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/communities/tweet_list_params.rbs b/sig/x_twitter_scraper/models/x/communities/tweet_list_params.rbs index 0d6de89..adc609e 100644 --- a/sig/x_twitter_scraper/models/x/communities/tweet_list_params.rbs +++ b/sig/x_twitter_scraper/models/x/communities/tweet_list_params.rbs @@ -3,36 +3,65 @@ module XTwitterScraper module X module Communities type tweet_list_params = - { q: String, cursor: String, query_type: String } + { + community_id: String, + q: String, + cursor: String, + page_size: Integer, + query_type: XTwitterScraper::Models::X::Communities::TweetListParams::query_type + } & XTwitterScraper::Internal::Type::request_parameters class TweetListParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + attr_accessor community_id: String + attr_accessor q: String attr_reader cursor: String? def cursor=: (String) -> String - attr_reader query_type: String? + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer - def query_type=: (String) -> String + attr_reader query_type: XTwitterScraper::Models::X::Communities::TweetListParams::query_type? + + def query_type=: ( + XTwitterScraper::Models::X::Communities::TweetListParams::query_type + ) -> XTwitterScraper::Models::X::Communities::TweetListParams::query_type def initialize: ( + community_id: String, q: String, ?cursor: String, - ?query_type: String, + ?page_size: Integer, + ?query_type: XTwitterScraper::Models::X::Communities::TweetListParams::query_type, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: XTwitterScraper::Models::X::Communities::TweetListParams::query_type, request_options: XTwitterScraper::RequestOptions } + + type query_type = :Latest | :Top + + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + LATEST: :Latest + TOP: :Top + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::TweetListParams::query_type] + end end end end diff --git a/sig/x_twitter_scraper/models/x/community_action_result.rbs b/sig/x_twitter_scraper/models/x/community_action_result.rbs deleted file mode 100644 index 15a5424..0000000 --- a/sig/x_twitter_scraper/models/x/community_action_result.rbs +++ /dev/null @@ -1,28 +0,0 @@ -module XTwitterScraper - module Models - module X - type community_action_result = - { community_id: String, community_name: String, success: true } - - class CommunityActionResult < 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 diff --git a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs index 9ca0665..bd1095a 100644 --- a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +++ b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs @@ -22,12 +22,17 @@ module XTwitterScraper id: String, banner_url: String, created_at: String, + creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, + invites_policy: String, + is_member: bool, + is_nsfw: bool, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + role: String, rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } @@ -42,10 +47,28 @@ module XTwitterScraper def created_at=: (String) -> String + attr_reader creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator? + + def creator=: ( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator + ) -> XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator + attr_reader description: String? def description=: (String) -> String + attr_reader invites_policy: String? + + def invites_policy=: (String) -> String + + attr_reader is_member: bool? + + def is_member=: (bool) -> bool + + attr_reader is_nsfw: bool? + + def is_nsfw=: (bool) -> bool + attr_reader join_policy: String? def join_policy=: (String) -> String @@ -68,6 +91,10 @@ module XTwitterScraper XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic ) -> XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic + attr_reader role: String? + + def role=: (String) -> String + attr_reader rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]? def rules=: ( @@ -78,12 +105,17 @@ module XTwitterScraper id: String, ?banner_url: String, ?created_at: String, + ?creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, ?description: String, + ?invites_policy: String, + ?is_member: bool, + ?is_nsfw: bool, ?join_policy: String, ?member_count: Integer, ?moderator_count: Integer, ?name: String, ?primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + ?role: String, ?rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] ) -> void @@ -91,15 +123,49 @@ module XTwitterScraper id: String, banner_url: String, created_at: String, + creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, + invites_policy: String, + is_member: bool, + is_nsfw: bool, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + role: String, rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } + type creator = + { id: String, username: String, verified: bool, name: String } + + class Creator < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + attr_accessor verified: bool + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + id: String, + username: String, + verified: bool, + ?name: String + ) -> void + + def to_hash: -> { + id: String, + username: String, + verified: bool, + name: String + } + end + type primary_topic = { id: String, name: String } class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel diff --git a/sig/x_twitter_scraper/models/x/community_retrieve_search_params.rbs b/sig/x_twitter_scraper/models/x/community_retrieve_search_params.rbs index e75c7e6..55dd357 100644 --- a/sig/x_twitter_scraper/models/x/community_retrieve_search_params.rbs +++ b/sig/x_twitter_scraper/models/x/community_retrieve_search_params.rbs @@ -2,36 +2,65 @@ module XTwitterScraper module Models module X type community_retrieve_search_params = - { q: String, cursor: String, query_type: String } + { + community_id: String, + q: String, + cursor: String, + page_size: Integer, + query_type: XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type + } & XTwitterScraper::Internal::Type::request_parameters class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + attr_accessor community_id: String + attr_accessor q: String attr_reader cursor: String? def cursor=: (String) -> String - attr_reader query_type: String? + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer - def query_type=: (String) -> String + attr_reader query_type: XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type? + + def query_type=: ( + XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type + ) -> XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type def initialize: ( + community_id: String, q: String, ?cursor: String, - ?query_type: String, + ?page_size: Integer, + ?query_type: XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { + community_id: String, q: String, cursor: String, - query_type: String, + page_size: Integer, + query_type: XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type, request_options: XTwitterScraper::RequestOptions } + + type query_type = :Latest | :Top + + module QueryType + extend XTwitterScraper::Internal::Type::Enum + + LATEST: :Latest + TOP: :Top + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type] + end end end end diff --git a/sig/x_twitter_scraper/models/x/dm_retrieve_history_params.rbs b/sig/x_twitter_scraper/models/x/dm_retrieve_history_params.rbs index 43250cf..096ac63 100644 --- a/sig/x_twitter_scraper/models/x/dm_retrieve_history_params.rbs +++ b/sig/x_twitter_scraper/models/x/dm_retrieve_history_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type dm_retrieve_history_params = - { user_id: String, cursor: String, max_id: String } + { user_id: String, account: String, cursor: String, max_id: String } & XTwitterScraper::Internal::Type::request_parameters class DmRetrieveHistoryParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,6 +11,8 @@ module XTwitterScraper attr_accessor user_id: String + attr_accessor account: String + attr_reader cursor: String? def cursor=: (String) -> String @@ -21,6 +23,7 @@ module XTwitterScraper def initialize: ( user_id: String, + account: String, ?cursor: String, ?max_id: String, ?request_options: XTwitterScraper::request_opts @@ -28,6 +31,7 @@ module XTwitterScraper def to_hash: -> { user_id: String, + account: String, cursor: String, max_id: String, request_options: XTwitterScraper::RequestOptions diff --git a/sig/x_twitter_scraper/models/x/dm_retrieve_history_response.rbs b/sig/x_twitter_scraper/models/x/dm_retrieve_history_response.rbs index 30edbb4..e0dfba9 100644 --- a/sig/x_twitter_scraper/models/x/dm_retrieve_history_response.rbs +++ b/sig/x_twitter_scraper/models/x/dm_retrieve_history_response.rbs @@ -30,26 +30,27 @@ module XTwitterScraper type message = { id: String, - created_at: String, receiver_id: String, sender_id: String, + created_at: String, + media_url: String, text: String } class Message < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String - attr_reader created_at: String? + attr_accessor receiver_id: String - def created_at=: (String) -> String + attr_accessor sender_id: String - attr_reader receiver_id: String? + attr_reader created_at: String? - def receiver_id=: (String) -> String + def created_at=: (String) -> String - attr_reader sender_id: String? + attr_reader media_url: String? - def sender_id=: (String) -> String + def media_url=: (String) -> String attr_reader text: String? @@ -57,17 +58,19 @@ module XTwitterScraper def initialize: ( id: String, + receiver_id: String, + sender_id: String, ?created_at: String, - ?receiver_id: String, - ?sender_id: String, + ?media_url: String, ?text: String ) -> void def to_hash: -> { id: String, - created_at: String, receiver_id: String, sender_id: String, + created_at: String, + media_url: String, text: String } end diff --git a/sig/x_twitter_scraper/models/x/dm_send_params.rbs b/sig/x_twitter_scraper/models/x/dm_send_params.rbs index 2c75494..14d2cf0 100644 --- a/sig/x_twitter_scraper/models/x/dm_send_params.rbs +++ b/sig/x_twitter_scraper/models/x/dm_send_params.rbs @@ -6,8 +6,7 @@ module XTwitterScraper user_id: String, account: String, text: String, - media_ids: ::Array[String], - reply_to_message_id: String + media_ids: ::Array[String] } & XTwitterScraper::Internal::Type::request_parameters @@ -25,16 +24,11 @@ module XTwitterScraper def media_ids=: (::Array[String]) -> ::Array[String] - attr_reader reply_to_message_id: String? - - def reply_to_message_id=: (String) -> String - def initialize: ( user_id: String, account: String, text: String, ?media_ids: ::Array[String], - ?reply_to_message_id: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -43,7 +37,6 @@ module XTwitterScraper account: String, text: String, media_ids: ::Array[String], - reply_to_message_id: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/list_retrieve_followers_params.rbs b/sig/x_twitter_scraper/models/x/list_retrieve_followers_params.rbs index bd31f3e..4ee9acd 100644 --- a/sig/x_twitter_scraper/models/x/list_retrieve_followers_params.rbs +++ b/sig/x_twitter_scraper/models/x/list_retrieve_followers_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type list_retrieve_followers_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class ListRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbs b/sig/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbs index 6827301..aa4ac86 100644 --- a/sig/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbs +++ b/sig/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbs @@ -6,6 +6,7 @@ module XTwitterScraper id: String, cursor: String, include_replies: bool, + page_size: Integer, since_time: String, until_time: String } @@ -25,6 +26,10 @@ module XTwitterScraper def include_replies=: (bool) -> bool + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + attr_reader since_time: String? def since_time=: (String) -> String @@ -37,6 +42,7 @@ module XTwitterScraper id: String, ?cursor: String, ?include_replies: bool, + ?page_size: Integer, ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts @@ -46,6 +52,7 @@ module XTwitterScraper id: String, cursor: String, include_replies: bool, + page_size: Integer, since_time: String, until_time: String, request_options: XTwitterScraper::RequestOptions diff --git a/sig/x_twitter_scraper/models/x/media_download_params.rbs b/sig/x_twitter_scraper/models/x/media_download_params.rbs index f303c11..d08cef0 100644 --- a/sig/x_twitter_scraper/models/x/media_download_params.rbs +++ b/sig/x_twitter_scraper/models/x/media_download_params.rbs @@ -2,13 +2,22 @@ module XTwitterScraper module Models module X type media_download_params = - { tweet_ids: ::Array[String], tweet_input: String } + { + tweet_id: String, + tweet_ids: ::Array[String], + tweet_input: String, + tweet_url: String + } & XTwitterScraper::Internal::Type::request_parameters class MediaDownloadParams < XTwitterScraper::Internal::Type::BaseModel extend XTwitterScraper::Internal::Type::RequestParameters::Converter include XTwitterScraper::Internal::Type::RequestParameters + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + attr_reader tweet_ids: ::Array[String]? def tweet_ids=: (::Array[String]) -> ::Array[String] @@ -17,15 +26,23 @@ module XTwitterScraper def tweet_input=: (String) -> String + attr_reader tweet_url: String? + + def tweet_url=: (String) -> String + def initialize: ( + ?tweet_id: String, ?tweet_ids: ::Array[String], ?tweet_input: String, + ?tweet_url: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { + tweet_id: String, tweet_ids: ::Array[String], tweet_input: String, + tweet_url: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/media_upload_params.rbs b/sig/x_twitter_scraper/models/x/media_upload_params.rbs index 333078e..098d015 100644 --- a/sig/x_twitter_scraper/models/x/media_upload_params.rbs +++ b/sig/x_twitter_scraper/models/x/media_upload_params.rbs @@ -2,11 +2,7 @@ module XTwitterScraper module Models module X type media_upload_params = - { - account: String, - file: XTwitterScraper::Internal::file_input, - is_long_video: bool - } + { account: String, url: String } & XTwitterScraper::Internal::Type::request_parameters class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,23 +11,17 @@ module XTwitterScraper attr_accessor account: String - attr_accessor file: XTwitterScraper::Internal::file_input - - attr_reader is_long_video: bool? - - def is_long_video=: (bool) -> bool + attr_accessor url: String def initialize: ( account: String, - file: XTwitterScraper::Internal::file_input, - ?is_long_video: bool, + url: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, - file: XTwitterScraper::Internal::file_input, - is_long_video: bool, + url: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/media_upload_response.rbs b/sig/x_twitter_scraper/models/x/media_upload_response.rbs index 004739c..c552259 100644 --- a/sig/x_twitter_scraper/models/x/media_upload_response.rbs +++ b/sig/x_twitter_scraper/models/x/media_upload_response.rbs @@ -1,16 +1,23 @@ module XTwitterScraper module Models module X - type media_upload_response = { media_id: String, success: true } + type media_upload_response = + { media_id: String, media_url: String, success: true } class MediaUploadResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor media_id: String + attr_accessor media_url: String + attr_accessor success: true - def initialize: (media_id: String, ?success: true) -> void + def initialize: ( + media_id: String, + media_url: String, + ?success: true + ) -> void - def to_hash: -> { media_id: String, success: true } + def to_hash: -> { media_id: String, media_url: String, success: true } end end end diff --git a/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs b/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs index c593dba..63af1bb 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type profile_update_avatar_params = - { account: String, file: XTwitterScraper::Internal::file_input } + { account: String, url: String } & XTwitterScraper::Internal::Type::request_parameters class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,17 +11,17 @@ module XTwitterScraper attr_accessor account: String - attr_accessor file: XTwitterScraper::Internal::file_input + attr_accessor url: String def initialize: ( account: String, - file: XTwitterScraper::Internal::file_input, + url: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, - file: XTwitterScraper::Internal::file_input, + url: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs b/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs index 4f7e7f1..98caabd 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type profile_update_banner_params = - { account: String, file: XTwitterScraper::Internal::file_input } + { account: String, url: String } & XTwitterScraper::Internal::Type::request_parameters class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,17 +11,17 @@ module XTwitterScraper attr_accessor account: String - attr_accessor file: XTwitterScraper::Internal::file_input + attr_accessor url: String def initialize: ( account: String, - file: XTwitterScraper::Internal::file_input, + url: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, - file: XTwitterScraper::Internal::file_input, + url: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_author.rbs b/sig/x_twitter_scraper/models/x/tweet_author.rbs index 2d33c16..f8316db 100644 --- a/sig/x_twitter_scraper/models/x/tweet_author.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_author.rbs @@ -1,43 +1,20 @@ module XTwitterScraper module Models module X - type tweet_author = - { - id: String, - followers: Integer, - username: String, - verified: bool, - profile_picture: String - } + type tweet_author = { followers: Integer, verified: bool } - class TweetAuthor < XTwitterScraper::Internal::Type::BaseModel - attr_accessor id: String + class TweetAuthor < XTwitterScraper::Models::UserProfile + def followers: -> Integer - attr_accessor followers: Integer + def followers=: (Integer _) -> Integer - attr_accessor username: String + def verified: -> bool - attr_accessor verified: bool + def verified=: (bool _) -> bool - attr_reader profile_picture: String? + def initialize: (followers: Integer, verified: bool) -> void - 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 - } + def to_hash: -> { followers: Integer, verified: bool } end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_create_response.rbs b/sig/x_twitter_scraper/models/x/tweet_create_response.rbs index 3f9e9f1..5e38d24 100644 --- a/sig/x_twitter_scraper/models/x/tweet_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_create_response.rbs @@ -1,16 +1,43 @@ module XTwitterScraper module Models module X - type tweet_create_response = { success: true, tweet_id: String } + type tweet_create_response = + { + charged: bool, + charged_credits: String, + success: true, + tweet_id: String, + write_action_id: String + } class TweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + attr_accessor success: true attr_accessor tweet_id: String - def initialize: (tweet_id: String, ?success: true) -> void + attr_reader write_action_id: String? + + def write_action_id=: (String) -> String + + def initialize: ( + charged: bool, + charged_credits: String, + tweet_id: String, + ?write_action_id: String, + ?success: true + ) -> void - def to_hash: -> { success: true, tweet_id: String } + def to_hash: -> { + charged: bool, + charged_credits: String, + success: true, + tweet_id: String, + write_action_id: String + } end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_detail.rbs b/sig/x_twitter_scraper/models/x/tweet_detail.rbs index 88ce009..20d5799 100644 --- a/sig/x_twitter_scraper/models/x/tweet_detail.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_detail.rbs @@ -11,15 +11,26 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + author: XTwitterScraper::X::TweetAuthor, + content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, + display_text_range: ::Array[Integer], entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, is_note_tweet: bool, is_quote_status: bool, is_reply: bool, - media: ::Array[XTwitterScraper::X::TweetDetail::Media], - quoted_tweet: ::Hash[Symbol, top], - source: String + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: String } class TweetDetail < XTwitterScraper::Internal::Type::BaseModel @@ -39,6 +50,18 @@ module XTwitterScraper attr_accessor view_count: Integer + attr_reader author: XTwitterScraper::X::TweetAuthor? + + def author=: ( + XTwitterScraper::X::TweetAuthor + ) -> XTwitterScraper::X::TweetAuthor + + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? + + def content_disclosure=: ( + XTwitterScraper::ContentDisclosure + ) -> XTwitterScraper::ContentDisclosure + attr_reader conversation_id: String? def conversation_id=: (String) -> String @@ -47,10 +70,30 @@ module XTwitterScraper def created_at=: (String) -> String + attr_reader display_text_range: ::Array[Integer]? + + def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + attr_reader entities: ::Hash[Symbol, top]? def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + attr_reader in_reply_to_id: String? + + def in_reply_to_id=: (String) -> String + + attr_reader in_reply_to_user_id: String? + + def in_reply_to_user_id=: (String) -> String + + attr_reader in_reply_to_username: String? + + def in_reply_to_username=: (String) -> String + + attr_reader is_limited_reply: bool? + + def is_limited_reply=: (bool) -> bool + attr_reader is_note_tweet: bool? def is_note_tweet=: (bool) -> bool @@ -63,20 +106,40 @@ module XTwitterScraper def is_reply=: (bool) -> bool - attr_reader media: ::Array[XTwitterScraper::X::TweetDetail::Media]? + attr_reader lang: String? + + def lang=: (String) -> String + + attr_reader media: ::Array[XTwitterScraper::TweetMedia]? def media=: ( - ::Array[XTwitterScraper::X::TweetDetail::Media] - ) -> ::Array[XTwitterScraper::X::TweetDetail::Media] + ::Array[XTwitterScraper::TweetMedia] + ) -> ::Array[XTwitterScraper::TweetMedia] + + attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? + + def quoted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet - attr_reader quoted_tweet: ::Hash[Symbol, top]? + attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? - def quoted_tweet=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + def retweeted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet attr_reader source: String? def source=: (String) -> String + attr_reader type: String? + + def type=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + def initialize: ( id: String, bookmark_count: Integer, @@ -86,15 +149,26 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + ?author: XTwitterScraper::X::TweetAuthor, + ?content_disclosure: XTwitterScraper::ContentDisclosure, ?conversation_id: String, ?created_at: String, + ?display_text_range: ::Array[Integer], ?entities: ::Hash[Symbol, top], + ?in_reply_to_id: String, + ?in_reply_to_user_id: String, + ?in_reply_to_username: String, + ?is_limited_reply: bool, ?is_note_tweet: bool, ?is_quote_status: bool, ?is_reply: bool, - ?media: ::Array[XTwitterScraper::X::TweetDetail::Media], - ?quoted_tweet: ::Hash[Symbol, top], - ?source: String + ?lang: String, + ?media: ::Array[XTwitterScraper::TweetMedia], + ?quoted_tweet: XTwitterScraper::EmbeddedTweet, + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, + ?source: String, + ?type: String, + ?url: String ) -> void def to_hash: -> { @@ -106,63 +180,27 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + author: XTwitterScraper::X::TweetAuthor, + content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, + display_text_range: ::Array[Integer], entities: ::Hash[Symbol, top], + in_reply_to_id: String, + in_reply_to_user_id: String, + in_reply_to_username: String, + is_limited_reply: bool, is_note_tweet: bool, is_quote_status: bool, is_reply: bool, - media: ::Array[XTwitterScraper::X::TweetDetail::Media], - quoted_tweet: ::Hash[Symbol, top], - source: String + lang: String, + media: ::Array[XTwitterScraper::TweetMedia], + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, + source: String, + type: String, + url: 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_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbs index c3ae01b..43e1d00 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_favoriters_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type tweet_get_favoriters_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class TweetGetFavoritersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_quotes_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_quotes_params.rbs index 35a79b4..e778d9b 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_quotes_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_quotes_params.rbs @@ -4,10 +4,36 @@ module XTwitterScraper type tweet_get_quotes_params = { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_replies: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::TweetGetQuotesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetQuotesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetQuotesParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetQuotesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, - until_time: String + to_user: String, + until_date: Date, + until_time: String, + url: String, + verified_only: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -17,39 +43,254 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + attr_reader include_replies: bool? def include_replies=: (bool) -> bool + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::TweetGetQuotesParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::TweetGetQuotesParams::media_type + ) -> XTwitterScraper::Models::X::TweetGetQuotesParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::TweetGetQuotesParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::TweetGetQuotesParams::quotes + ) -> XTwitterScraper::Models::X::TweetGetQuotesParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::TweetGetQuotesParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::TweetGetQuotesParams::replies + ) -> XTwitterScraper::Models::X::TweetGetQuotesParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::TweetGetQuotesParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::TweetGetQuotesParams::retweets + ) -> XTwitterScraper::Models::X::TweetGetQuotesParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader since_time: String? def since_time=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + attr_reader until_time: String? def until_time=: (String) -> String + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, ?include_replies: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::TweetGetQuotesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetQuotesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetQuotesParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetQuotesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_replies: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::TweetGetQuotesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetQuotesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetQuotesParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetQuotesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetQuotesParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetQuotesParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetQuotesParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetQuotesParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs index 91c19cd..b159782 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs @@ -2,7 +2,38 @@ module XTwitterScraper module Models module X type tweet_get_replies_params = - { id: String, cursor: String, since_time: String, until_time: String } + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetRepliesParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetRepliesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + since_time: String, + to_user: String, + until_date: Date, + until_time: String, + url: String, + verified_only: bool + } & XTwitterScraper::Internal::Type::request_parameters class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,33 +42,248 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::TweetGetRepliesParams::media_type + ) -> XTwitterScraper::Models::X::TweetGetRepliesParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::TweetGetRepliesParams::quotes + ) -> XTwitterScraper::Models::X::TweetGetRepliesParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::TweetGetRepliesParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::TweetGetRepliesParams::replies + ) -> XTwitterScraper::Models::X::TweetGetRepliesParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::TweetGetRepliesParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::TweetGetRepliesParams::retweets + ) -> XTwitterScraper::Models::X::TweetGetRepliesParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader since_time: String? def since_time=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + attr_reader until_time: String? def until_time=: (String) -> String + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetRepliesParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetRepliesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetRepliesParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetRepliesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbs index 8a0e795..39d23af 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_retweeters_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type tweet_get_retweeters_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class TweetGetRetweetersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs index 5aae6ed..4605e4f 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type tweet_get_thread_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_search_params.rbs b/sig/x_twitter_scraper/models/x/tweet_search_params.rbs index 1c6b2dd..5a7c189 100644 --- a/sig/x_twitter_scraper/models/x/tweet_search_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_search_params.rbs @@ -4,11 +4,42 @@ module XTwitterScraper type tweet_search_params = { q: String, + advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, limit: Integer, + list_id: String, + media_type: XTwitterScraper::Models::X::TweetSearchParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, query_type: XTwitterScraper::Models::X::TweetSearchParams::query_type, + quotes: XTwitterScraper::Models::X::TweetSearchParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetSearchParams::replies, + retweets: XTwitterScraper::Models::X::TweetSearchParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, - until_time: String + to_user: String, + until_date: Date, + until_time: String, + url: String, + verified_only: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -18,48 +49,257 @@ module XTwitterScraper attr_accessor q: String + attr_reader advanced_query: String? + + def advanced_query=: (String) -> String + + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader bounding_box: String? + + def bounding_box=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + attr_reader limit: Integer? def limit=: (Integer) -> Integer + attr_reader list_id: String? + + def list_id=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::TweetSearchParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::TweetSearchParams::media_type + ) -> XTwitterScraper::Models::X::TweetSearchParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader place: String? + + def place=: (String) -> String + + attr_reader place_country: String? + + def place_country=: (String) -> String + + attr_reader point_radius: String? + + def point_radius=: (String) -> String + attr_reader query_type: XTwitterScraper::Models::X::TweetSearchParams::query_type? def query_type=: ( XTwitterScraper::Models::X::TweetSearchParams::query_type ) -> XTwitterScraper::Models::X::TweetSearchParams::query_type + attr_reader quotes: XTwitterScraper::Models::X::TweetSearchParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::TweetSearchParams::quotes + ) -> XTwitterScraper::Models::X::TweetSearchParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::TweetSearchParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::TweetSearchParams::replies + ) -> XTwitterScraper::Models::X::TweetSearchParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::TweetSearchParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::TweetSearchParams::retweets + ) -> XTwitterScraper::Models::X::TweetSearchParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader since_time: String? def since_time=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + attr_reader until_time: String? def until_time=: (String) -> String + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( q: String, + ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, ?limit: Integer, + ?list_id: String, + ?media_type: XTwitterScraper::Models::X::TweetSearchParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, ?query_type: XTwitterScraper::Models::X::TweetSearchParams::query_type, + ?quotes: XTwitterScraper::Models::X::TweetSearchParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetSearchParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetSearchParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { q: String, + advanced_query: String, + any_words: String, + bounding_box: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, limit: Integer, + list_id: String, + media_type: XTwitterScraper::Models::X::TweetSearchParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + place: String, + place_country: String, + point_radius: String, query_type: XTwitterScraper::Models::X::TweetSearchParams::query_type, + quotes: XTwitterScraper::Models::X::TweetSearchParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetSearchParams::replies, + retweets: XTwitterScraper::Models::X::TweetSearchParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetSearchParams::media_type] + end + type query_type = :Latest | :Top module QueryType @@ -70,6 +310,42 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetSearchParams::query_type] end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetSearchParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetSearchParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetSearchParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs b/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs new file mode 100644 index 0000000..e8ccc5d --- /dev/null +++ b/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs @@ -0,0 +1,30 @@ +module XTwitterScraper + module Models + module X + type user_remove_follower_params = + { id: String, account: String } + & XTwitterScraper::Internal::Type::request_parameters + + class UserRemoveFollowerParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_accessor account: String + + def initialize: ( + id: String, + account: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + account: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs b/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs new file mode 100644 index 0000000..13fe45b --- /dev/null +++ b/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs @@ -0,0 +1,15 @@ +module XTwitterScraper + module Models + module X + type user_remove_follower_response = { success: true } + + class UserRemoveFollowerResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor success: true + + def initialize: (?success: true) -> void + + def to_hash: -> { success: true } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_batch_response.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_batch_response.rbs new file mode 100644 index 0000000..4ce3101 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/user_retrieve_batch_response.rbs @@ -0,0 +1,57 @@ +module XTwitterScraper + module Models + module X + type user_retrieve_batch_response = + { + has_next_page: false, + next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: ::Array[String], + unprocessed_ids: ::Array[String], + users: ::Array[XTwitterScraper::UserProfile] + } + + class UserRetrieveBatchResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor has_next_page: false + + attr_accessor next_cursor: String + + attr_accessor processed_count: Integer + + attr_accessor requested_count: Integer + + attr_accessor returned_count: Integer + + attr_accessor unavailable_ids: ::Array[String] + + attr_accessor unprocessed_ids: ::Array[String] + + attr_accessor users: ::Array[XTwitterScraper::UserProfile] + + def initialize: ( + next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: ::Array[String], + unprocessed_ids: ::Array[String], + users: ::Array[XTwitterScraper::UserProfile], + ?has_next_page: false + ) -> void + + def to_hash: -> { + has_next_page: false, + next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: ::Array[String], + unprocessed_ids: ::Array[String], + users: ::Array[XTwitterScraper::UserProfile] + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_followers_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_followers_params.rbs index 948aaba..b2b5a0c 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_followers_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_followers_params.rbs @@ -2,7 +2,13 @@ module XTwitterScraper module Models module X type user_retrieve_followers_params = - { id: String, cursor: String, page_size: Integer } + { + id: String, + after: String, + cursor: String, + limit: Integer, + page_size: Integer + } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveFollowersParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,24 +17,36 @@ module XTwitterScraper attr_accessor id: String + attr_reader after: String? + + def after=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + attr_reader page_size: Integer? def page_size=: (Integer) -> Integer def initialize: ( id: String, + ?after: String, ?cursor: String, + ?limit: Integer, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbs index ebc4f19..9b9b492 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_followers_you_know_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type user_retrieve_followers_you_know_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveFollowersYouKnowParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_following_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_following_params.rbs index d31ca4a..7579c85 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_following_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_following_params.rbs @@ -2,7 +2,13 @@ module XTwitterScraper module Models module X type user_retrieve_following_params = - { id: String, cursor: String, page_size: Integer } + { + id: String, + after: String, + cursor: String, + limit: Integer, + page_size: Integer + } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,24 +17,36 @@ module XTwitterScraper attr_accessor id: String + attr_reader after: String? + + def after=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + attr_reader page_size: Integer? def page_size=: (Integer) -> Integer def initialize: ( id: String, + ?after: String, ?cursor: String, + ?limit: Integer, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + after: String, cursor: String, + limit: Integer, page_size: Integer, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_likes_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_likes_params.rbs index 72d8868..af15c59 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_likes_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_likes_params.rbs @@ -2,7 +2,36 @@ module XTwitterScraper module Models module X type user_retrieve_likes_params = - { id: String, cursor: String } + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveLikesParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool + } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,21 +40,236 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type + ) -> XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes + ) -> XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::UserRetrieveLikesParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::UserRetrieveLikesParams::replies + ) -> XTwitterScraper::Models::X::UserRetrieveLikesParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets + ) -> XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveLikesParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveLikesParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveLikesParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_media_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_media_params.rbs index 8547c61..1aca812 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_media_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_media_params.rbs @@ -2,7 +2,36 @@ module XTwitterScraper module Models module X type user_retrieve_media_params = - { id: String, cursor: String } + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveMediaParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool + } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,21 +40,236 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type + ) -> XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes + ) -> XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::UserRetrieveMediaParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::UserRetrieveMediaParams::replies + ) -> XTwitterScraper::Models::X::UserRetrieveMediaParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets + ) -> XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveMediaParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveMediaParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMediaParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbs index ebbbdcc..83a1eb0 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbs @@ -2,7 +2,38 @@ module XTwitterScraper module Models module X type user_retrieve_mentions_params = - { id: String, cursor: String, since_time: String, until_time: String } + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + since_time: String, + to_user: String, + until_date: Date, + until_time: String, + url: String, + verified_only: bool + } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel @@ -11,33 +42,248 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type + ) -> XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes + ) -> XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies + ) -> XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets + ) -> XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + attr_reader since_time: String? def since_time=: (String) -> String + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + attr_reader until_time: String? def until_time=: (String) -> String + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, since_time: String, + to_user: String, + until_date: Date, until_time: String, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_replies_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_replies_params.rbs new file mode 100644 index 0000000..8b8df26 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/user_retrieve_replies_params.rbs @@ -0,0 +1,283 @@ +module XTwitterScraper + module Models + module X + type user_retrieve_replies_params = + { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + include_parent_tweet: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool + } + & XTwitterScraper::Internal::Type::request_parameters + + class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader include_parent_tweet: bool? + + def include_parent_tweet=: (bool) -> bool + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type + ) -> XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes + ) -> XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies + ) -> XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets + ) -> XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + + def initialize: ( + id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, + ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?include_parent_tweet: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + any_words: String, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + include_parent_tweet: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, + request_options: XTwitterScraper::RequestOptions + } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets] + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbs index 10e761f..82b3574 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbs @@ -4,9 +4,35 @@ module XTwitterScraper type user_retrieve_tweets_params = { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_parent_tweet: bool, - include_replies: bool + include_replies: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool } & XTwitterScraper::Internal::Type::request_parameters @@ -16,10 +42,38 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + attr_reader include_parent_tweet: bool? def include_parent_tweet=: (bool) -> bool @@ -28,21 +82,208 @@ module XTwitterScraper def include_replies=: (bool) -> bool + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader media_type: XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type + ) -> XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quotes: XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes + ) -> XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies + ) -> XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets + ) -> XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, ?include_parent_tweet: bool, ?include_replies: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, include_parent_tweet: bool, include_replies: bool, + in_reply_to_tweet_id: String, + language: String, + media_type: XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type, + mentioning: String, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies, + retweets: XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbs b/sig/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbs index a775892..59f80f0 100644 --- a/sig/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_retrieve_verified_followers_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type user_retrieve_verified_followers_params = - { id: String, cursor: String } + { id: String, cursor: String, page_size: Integer } & XTwitterScraper::Internal::Type::request_parameters class UserRetrieveVerifiedFollowersParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,15 +15,21 @@ module XTwitterScraper def cursor=: (String) -> String + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + def initialize: ( id: String, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, cursor: String, + page_size: Integer, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/write_action_retrieve_params.rbs b/sig/x_twitter_scraper/models/x/write_action_retrieve_params.rbs new file mode 100644 index 0000000..c4d5b44 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/write_action_retrieve_params.rbs @@ -0,0 +1,25 @@ +module XTwitterScraper + module Models + module X + type write_action_retrieve_params = + { id: String } & XTwitterScraper::Internal::Type::request_parameters + + class WriteActionRetrieveParams < XTwitterScraper::Internal::Type::BaseModel + extend XTwitterScraper::Internal::Type::RequestParameters::Converter + include XTwitterScraper::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: XTwitterScraper::request_opts + ) -> void + + def to_hash: -> { + id: String, + request_options: XTwitterScraper::RequestOptions + } + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs new file mode 100644 index 0000000..8c521f2 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs @@ -0,0 +1,177 @@ +module XTwitterScraper + module Models + module X + type write_action_retrieve_response = + { + action: String, + charged: bool, + charged_credits: String, + created_at: Time, + media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + retryable: false, + send_dispatched: bool, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + write_action_id: String, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmation_source: String?, + confirmed_at: Time, + message: String, + message_id: String, + send_dispatched_at: Time, + target_id: String?, + tweet_id: String + } + + class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor action: String + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor created_at: Time + + attr_accessor media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media + + attr_accessor retryable: false + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status + + attr_accessor write_action_id: String + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_accessor confirmation_source: String? + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_accessor target_id: String? + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + def initialize: ( + action: String, + charged: bool, + charged_credits: String, + created_at: Time, + media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + send_dispatched: bool, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + write_action_id: String, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmation_source: String?, + ?confirmed_at: Time, + ?message: String, + ?message_id: String, + ?send_dispatched_at: Time, + ?target_id: String?, + ?tweet_id: String, + ?retryable: false + ) -> void + + def to_hash: -> { + action: String, + charged: bool, + charged_credits: String, + created_at: Time, + media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + retryable: false, + send_dispatched: bool, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + write_action_id: String, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmation_source: String?, + confirmed_at: Time, + message: String, + message_id: String, + send_dispatched_at: Time, + target_id: String?, + tweet_id: String + } + + type media = + { + count: Integer, + credits: String, + kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, + total_bytes: String + } + + class Media < XTwitterScraper::Internal::Type::BaseModel + attr_accessor count: Integer + + attr_accessor credits: String + + attr_accessor kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind + + attr_accessor total_bytes: String + + def initialize: ( + count: Integer, + credits: String, + kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, + total_bytes: String + ) -> void + + def to_hash: -> { + count: Integer, + credits: String, + kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, + total_bytes: String + } + + type kind = :none | :image | :video + + module Kind + extend XTwitterScraper::Internal::Type::Enum + + NONE: :none + IMAGE: :image + VIDEO: :video + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind] + end + end + + type status = :success | :failed | :pending_confirmation + + module Status + extend XTwitterScraper::Internal::Type::Enum + + SUCCESS: :success + FAILED: :failed + PENDING_CONFIRMATION: :pending_confirmation + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::status] + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x/x_account.rbs b/sig/x_twitter_scraper/models/x/x_account.rbs index f788760..7f28b5c 100644 --- a/sig/x_twitter_scraper/models/x/x_account.rbs +++ b/sig/x_twitter_scraper/models/x/x_account.rbs @@ -9,8 +9,10 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::XAccount::health, status: String, + updated_at: Time, x_user_id: String, - x_username: String + x_username: String, + cookies_obtained_at: Time } class XAccount < XTwitterScraper::Internal::Type::BaseModel @@ -22,17 +24,25 @@ module XTwitterScraper attr_accessor status: String + attr_accessor updated_at: Time + attr_accessor x_user_id: String attr_accessor x_username: String + attr_reader cookies_obtained_at: Time? + + def cookies_obtained_at=: (Time) -> Time + def initialize: ( id: String, created_at: Time, health: XTwitterScraper::Models::X::XAccount::health, status: String, + updated_at: Time, x_user_id: String, - x_username: String + x_username: String, + ?cookies_obtained_at: Time ) -> void def to_hash: -> { @@ -40,8 +50,10 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::XAccount::health, status: String, + updated_at: Time, x_user_id: String, - x_username: String + x_username: String, + cookies_obtained_at: Time } type health = diff --git a/sig/x_twitter_scraper/models/x/x_account_detail.rbs b/sig/x_twitter_scraper/models/x/x_account_detail.rbs index 298166e..507d9cd 100644 --- a/sig/x_twitter_scraper/models/x/x_account_detail.rbs +++ b/sig/x_twitter_scraper/models/x/x_account_detail.rbs @@ -12,7 +12,6 @@ module XTwitterScraper x_user_id: String, x_username: String, cookies_obtained_at: Time, - proxy_country: String, updated_at: Time } @@ -33,10 +32,6 @@ module XTwitterScraper 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 @@ -49,7 +44,6 @@ module XTwitterScraper x_user_id: String, x_username: String, ?cookies_obtained_at: Time, - ?proxy_country: String, ?updated_at: Time ) -> void @@ -61,7 +55,6 @@ module XTwitterScraper x_user_id: String, x_username: String, cookies_obtained_at: Time, - proxy_country: String, updated_at: Time } 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 7114e4d..6ebf79c 100644 --- a/sig/x_twitter_scraper/models/x_get_article_response.rbs +++ b/sig/x_twitter_scraper/models/x_get_article_response.rbs @@ -3,30 +3,31 @@ module XTwitterScraper type x_get_article_response = { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::X::TweetAuthor + author: XTwitterScraper::Models::XGetArticleResponse::Author } class XGetArticleResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor article: XTwitterScraper::Models::XGetArticleResponse::Article - attr_reader author: XTwitterScraper::X::TweetAuthor? + attr_reader author: XTwitterScraper::Models::XGetArticleResponse::Author? def author=: ( - XTwitterScraper::X::TweetAuthor - ) -> XTwitterScraper::X::TweetAuthor + XTwitterScraper::Models::XGetArticleResponse::Author + ) -> XTwitterScraper::Models::XGetArticleResponse::Author def initialize: ( article: XTwitterScraper::Models::XGetArticleResponse::Article, - ?author: XTwitterScraper::X::TweetAuthor + ?author: XTwitterScraper::Models::XGetArticleResponse::Author ) -> void def to_hash: -> { article: XTwitterScraper::Models::XGetArticleResponse::Article, - author: XTwitterScraper::X::TweetAuthor + author: XTwitterScraper::Models::XGetArticleResponse::Author } type article = { + body_text: String, contents: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content], cover_image_url: String, created_at: String, @@ -39,6 +40,10 @@ module XTwitterScraper } class Article < XTwitterScraper::Internal::Type::BaseModel + attr_reader body_text: String? + + def body_text=: (String) -> String + attr_reader contents: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content]? def contents=: ( @@ -78,6 +83,7 @@ module XTwitterScraper def view_count=: (Integer) -> Integer def initialize: ( + ?body_text: String, ?contents: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content], ?cover_image_url: String, ?created_at: String, @@ -90,6 +96,7 @@ module XTwitterScraper ) -> void def to_hash: -> { + body_text: String, contents: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content], cover_image_url: String, created_at: String, @@ -104,6 +111,8 @@ module XTwitterScraper type content = { height: Integer, + inline_style_ranges: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange], + preview_url: String, text: String, type: String, url: String, @@ -115,6 +124,16 @@ module XTwitterScraper def height=: (Integer) -> Integer + attr_reader inline_style_ranges: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange]? + + def inline_style_ranges=: ( + ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange] + ) -> ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange] + + attr_reader preview_url: String? + + def preview_url=: (String) -> String + attr_reader text: String? def text=: (String) -> String @@ -133,6 +152,8 @@ module XTwitterScraper def initialize: ( ?height: Integer, + ?inline_style_ranges: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange], + ?preview_url: String, ?text: String, ?type: String, ?url: String, @@ -141,13 +162,179 @@ module XTwitterScraper def to_hash: -> { height: Integer, + inline_style_ranges: ::Array[XTwitterScraper::Models::XGetArticleResponse::Article::Content::InlineStyleRange], + preview_url: String, text: String, type: String, url: String, width: Integer } + + type inline_style_range = + { length: Integer, offset: Integer, style: String } + + class InlineStyleRange < XTwitterScraper::Internal::Type::BaseModel + attr_reader length: Integer? + + def length=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + attr_reader style: String? + + def style=: (String) -> String + + def initialize: ( + ?length: Integer, + ?offset: Integer, + ?style: String + ) -> void + + def to_hash: -> { length: Integer, offset: Integer, style: String } + end end end + + type author = + { + id: String, + name: String, + username: String, + can_dm: bool, + created_at: String, + description: String, + favourites_count: Integer, + followers_count: Integer, + following_count: Integer, + is_blue_verified: bool, + is_translator: bool, + is_verified: bool, + location: String, + media_count: Integer, + profile_banner_url: String, + profile_picture: String, + protected: bool, + statuses_count: Integer, + url: String + } + + class Author < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String + + attr_accessor username: String + + attr_reader can_dm: bool? + + def can_dm=: (bool) -> bool + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader favourites_count: Integer? + + def favourites_count=: (Integer) -> Integer + + attr_reader followers_count: Integer? + + def followers_count=: (Integer) -> Integer + + attr_reader following_count: Integer? + + def following_count=: (Integer) -> Integer + + attr_reader is_blue_verified: bool? + + def is_blue_verified=: (bool) -> bool + + attr_reader is_translator: bool? + + def is_translator=: (bool) -> bool + + attr_reader is_verified: bool? + + def is_verified=: (bool) -> bool + + attr_reader location: String? + + def location=: (String) -> String + + attr_reader media_count: Integer? + + def media_count=: (Integer) -> Integer + + attr_reader profile_banner_url: String? + + def profile_banner_url=: (String) -> String + + attr_reader profile_picture: String? + + def profile_picture=: (String) -> String + + attr_reader protected: bool? + + def protected=: (bool) -> bool + + attr_reader statuses_count: Integer? + + def statuses_count=: (Integer) -> Integer + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + id: String, + name: String, + username: String, + ?can_dm: bool, + ?created_at: String, + ?description: String, + ?favourites_count: Integer, + ?followers_count: Integer, + ?following_count: Integer, + ?is_blue_verified: bool, + ?is_translator: bool, + ?is_verified: bool, + ?location: String, + ?media_count: Integer, + ?profile_banner_url: String, + ?profile_picture: String, + ?protected: bool, + ?statuses_count: Integer, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + name: String, + username: String, + can_dm: bool, + created_at: String, + description: String, + favourites_count: Integer, + followers_count: Integer, + following_count: Integer, + is_blue_verified: bool, + is_translator: bool, + is_verified: bool, + location: String, + media_count: Integer, + profile_banner_url: String, + profile_picture: String, + protected: bool, + statuses_count: Integer, + url: String + } + end end end end diff --git a/sig/x_twitter_scraper/resources/api_keys.rbs b/sig/x_twitter_scraper/resources/api_keys.rbs deleted file mode 100644 index aa168a5..0000000 --- a/sig/x_twitter_scraper/resources/api_keys.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module XTwitterScraper - module Resources - class APIKeys - def create: ( - ?name: String, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::APIKeyCreateResponse - - def list: ( - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::APIKeyListResponse - - def revoke: ( - String id, - ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::APIKeyRevokeResponse - - def initialize: (client: XTwitterScraper::Client) -> void - end - end -end diff --git a/sig/x_twitter_scraper/resources/credits.rbs b/sig/x_twitter_scraper/resources/credits.rbs index aad3097..716ff87 100644 --- a/sig/x_twitter_scraper/resources/credits.rbs +++ b/sig/x_twitter_scraper/resources/credits.rbs @@ -1,12 +1,23 @@ module XTwitterScraper module Resources class Credits + def redirect_topup_checkout: ( + session_id: String, + ?request_options: XTwitterScraper::request_opts + ) -> nil + def retrieve_balance: ( ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::CreditRetrieveBalanceResponse + def retrieve_topup_status: ( + session_id: String, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::CreditRetrieveTopupStatusResponse + def topup_balance: ( - amount: Integer, + dollars: Integer, + ?locale: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::CreditTopupBalanceResponse diff --git a/sig/x_twitter_scraper/resources/draws.rbs b/sig/x_twitter_scraper/resources/draws.rbs index 5126958..8231f31 100644 --- a/sig/x_twitter_scraper/resources/draws.rbs +++ b/sig/x_twitter_scraper/resources/draws.rbs @@ -7,14 +7,14 @@ module XTwitterScraper ) -> XTwitterScraper::Models::DrawRetrieveResponse def list: ( - ?after: String, + ?cursor: String, ?limit: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::DrawListResponse def export: ( String id, - ?format_: XTwitterScraper::Models::DrawExportParams::format_, + format_: XTwitterScraper::Models::DrawExportParams::format_, ?type: XTwitterScraper::Models::DrawExportParams::type_, ?request_options: XTwitterScraper::request_opts ) -> StringIO diff --git a/sig/x_twitter_scraper/resources/events.rbs b/sig/x_twitter_scraper/resources/events.rbs index a9592c4..5e48c8f 100644 --- a/sig/x_twitter_scraper/resources/events.rbs +++ b/sig/x_twitter_scraper/resources/events.rbs @@ -7,7 +7,7 @@ module XTwitterScraper ) -> XTwitterScraper::EventDetail def list: ( - ?after: String, + ?cursor: String, ?event_type: XTwitterScraper::Models::event_type, ?limit: Integer, ?monitor_id: String, diff --git a/sig/x_twitter_scraper/resources/extractions.rbs b/sig/x_twitter_scraper/resources/extractions.rbs index 16ce8b7..d7d2cfc 100644 --- a/sig/x_twitter_scraper/resources/extractions.rbs +++ b/sig/x_twitter_scraper/resources/extractions.rbs @@ -3,13 +3,13 @@ module XTwitterScraper class Extractions def retrieve: ( String id, - ?after: String, + ?cursor: String, ?limit: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::ExtractionRetrieveResponse def list: ( - ?after: String, + ?cursor: String, ?limit: Integer, ?status: XTwitterScraper::Models::ExtractionListParams::status, ?tool_type: XTwitterScraper::Models::ExtractionListParams::tool_type, @@ -19,34 +19,92 @@ module XTwitterScraper def estimate_cost: ( tool_type: XTwitterScraper::Models::ExtractionEstimateCostParams::tool_type, ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?exact_phrase: String, ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?list_id: String, + ?media_type: XTwitterScraper::Models::ExtractionEstimateCostParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, + ?quotes: XTwitterScraper::Models::ExtractionEstimateCostParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::ExtractionEstimateCostParams::replies, + ?results_limit: Integer, + ?retweets: XTwitterScraper::Models::ExtractionEstimateCostParams::retweets, + ?retweets_of_tweet_id: String, ?search_query: String, + ?since_date: Date, ?target_community_id: String, ?target_list_id: String, ?target_space_id: String, ?target_tweet_id: String, ?target_username: String, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::ExtractionEstimateCostResponse def export_results: ( String id, - ?format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_, + format_: XTwitterScraper::Models::ExtractionExportResultsParams::format_, ?request_options: XTwitterScraper::request_opts ) -> StringIO def run: ( tool_type: XTwitterScraper::Models::ExtractionRunParams::tool_type, ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?exact_phrase: String, ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?list_id: String, + ?media_type: XTwitterScraper::Models::ExtractionRunParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, + ?quotes: XTwitterScraper::Models::ExtractionRunParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::ExtractionRunParams::replies, + ?results_limit: Integer, + ?retweets: XTwitterScraper::Models::ExtractionRunParams::retweets, + ?retweets_of_tweet_id: String, ?search_query: String, + ?since_date: Date, ?target_community_id: String, ?target_list_id: String, ?target_space_id: String, ?target_tweet_id: String, ?target_username: String, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::ExtractionRunResponse diff --git a/sig/x_twitter_scraper/resources/guest_wallets.rbs b/sig/x_twitter_scraper/resources/guest_wallets.rbs new file mode 100644 index 0000000..9e53ee5 --- /dev/null +++ b/sig/x_twitter_scraper/resources/guest_wallets.rbs @@ -0,0 +1,25 @@ +module XTwitterScraper + module Resources + class GuestWallets + def create: ( + amount_minor: Integer, + idempotency_key: String, + ?currency: :usd, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::GuestWalletCreateResponse + + def retrieve_status: ( + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::GuestWalletRetrieveStatusResponse + + def topup: ( + amount_minor: Integer, + idempotency_key: String, + ?currency: :usd, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::GuestWalletTopupResponse + + def initialize: (client: XTwitterScraper::Client) -> void + end + end +end diff --git a/sig/x_twitter_scraper/resources/monitors.rbs b/sig/x_twitter_scraper/resources/monitors.rbs index 3a2abf5..bff2c86 100644 --- a/sig/x_twitter_scraper/resources/monitors.rbs +++ b/sig/x_twitter_scraper/resources/monitors.rbs @@ -1,6 +1,8 @@ module XTwitterScraper module Resources class Monitors + attr_reader keywords: XTwitterScraper::Resources::Monitors::Keywords + def create: ( event_types: ::Array[XTwitterScraper::Models::event_type], username: String, diff --git a/sig/x_twitter_scraper/resources/monitors/keywords.rbs b/sig/x_twitter_scraper/resources/monitors/keywords.rbs new file mode 100644 index 0000000..f603447 --- /dev/null +++ b/sig/x_twitter_scraper/resources/monitors/keywords.rbs @@ -0,0 +1,36 @@ +module XTwitterScraper + module Resources + class Monitors + class Keywords + def create: ( + event_types: ::Array[XTwitterScraper::Models::event_type], + query: String, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::Monitors::KeywordCreateResponse + + def retrieve: ( + String id, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::Monitors::KeywordRetrieveResponse + + def update: ( + String id, + ?event_types: ::Array[XTwitterScraper::Models::event_type], + ?is_active: bool, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::Monitors::KeywordUpdateResponse + + def list: ( + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::Monitors::KeywordListResponse + + def deactivate: ( + String id, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::Monitors::KeywordDeactivateResponse + + def initialize: (client: XTwitterScraper::Client) -> void + end + end + end +end diff --git a/sig/x_twitter_scraper/resources/subscribe.rbs b/sig/x_twitter_scraper/resources/subscribe.rbs index c4c27cb..ef2d285 100644 --- a/sig/x_twitter_scraper/resources/subscribe.rbs +++ b/sig/x_twitter_scraper/resources/subscribe.rbs @@ -2,6 +2,7 @@ module XTwitterScraper module Resources class Subscribe def create: ( + ?tier: XTwitterScraper::Models::SubscribeCreateParams::tier, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::SubscribeCreateResponse diff --git a/sig/x_twitter_scraper/resources/webhooks.rbs b/sig/x_twitter_scraper/resources/webhooks.rbs index d3fee34..53226b7 100644 --- a/sig/x_twitter_scraper/resources/webhooks.rbs +++ b/sig/x_twitter_scraper/resources/webhooks.rbs @@ -29,6 +29,11 @@ module XTwitterScraper ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::WebhookListDeliveriesResponse + def resume: ( + String id, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::WebhookResumeResponse + def test_: ( String id, ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/x.rbs b/sig/x_twitter_scraper/resources/x.rbs index a5f6161..b97be0f 100644 --- a/sig/x_twitter_scraper/resources/x.rbs +++ b/sig/x_twitter_scraper/resources/x.rbs @@ -1,6 +1,8 @@ module XTwitterScraper module Resources class X + attr_reader write_actions: XTwitterScraper::Resources::X::WriteActions + attr_reader tweets: XTwitterScraper::Resources::X::Tweets attr_reader users: XTwitterScraper::Resources::X::Users @@ -17,6 +19,8 @@ module XTwitterScraper attr_reader accounts: XTwitterScraper::Resources::X::Accounts + attr_reader account_connection_challenges: XTwitterScraper::Resources::X::AccountConnectionChallenges + attr_reader bookmarks: XTwitterScraper::Resources::X::Bookmarks attr_reader lists: XTwitterScraper::Resources::X::Lists diff --git a/sig/x_twitter_scraper/resources/x/account_connection_challenges.rbs b/sig/x_twitter_scraper/resources/x/account_connection_challenges.rbs new file mode 100644 index 0000000..28b5478 --- /dev/null +++ b/sig/x_twitter_scraper/resources/x/account_connection_challenges.rbs @@ -0,0 +1,15 @@ +module XTwitterScraper + module Resources + class X + class AccountConnectionChallenges + def submit: ( + String id, + email_code: String, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse + + def initialize: (client: XTwitterScraper::Client) -> void + end + end + end +end diff --git a/sig/x_twitter_scraper/resources/x/accounts.rbs b/sig/x_twitter_scraper/resources/x/accounts.rbs index b6c9db2..a8ec2b0 100644 --- a/sig/x_twitter_scraper/resources/x/accounts.rbs +++ b/sig/x_twitter_scraper/resources/x/accounts.rbs @@ -6,7 +6,6 @@ module XTwitterScraper email: String, password: String, username: String, - ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::AccountCreateResponse @@ -33,7 +32,6 @@ module XTwitterScraper String id, password: String, ?email: String, - ?proxy_country: String, ?totp_secret: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::AccountReauthResponse diff --git a/sig/x_twitter_scraper/resources/x/communities.rbs b/sig/x_twitter_scraper/resources/x/communities.rbs index 5a9f61a..f3ac38c 100644 --- a/sig/x_twitter_scraper/resources/x/communities.rbs +++ b/sig/x_twitter_scraper/resources/x/communities.rbs @@ -39,9 +39,11 @@ module XTwitterScraper ) -> XTwitterScraper::PaginatedUsers def retrieve_search: ( + community_id: String, q: String, ?cursor: String, - ?query_type: String, + ?page_size: Integer, + ?query_type: XTwitterScraper::Models::X::CommunityRetrieveSearchParams::query_type, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets diff --git a/sig/x_twitter_scraper/resources/x/communities/join.rbs b/sig/x_twitter_scraper/resources/x/communities/join.rbs index 2d352fe..924aea3 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::X::CommunityActionResult + ) -> XTwitterScraper::Models::X::Communities::JoinCreateResponse def delete_all: ( String id, account: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::X::CommunityActionResult + ) -> XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse 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 a733ccd..57ff819 100644 --- a/sig/x_twitter_scraper/resources/x/communities/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/communities/tweets.rbs @@ -4,15 +4,18 @@ module XTwitterScraper class Communities class Tweets def list: ( + community_id: String, q: String, ?cursor: String, - ?query_type: String, + ?page_size: Integer, + ?query_type: XTwitterScraper::Models::X::Communities::TweetListParams::query_type, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def list_by_community: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets diff --git a/sig/x_twitter_scraper/resources/x/dm.rbs b/sig/x_twitter_scraper/resources/x/dm.rbs index f49606f..1c4016c 100644 --- a/sig/x_twitter_scraper/resources/x/dm.rbs +++ b/sig/x_twitter_scraper/resources/x/dm.rbs @@ -4,6 +4,7 @@ module XTwitterScraper class Dm def retrieve_history: ( String user_id, + account: String, ?cursor: String, ?max_id: String, ?request_options: XTwitterScraper::request_opts @@ -14,7 +15,6 @@ module XTwitterScraper account: String, text: String, ?media_ids: ::Array[String], - ?reply_to_message_id: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::DmSendResponse diff --git a/sig/x_twitter_scraper/resources/x/lists.rbs b/sig/x_twitter_scraper/resources/x/lists.rbs index 384354a..1667aef 100644 --- a/sig/x_twitter_scraper/resources/x/lists.rbs +++ b/sig/x_twitter_scraper/resources/x/lists.rbs @@ -5,6 +5,7 @@ module XTwitterScraper def retrieve_followers: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers @@ -19,6 +20,7 @@ module XTwitterScraper String id, ?cursor: String, ?include_replies: bool, + ?page_size: Integer, ?since_time: String, ?until_time: String, ?request_options: XTwitterScraper::request_opts diff --git a/sig/x_twitter_scraper/resources/x/media.rbs b/sig/x_twitter_scraper/resources/x/media.rbs index 055562a..70b42e5 100644 --- a/sig/x_twitter_scraper/resources/x/media.rbs +++ b/sig/x_twitter_scraper/resources/x/media.rbs @@ -3,15 +3,16 @@ module XTwitterScraper class X class Media def download: ( + ?tweet_id: String, ?tweet_ids: ::Array[String], ?tweet_input: String, + ?tweet_url: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::MediaDownloadResponse def upload: ( account: String, - file: XTwitterScraper::Internal::file_input, - ?is_long_video: bool, + url: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::MediaUploadResponse diff --git a/sig/x_twitter_scraper/resources/x/profile.rbs b/sig/x_twitter_scraper/resources/x/profile.rbs index edadf8a..68fb792 100644 --- a/sig/x_twitter_scraper/resources/x/profile.rbs +++ b/sig/x_twitter_scraper/resources/x/profile.rbs @@ -13,13 +13,13 @@ module XTwitterScraper def update_avatar: ( account: String, - file: XTwitterScraper::Internal::file_input, + url: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::ProfileUpdateAvatarResponse def update_banner: ( account: String, - file: XTwitterScraper::Internal::file_input, + url: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::ProfileUpdateBannerResponse diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index 9f68fa6..977a8af 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -36,45 +36,131 @@ module XTwitterScraper def get_favoriters: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers def get_quotes: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, ?include_replies: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::TweetGetQuotesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetQuotesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetQuotesParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetQuotesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def get_replies: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetRepliesParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetRepliesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def get_retweeters: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers def get_thread: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def search: ( q: String, + ?advanced_query: String, + ?any_words: String, + ?bounding_box: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, ?limit: Integer, + ?list_id: String, + ?media_type: XTwitterScraper::Models::X::TweetSearchParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?place: String, + ?place_country: String, + ?point_radius: String, ?query_type: XTwitterScraper::Models::X::TweetSearchParams::query_type, + ?quotes: XTwitterScraper::Models::X::TweetSearchParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetSearchParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetSearchParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets diff --git a/sig/x_twitter_scraper/resources/x/users.rbs b/sig/x_twitter_scraper/resources/x/users.rbs index cac3c4e..82b9236 100644 --- a/sig/x_twitter_scraper/resources/x/users.rbs +++ b/sig/x_twitter_scraper/resources/x/users.rbs @@ -9,14 +9,22 @@ module XTwitterScraper ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::UserProfile + def remove_follower: ( + String id, + account: String, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::X::UserRemoveFollowerResponse + def retrieve_batch: ( ids: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::PaginatedUsers + ) -> XTwitterScraper::Models::X::UserRetrieveBatchResponse def retrieve_followers: ( String id, + ?after: String, ?cursor: String, + ?limit: Integer, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers @@ -24,33 +32,147 @@ module XTwitterScraper def retrieve_followers_you_know: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers def retrieve_following: ( String id, + ?after: String, ?cursor: String, + ?limit: Integer, ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers def retrieve_likes: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveLikesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveLikesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveLikesParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveLikesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def retrieve_media: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveMediaParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveMediaParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveMediaParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveMediaParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def retrieve_mentions: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveMentionsParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveMentionsParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveMentionsParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveMentionsParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, ?since_time: String, + ?to_user: String, + ?until_date: Date, ?until_time: String, + ?url: String, + ?verified_only: bool, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::PaginatedTweets + + def retrieve_replies: ( + String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, + ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?include_parent_tweet: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveRepliesParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveRepliesParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveRepliesParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveRepliesParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets @@ -62,15 +184,42 @@ module XTwitterScraper def retrieve_tweets: ( String id, + ?any_words: String, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, ?include_parent_tweet: bool, ?include_replies: bool, + ?in_reply_to_tweet_id: String, + ?language: String, + ?media_type: XTwitterScraper::Models::X::UserRetrieveTweetsParams::media_type, + ?mentioning: String, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::UserRetrieveTweetsParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::UserRetrieveTweetsParams::replies, + ?retweets: XTwitterScraper::Models::X::UserRetrieveTweetsParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets def retrieve_verified_followers: ( String id, ?cursor: String, + ?page_size: Integer, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedUsers diff --git a/sig/x_twitter_scraper/resources/x/write_actions.rbs b/sig/x_twitter_scraper/resources/x/write_actions.rbs new file mode 100644 index 0000000..4c9f31e --- /dev/null +++ b/sig/x_twitter_scraper/resources/x/write_actions.rbs @@ -0,0 +1,14 @@ +module XTwitterScraper + module Resources + class X + class WriteActions + def retrieve: ( + String id, + ?request_options: XTwitterScraper::request_opts + ) -> XTwitterScraper::Models::X::WriteActionRetrieveResponse + + def initialize: (client: XTwitterScraper::Client) -> void + end + end + end +end diff --git a/test/x_twitter_scraper/client_test.rb b/test/x_twitter_scraper/client_test.rb index 18884d8..67a60df 100644 --- a/test/x_twitter_scraper/client_test.rb +++ b/test/x_twitter_scraper/client_test.rb @@ -30,7 +30,12 @@ def after_all def test_client_default_request_default_retry_attempts stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve @@ -43,7 +48,12 @@ def test_client_given_request_default_retry_attempts stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) x_twitter_scraper = - XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token", + max_retries: 3 + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve @@ -55,7 +65,12 @@ def test_client_given_request_default_retry_attempts def test_client_default_request_given_retry_attempts stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve(request_options: {max_retries: 3}) @@ -68,7 +83,12 @@ def test_client_given_request_given_retry_attempts stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) x_twitter_scraper = - XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token", + max_retries: 3 + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve(request_options: {max_retries: 4}) @@ -85,7 +105,12 @@ def test_client_retry_after_seconds ) x_twitter_scraper = - XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token", + max_retries: 1 + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve @@ -105,7 +130,12 @@ def test_client_retry_after_date ) x_twitter_scraper = - XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token", + max_retries: 1 + ) Thread.current.thread_variable_set(:time_now, time_now) assert_raises(XTwitterScraper::Errors::InternalServerError) do @@ -125,7 +155,12 @@ def test_client_retry_after_ms ) x_twitter_scraper = - XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token", + max_retries: 1 + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve @@ -138,7 +173,12 @@ def test_client_retry_after_ms def test_retry_count_header stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve @@ -152,7 +192,12 @@ def test_retry_count_header def test_omit_retry_count_header stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) @@ -166,7 +211,12 @@ def test_omit_retry_count_header def test_overwrite_retry_count_header stub_request(:get, "http://localhost/account").to_return_json(status: 500, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::InternalServerError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) @@ -186,7 +236,12 @@ def test_client_redirect_307 headers: {"location" => "/redirected"} ) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::APIConnectionError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {}}) @@ -215,7 +270,12 @@ def test_client_redirect_303 headers: {"location" => "/redirected"} ) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::APIConnectionError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {}}) @@ -239,7 +299,12 @@ def test_client_redirect_auth_keep_same_origin headers: {"location" => "/redirected"} ) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::APIConnectionError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -266,7 +331,12 @@ def test_client_redirect_auth_strip_cross_origin headers: {"location" => "https://example.com/redirected"} ) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) assert_raises(XTwitterScraper::Errors::APIConnectionError) do x_twitter_scraper.account.retrieve(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -281,7 +351,12 @@ def test_client_redirect_auth_strip_cross_origin def test_default_headers stub_request(:get, "http://localhost/account").to_return_json(status: 200, body: {}) - x_twitter_scraper = XTwitterScraper::Client.new(base_url: "http://localhost", api_key: "My API Key") + x_twitter_scraper = + XTwitterScraper::Client.new( + base_url: "http://localhost", + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) x_twitter_scraper.account.retrieve diff --git a/test/x_twitter_scraper/resource_namespaces.rb b/test/x_twitter_scraper/resource_namespaces.rb index 87cf0b2..f77031e 100644 --- a/test/x_twitter_scraper/resource_namespaces.rb +++ b/test/x_twitter_scraper/resource_namespaces.rb @@ -6,6 +6,9 @@ module Resources module Communities end + module Monitors + end + module Support end diff --git a/test/x_twitter_scraper/resources/account_test.rb b/test/x_twitter_scraper/resources/account_test.rb index 09fc0c3..4040c5f 100644 --- a/test/x_twitter_scraper/resources/account_test.rb +++ b/test/x_twitter_scraper/resources/account_test.rb @@ -14,6 +14,7 @@ def test_retrieve assert_pattern do response => { + monitor_billing: XTwitterScraper::Models::AccountRetrieveResponse::MonitorBilling, monitors_allowed: Integer, monitors_used: Integer, plan: XTwitterScraper::Models::AccountRetrieveResponse::Plan, diff --git a/test/x_twitter_scraper/resources/api_keys_test.rb b/test/x_twitter_scraper/resources/api_keys_test.rb deleted file mode 100644 index c983ead..0000000 --- a/test/x_twitter_scraper/resources/api_keys_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class XTwitterScraper::Test::Resources::APIKeysTest < XTwitterScraper::Test::ResourceTest - def test_create - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.api_keys.create - - assert_pattern do - response => XTwitterScraper::Models::APIKeyCreateResponse - end - - assert_pattern do - response => { - id: String, - created_at: Time, - full_key: String, - name: String, - prefix: String - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.api_keys.list - - assert_pattern do - response => XTwitterScraper::Models::APIKeyListResponse - end - - assert_pattern do - response => { - keys: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::APIKey]) - } - end - end - - def test_revoke - skip("Mock server tests are disabled") - - response = @x_twitter_scraper.api_keys.revoke("id") - - assert_pattern do - response => XTwitterScraper::Models::APIKeyRevokeResponse - end - - assert_pattern do - response => { - success: true | false - } - end - end -end diff --git a/test/x_twitter_scraper/resources/credits_test.rb b/test/x_twitter_scraper/resources/credits_test.rb index fc09e8f..e0cac77 100644 --- a/test/x_twitter_scraper/resources/credits_test.rb +++ b/test/x_twitter_scraper/resources/credits_test.rb @@ -3,6 +3,16 @@ require_relative "../test_helper" class XTwitterScraper::Test::Resources::CreditsTest < XTwitterScraper::Test::ResourceTest + def test_redirect_topup_checkout_required_params + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.credits.redirect_topup_checkout(session_id: "session_id") + + assert_pattern do + response => nil + end + end + def test_retrieve_balance skip("Mock server tests are disabled") @@ -14,10 +24,30 @@ def test_retrieve_balance assert_pattern do response => { + auto_topup_amount_dollars: Float, auto_topup_enabled: XTwitterScraper::Internal::Type::Boolean, - balance: Integer, - lifetime_purchased: Integer, - lifetime_used: Integer + auto_topup_threshold: String, + balance: String, + lifetime_purchased: String, + lifetime_used: String + } + end + end + + def test_retrieve_topup_status_required_params + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.credits.retrieve_topup_status(session_id: "session_id") + + assert_pattern do + response => XTwitterScraper::Models::CreditRetrieveTopupStatusResponse + end + + assert_pattern do + response => { + status: XTwitterScraper::Models::CreditRetrieveTopupStatusResponse::Status, + amount_dollars: Integer | nil, + credits: String | nil } end end @@ -25,7 +55,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: 10_000) + response = @x_twitter_scraper.credits.topup_balance(dollars: 10) assert_pattern do response => XTwitterScraper::Models::CreditTopupBalanceResponse @@ -33,7 +63,8 @@ def test_topup_balance_required_params assert_pattern do response => { - success: true | false + redirect_url: String, + url: String } end end diff --git a/test/x_twitter_scraper/resources/draws_test.rb b/test/x_twitter_scraper/resources/draws_test.rb index 8fa2c40..63e912d 100644 --- a/test/x_twitter_scraper/resources/draws_test.rb +++ b/test/x_twitter_scraper/resources/draws_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::DrawsTest < XTwitterScraper::Test::Resou def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.draws.retrieve("id") + response = @x_twitter_scraper.draws.retrieve("f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345") assert_pattern do response => XTwitterScraper::Models::DrawRetrieveResponse @@ -38,10 +38,10 @@ def test_list end end - def test_export + def test_export_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.draws.export("id") + response = @x_twitter_scraper.draws.export("f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", format_: :csv) assert_pattern do response => StringIO diff --git a/test/x_twitter_scraper/resources/events_test.rb b/test/x_twitter_scraper/resources/events_test.rb index 34eebc8..8915f8c 100644 --- a/test/x_twitter_scraper/resources/events_test.rb +++ b/test/x_twitter_scraper/resources/events_test.rb @@ -17,9 +17,12 @@ def test_retrieve id: String, data: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]), monitor_id: String, + monitor_type: XTwitterScraper::EventDetail::MonitorType, occurred_at: Time, type: XTwitterScraper::EventType, - username: String, + keyword_monitor_id: String | nil, + query: String | nil, + username: String | nil, x_event_id: String | nil } end diff --git a/test/x_twitter_scraper/resources/extractions_test.rb b/test/x_twitter_scraper/resources/extractions_test.rb index 5a8677a..23e8bdd 100644 --- a/test/x_twitter_scraper/resources/extractions_test.rb +++ b/test/x_twitter_scraper/resources/extractions_test.rb @@ -55,16 +55,16 @@ def test_estimate_cost_required_params credits_available: String, credits_required: String, estimated_results: Integer, - source: String, + source: XTwitterScraper::Models::ExtractionEstimateCostResponse::Source, resolved_x_user_id: String | nil } end end - def test_export_results + def test_export_results_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.extractions.export_results("id") + response = @x_twitter_scraper.extractions.export_results("id", format_: :csv) assert_pattern do response => StringIO diff --git a/test/x_twitter_scraper/resources/guest_wallets_test.rb b/test/x_twitter_scraper/resources/guest_wallets_test.rb new file mode 100644 index 0000000..13c6134 --- /dev/null +++ b/test/x_twitter_scraper/resources/guest_wallets_test.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class XTwitterScraper::Test::Resources::GuestWalletsTest < XTwitterScraper::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @x_twitter_scraper.guest_wallets.create( + amount_minor: 1000, + currency: :usd, + idempotency_key: "e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa" + ) + + assert_pattern do + response => XTwitterScraper::Models::GuestWalletCreateResponse + end + + assert_pattern do + response => { + account_required: true | false, + amount: XTwitterScraper::GuestWalletAmount, + api_key: String, + authorization: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization, + checkout_url: String, + credential_notice: Symbol, + credits: String, + expires_at: Time, + instructions: Symbol, + poll_after_seconds: Numeric, + purchase_id: String, + requires_user_interaction: true | false, + status: XTwitterScraper::Models::GuestWalletCreateResponse::Status, + status_url: Symbol, + wallet_id: String + } + end + end + + def test_retrieve_status + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.guest_wallets.retrieve_status + + assert_pattern do + response => XTwitterScraper::Models::GuestWalletRetrieveStatusResponse + end + + assert_pattern do + response => { + balance: String, + latest_purchase: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::LatestPurchase | nil, + poll_after_seconds: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::PollAfterSeconds | nil, + scope: Symbol, + status: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::Status, + top_up: XTwitterScraper::Models::GuestWalletRetrieveStatusResponse::TopUp | nil, + usable: XTwitterScraper::Internal::Type::Boolean, + wallet_id: String + } + end + end + + def test_topup_required_params + skip("Mock server tests are disabled") + + response = + @x_twitter_scraper.guest_wallets.topup( + amount_minor: 1000, + currency: :usd, + idempotency_key: "e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa" + ) + + assert_pattern do + response => XTwitterScraper::Models::GuestWalletTopupResponse + end + + assert_pattern do + response => { + account_required: true | false, + amount: XTwitterScraper::GuestWalletAmount, + checkout_url: String, + credits: String, + expires_at: Time, + instructions: Symbol, + poll_after_seconds: Numeric, + purchase_id: String, + requires_user_interaction: true | false, + status: XTwitterScraper::Models::GuestWalletTopupResponse::Status, + status_url: Symbol, + wallet_id: String, + api_key: String | nil, + authorization: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization | nil, + credential_notice: XTwitterScraper::Models::GuestWalletTopupResponse::CredentialNotice | nil + } + end + end +end diff --git a/test/x_twitter_scraper/resources/monitors/keywords_test.rb b/test/x_twitter_scraper/resources/monitors/keywords_test.rb new file mode 100644 index 0000000..76e3f51 --- /dev/null +++ b/test/x_twitter_scraper/resources/monitors/keywords_test.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class XTwitterScraper::Test::Resources::Monitors::KeywordsTest < XTwitterScraper::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @x_twitter_scraper.monitors.keywords.create(event_types: [:"tweet.new"], query: "xquik OR \"x api\"") + + assert_pattern do + response => XTwitterScraper::Models::Monitors::KeywordCreateResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), + is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, + query: String + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.monitors.keywords.retrieve("id") + + assert_pattern do + response => XTwitterScraper::Models::Monitors::KeywordRetrieveResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), + is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, + query: String + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.monitors.keywords.update("id") + + assert_pattern do + response => XTwitterScraper::Models::Monitors::KeywordUpdateResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), + is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, + query: String + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.monitors.keywords.list + + assert_pattern do + response => XTwitterScraper::Models::Monitors::KeywordListResponse + end + + assert_pattern do + response => { + monitors: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Monitors::KeywordListResponse::Monitor]), + total: Integer + } + end + end + + def test_deactivate + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.monitors.keywords.deactivate("id") + + assert_pattern do + response => XTwitterScraper::Models::Monitors::KeywordDeactivateResponse + end + + assert_pattern do + response => { + success: true | false + } + end + end +end diff --git a/test/x_twitter_scraper/resources/monitors_test.rb b/test/x_twitter_scraper/resources/monitors_test.rb index c756a87..16024e4 100644 --- a/test/x_twitter_scraper/resources/monitors_test.rb +++ b/test/x_twitter_scraper/resources/monitors_test.rb @@ -18,6 +18,8 @@ def test_create_required_params id: String, created_at: Time, event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), + is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, username: String, x_user_id: String } @@ -39,6 +41,7 @@ def test_retrieve created_at: Time, event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, username: String, x_user_id: String } @@ -60,6 +63,7 @@ def test_update created_at: Time, event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), is_active: XTwitterScraper::Internal::Type::Boolean, + next_billing_at: Time, username: String, x_user_id: String } diff --git a/test/x_twitter_scraper/resources/subscribe_test.rb b/test/x_twitter_scraper/resources/subscribe_test.rb index 6488fbb..0083ac7 100644 --- a/test/x_twitter_scraper/resources/subscribe_test.rb +++ b/test/x_twitter_scraper/resources/subscribe_test.rb @@ -14,9 +14,9 @@ def test_create assert_pattern do response => { - url: String, - message: String | nil, - status: XTwitterScraper::Models::SubscribeCreateResponse::Status | nil + message: String, + status: XTwitterScraper::Models::SubscribeCreateResponse::Status, + url: String } end end diff --git a/test/x_twitter_scraper/resources/support/tickets_test.rb b/test/x_twitter_scraper/resources/support/tickets_test.rb index 9b0eb70..ea55519 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -26,7 +26,7 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.retrieve("messages_value") + response = @x_twitter_scraper.support.tickets.retrieve("tkt_a1b2c3d4e5f6a1b2c3d4e5f6") assert_pattern do response => XTwitterScraper::Models::Support::TicketRetrieveResponse @@ -47,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: :resolved) + response = @x_twitter_scraper.support.tickets.update("tkt_a1b2c3d4e5f6a1b2c3d4e5f6", status: :resolved) assert_pattern do response => XTwitterScraper::Models::Support::TicketUpdateResponse @@ -80,7 +80,11 @@ def test_list def test_reply_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.support.tickets.reply("id", body: "Thank you for the update.") + response = + @x_twitter_scraper.support.tickets.reply( + "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", + 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 0ea89cf..3b84091 100644 --- a/test/x_twitter_scraper/resources/webhooks_test.rb +++ b/test/x_twitter_scraper/resources/webhooks_test.rb @@ -39,8 +39,11 @@ def test_update assert_pattern do response => { id: String, + consecutive_failures: Integer, created_at: Time, + delivery_status: XTwitterScraper::Webhook::DeliveryStatus, event_types: ^(XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType]), + failure_hard_cap: Integer, is_active: XTwitterScraper::Internal::Type::Boolean, url: String } @@ -95,6 +98,24 @@ def test_list_deliveries end end + def test_resume + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.webhooks.resume("id") + + assert_pattern do + response => XTwitterScraper::Models::WebhookResumeResponse + end + + assert_pattern do + response => { + status_code: Integer, + success: XTwitterScraper::Internal::Type::Boolean, + webhook: XTwitterScraper::Webhook + } + end + end + def test_test_ skip("Mock server tests are disabled") diff --git a/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb new file mode 100644 index 0000000..d8baead --- /dev/null +++ b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class XTwitterScraper::Test::Resources::X::AccountConnectionChallengesTest < XTwitterScraper::Test::ResourceTest + def test_submit_required_params + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.account_connection_challenges.submit("id", email_code: "123456") + + assert_pattern do + response => XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health, + status: String, + x_user_id: String, + x_username: String + } + end + 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 c725eb4..f414fb2 100644 --- a/test/x_twitter_scraper/resources/x/accounts_test.rb +++ b/test/x_twitter_scraper/resources/x/accounts_test.rb @@ -24,8 +24,7 @@ def test_create_required_params health: XTwitterScraper::Models::X::AccountCreateResponse::Health, status: String, x_user_id: String, - x_username: String, - login_country: String | nil + x_username: String } end end @@ -48,7 +47,6 @@ def test_retrieve x_user_id: String, x_username: String, cookies_obtained_at: Time | nil, - proxy_country: String | nil, updated_at: Time | nil } end @@ -118,8 +116,7 @@ def test_reauth_required_params health: XTwitterScraper::Models::X::AccountReauthResponse::Health, status: String, x_user_id: String, - x_username: String, - login_country: String | nil + x_username: String } 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 9079ef1..9eebf06 100644 --- a/test/x_twitter_scraper/resources/x/communities/join_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/join_test.rb @@ -9,13 +9,11 @@ def test_create_required_params response = @x_twitter_scraper.x.communities.join.create("id", account: "@elonmusk") assert_pattern do - response => XTwitterScraper::X::CommunityActionResult + response => XTwitterScraper::Models::X::Communities::JoinCreateResponse end assert_pattern do response => { - community_id: String, - community_name: String, success: true | false } end @@ -27,13 +25,11 @@ def test_delete_all_required_params response = @x_twitter_scraper.x.communities.join.delete_all("id", account: "@elonmusk") assert_pattern do - response => XTwitterScraper::X::CommunityActionResult + response => XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse end assert_pattern do response => { - community_id: String, - community_name: String, success: true | false } end 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 d34c475..90c9741 100644 --- a/test/x_twitter_scraper/resources/x/communities/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/tweets_test.rb @@ -6,7 +6,7 @@ class XTwitterScraper::Test::Resources::X::Communities::TweetsTest < XTwitterScr def test_list_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.communities.tweets.list(q: "q") + response = @x_twitter_scraper.x.communities.tweets.list(community_id: "321669910225", q: "q") assert_pattern do response => XTwitterScraper::PaginatedTweets diff --git a/test/x_twitter_scraper/resources/x/communities_test.rb b/test/x_twitter_scraper/resources/x/communities_test.rb index 37c1e8e..9723f0d 100644 --- a/test/x_twitter_scraper/resources/x/communities_test.rb +++ b/test/x_twitter_scraper/resources/x/communities_test.rb @@ -93,7 +93,7 @@ def test_retrieve_moderators def test_retrieve_search_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.communities.retrieve_search(q: "q") + response = @x_twitter_scraper.x.communities.retrieve_search(community_id: "321669910225", q: "q") assert_pattern do response => XTwitterScraper::PaginatedTweets diff --git a/test/x_twitter_scraper/resources/x/dm_test.rb b/test/x_twitter_scraper/resources/x/dm_test.rb index c96e80f..c78625d 100644 --- a/test/x_twitter_scraper/resources/x/dm_test.rb +++ b/test/x_twitter_scraper/resources/x/dm_test.rb @@ -3,10 +3,10 @@ require_relative "../../test_helper" class XTwitterScraper::Test::Resources::X::DmTest < XTwitterScraper::Test::ResourceTest - def test_retrieve_history + def test_retrieve_history_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.dm.retrieve_history("userId") + response = @x_twitter_scraper.x.dm.retrieve_history("userId", account: "account") assert_pattern do response => XTwitterScraper::Models::X::DmRetrieveHistoryResponse diff --git a/test/x_twitter_scraper/resources/x/media_test.rb b/test/x_twitter_scraper/resources/x/media_test.rb index 3b869e0..2a75101 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: "@elonmusk", file: StringIO.new("Example data")) + response = @x_twitter_scraper.x.media.upload(account: "@elonmusk", url: "https://example.com/image.png") assert_pattern do response => XTwitterScraper::Models::X::MediaUploadResponse @@ -35,6 +35,7 @@ def test_upload_required_params assert_pattern do response => { media_id: String, + media_url: String, success: true | false } end diff --git a/test/x_twitter_scraper/resources/x/profile_test.rb b/test/x_twitter_scraper/resources/x/profile_test.rb index 8937827..be678c9 100644 --- a/test/x_twitter_scraper/resources/x/profile_test.rb +++ b/test/x_twitter_scraper/resources/x/profile_test.rb @@ -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: "@elonmusk", file: StringIO.new("Example data")) + @x_twitter_scraper.x.profile.update_avatar(account: "@elonmusk", url: "https://example.com/avatar.png") 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: "@elonmusk", file: StringIO.new("Example data")) + @x_twitter_scraper.x.profile.update_banner(account: "@elonmusk", url: "https://example.com/banner.png") assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateBannerResponse diff --git a/test/x_twitter_scraper/resources/x/tweets_test.rb b/test/x_twitter_scraper/resources/x/tweets_test.rb index c443276..f466343 100644 --- a/test/x_twitter_scraper/resources/x/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets_test.rb @@ -14,8 +14,11 @@ def test_create_required_params assert_pattern do response => { + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, success: true | false, - tweet_id: String + tweet_id: String, + write_action_id: String | nil } end end diff --git a/test/x_twitter_scraper/resources/x/users_test.rb b/test/x_twitter_scraper/resources/x/users_test.rb index 742cdf3..b5e7305 100644 --- a/test/x_twitter_scraper/resources/x/users_test.rb +++ b/test/x_twitter_scraper/resources/x/users_test.rb @@ -17,14 +17,53 @@ def test_retrieve id: String, name: String, username: String, + automated_by: String | nil, + can_dm: XTwitterScraper::Internal::Type::Boolean | nil, + community_role: String | nil, + cover_picture: String | nil, created_at: String | nil, description: String | nil, + favourites_count: Integer | nil, followers: Integer | nil, following: Integer | nil, + has_custom_timelines: XTwitterScraper::Internal::Type::Boolean | nil, + is_automated: XTwitterScraper::Internal::Type::Boolean | nil, + is_blue_verified: XTwitterScraper::Internal::Type::Boolean | nil, + is_translator: XTwitterScraper::Internal::Type::Boolean | nil, + is_verified: XTwitterScraper::Internal::Type::Boolean | nil, location: String | nil, + media_count: Integer | nil, + pinned_tweet_ids: ^(XTwitterScraper::Internal::Type::ArrayOf[String]) | nil, + possibly_sensitive: XTwitterScraper::Internal::Type::Boolean | nil, + profile_bio: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + profile_banner_url: String | nil, profile_picture: String | nil, + protected: XTwitterScraper::Internal::Type::Boolean | nil, statuses_count: Integer | nil, - verified: XTwitterScraper::Internal::Type::Boolean | nil + unavailable: XTwitterScraper::Internal::Type::Boolean | nil, + unavailable_reason: String | nil, + url: String | nil, + verified: XTwitterScraper::Internal::Type::Boolean | nil, + verified_type: String | nil, + viewer_followed_by: XTwitterScraper::Internal::Type::Boolean | nil, + viewer_following: XTwitterScraper::Internal::Type::Boolean | nil, + withheld_in_countries: ^(XTwitterScraper::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_remove_follower_required_params + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.users.remove_follower("id", account: "@elonmusk") + + assert_pattern do + response => XTwitterScraper::Models::X::UserRemoveFollowerResponse + end + + assert_pattern do + response => { + success: true | false } end end @@ -35,13 +74,18 @@ def test_retrieve_batch_required_params response = @x_twitter_scraper.x.users.retrieve_batch(ids: "ids") assert_pattern do - response => XTwitterScraper::PaginatedUsers + response => XTwitterScraper::Models::X::UserRetrieveBatchResponse end assert_pattern do response => { - has_next_page: XTwitterScraper::Internal::Type::Boolean, + has_next_page: true | false, next_cursor: String, + processed_count: Integer, + requested_count: Integer, + returned_count: Integer, + unavailable_ids: ^(XTwitterScraper::Internal::Type::ArrayOf[String]), + unprocessed_ids: ^(XTwitterScraper::Internal::Type::ArrayOf[String]), users: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::UserProfile]) } end @@ -155,6 +199,24 @@ def test_retrieve_mentions end end + def test_retrieve_replies + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.users.retrieve_replies("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::SearchTweet]) + } + end + end + def test_retrieve_search_required_params skip("Mock server tests are disabled") diff --git a/test/x_twitter_scraper/resources/x/write_actions_test.rb b/test/x_twitter_scraper/resources/x/write_actions_test.rb new file mode 100644 index 0000000..6f52b74 --- /dev/null +++ b/test/x_twitter_scraper/resources/x/write_actions_test.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class XTwitterScraper::Test::Resources::X::WriteActionsTest < XTwitterScraper::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @x_twitter_scraper.x.write_actions.retrieve("id") + + assert_pattern do + response => XTwitterScraper::Models::X::WriteActionRetrieveResponse + end + + assert_pattern do + response => { + action: String, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + created_at: Time, + media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + retryable: true | false, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status, + write_action_id: String, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmation_source: String | nil, + confirmed_at: Time | nil, + message: String | nil, + message_id: String | nil, + send_dispatched_at: Time | nil, + target_id: String | nil, + tweet_id: String | nil + } + end + end +end diff --git a/test/x_twitter_scraper/resources/x_test.rb b/test/x_twitter_scraper/resources/x_test.rb index 33321b7..36bd077 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::X::TweetAuthor | nil + author: XTwitterScraper::Models::XGetArticleResponse::Author | nil } end end diff --git a/test/x_twitter_scraper/test_helper.rb b/test/x_twitter_scraper/test_helper.rb index f1364bb..e0ddca7 100644 --- a/test/x_twitter_scraper/test_helper.rb +++ b/test/x_twitter_scraper/test_helper.rb @@ -48,7 +48,11 @@ class XTwitterScraper::Test::SingletonClient < XTwitterScraper::Client TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") def initialize - super(base_url: XTwitterScraper::Test::SingletonClient::TEST_API_BASE_URL, api_key: "My API Key") + super( + base_url: XTwitterScraper::Test::SingletonClient::TEST_API_BASE_URL, + api_key: "My API Key", + bearer_token: "My Bearer Token" + ) end end diff --git a/x_twitter_scraper.gemspec b/x_twitter_scraper.gemspec index 6fa56ae..0051b81 100644 --- a/x_twitter_scraper.gemspec +++ b/x_twitter_scraper.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.email = "support@xquik.com" s.homepage = "https://gemdocs.org/gems/x-twitter-scraper" s.metadata["homepage_uri"] = s.homepage - s.metadata["source_code_uri"] = "https://github.com/stainless-sdks/x-twitter-scraper-ruby" + s.metadata["source_code_uri"] = "https://github.com/Xquik-dev/x-twitter-scraper-ruby" s.metadata["rubygems_mfa_required"] = false.to_s s.required_ruby_version = ">= 3.2.0" From 9ad8d7c87cdd91232cf5ba76a5f5022d43cb7348 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:04:33 +0000 Subject: [PATCH 07/12] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09237f3..779c18b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') @@ -56,7 +56,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: @@ -73,7 +73,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From b959adc349d87f75be1dfb858c92479c637588d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 07:06:20 +0000 Subject: [PATCH 08/12] feat(api): propagate durable write actions --- .stats.yml | 6 +- .../models/guest_wallet_create_response.rb | 34 +++++-- .../models/guest_wallet_topup_response.rb | 34 +++++-- .../models/x/tweet_author.rb | 15 +-- lib/x_twitter_scraper/models/x/x_account.rb | 14 +-- .../models/x/x_account_detail.rb | 2 +- .../models/guest_wallet_create_response.rbi | 92 ++++++++++++++++++- .../models/guest_wallet_topup_response.rbi | 92 ++++++++++++++++++- .../models/x/tweet_author.rbi | 16 +--- rbi/x_twitter_scraper/models/x/x_account.rbi | 18 ++-- .../models/x/x_account_detail.rbi | 2 +- .../models/guest_wallet_create_response.rbs | 40 +++++++- .../models/guest_wallet_topup_response.rbs | 40 +++++++- .../models/x/tweet_author.rbs | 14 +-- .../x/account_connection_challenges_test.rb | 3 +- .../resources/x/accounts_test.rb | 8 +- 16 files changed, 332 insertions(+), 98 deletions(-) diff --git a/.stats.yml b/.stats.yml index 51d317a..b67870c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-4665e942135459ff435542ae46122294c910986fdf19a0d2d33bc301817cf36f.yml -openapi_spec_hash: 564b37a7cb3edf100a82799631e287d9 -config_hash: 7a9e1c37c84d207c5ee312091fffd2b0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-d053a3e575a411e23fdd316b0b97626192c13564ef91814a4831e20a809cfdc5.yml +openapi_spec_hash: 0dc9eb7d023b1a16c08c6fec5a231957 +config_hash: 4b64fbd16fd09008417c5a460d27f053 diff --git a/lib/x_twitter_scraper/models/guest_wallet_create_response.rb b/lib/x_twitter_scraper/models/guest_wallet_create_response.rb index 59d6786..bc8b284 100644 --- a/lib/x_twitter_scraper/models/guest_wallet_create_response.rb +++ b/lib/x_twitter_scraper/models/guest_wallet_create_response.rb @@ -128,17 +128,37 @@ class GuestWalletCreateResponse < XTwitterScraper::Internal::Type::BaseModel class Authorization < XTwitterScraper::Internal::Type::BaseModel # @!attribute header # - # @return [Symbol, :Authorization] - required :header, const: :Authorization + # @return [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header] + required :header, enum: -> { XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header } # @!attribute scheme # - # @return [Symbol, :Bearer] - required :scheme, const: :Bearer + # @return [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme] + required :scheme, enum: -> { XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme } - # @!method initialize(header: :Authorization, scheme: :Bearer) - # @param header [Symbol, :Authorization] - # @param scheme [Symbol, :Bearer] + # @!method initialize(header:, scheme:) + # @param header [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header] + # @param scheme [Symbol, XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme] + + # @see XTwitterScraper::Models::GuestWalletCreateResponse::Authorization#header + module Header + extend XTwitterScraper::Internal::Type::Enum + + AUTHORIZATION = :Authorization + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::GuestWalletCreateResponse::Authorization#scheme + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + BEARER = :Bearer + + # @!method self.values + # @return [Array] + end end # @see XTwitterScraper::Models::GuestWalletCreateResponse#status diff --git a/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb b/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb index b368469..adaaf42 100644 --- a/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb +++ b/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb @@ -144,17 +144,37 @@ module Status class Authorization < XTwitterScraper::Internal::Type::BaseModel # @!attribute header # - # @return [Symbol, :Authorization] - required :header, const: :Authorization + # @return [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header] + required :header, enum: -> { XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header } # @!attribute scheme # - # @return [Symbol, :Bearer] - required :scheme, const: :Bearer + # @return [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme] + required :scheme, enum: -> { XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme } - # @!method initialize(header: :Authorization, scheme: :Bearer) - # @param header [Symbol, :Authorization] - # @param scheme [Symbol, :Bearer] + # @!method initialize(header:, scheme:) + # @param header [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header] + # @param scheme [Symbol, XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme] + + # @see XTwitterScraper::Models::GuestWalletTopupResponse::Authorization#header + module Header + extend XTwitterScraper::Internal::Type::Enum + + AUTHORIZATION = :Authorization + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::GuestWalletTopupResponse::Authorization#scheme + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + BEARER = :Bearer + + # @!method self.values + # @return [Array] + end end # @see XTwitterScraper::Models::GuestWalletTopupResponse#credential_notice diff --git a/lib/x_twitter_scraper/models/x/tweet_author.rb b/lib/x_twitter_scraper/models/x/tweet_author.rb index b928d2c..af62b5a 100644 --- a/lib/x_twitter_scraper/models/x/tweet_author.rb +++ b/lib/x_twitter_scraper/models/x/tweet_author.rb @@ -4,22 +4,9 @@ module XTwitterScraper module Models module X class TweetAuthor < XTwitterScraper::Models::UserProfile - # @!attribute followers - # - # @return [Integer] - required :followers, Integer - - # @!attribute verified - # - # @return [Boolean] - required :verified, XTwitterScraper::Internal::Type::Boolean - - # @!method initialize(followers:, verified:) + # @!method initialize # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. - # - # @param followers [Integer] - # @param verified [Boolean] end end end diff --git a/lib/x_twitter_scraper/models/x/x_account.rb b/lib/x_twitter_scraper/models/x/x_account.rb index 30a32ba..93fea9f 100644 --- a/lib/x_twitter_scraper/models/x/x_account.rb +++ b/lib/x_twitter_scraper/models/x/x_account.rb @@ -15,10 +15,10 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel required :created_at, Time, api_name: :createdAt # @!attribute health - # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user - # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # Derived connection health. `healthy` = session active. `needsReauth` = user must + # submit fresh credentials. `locked` = X locked the account; unlock on x.com # first. `suspended` = X banned the account. `recovering` = past cooldown, will - # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry # shortly. # # @return [Symbol, XTwitterScraper::Models::X::XAccount::Health] @@ -59,7 +59,7 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # # @param created_at [Time] # - # @param health [Symbol, XTwitterScraper::Models::X::XAccount::Health] Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user mus + # @param health [Symbol, XTwitterScraper::Models::X::XAccount::Health] Derived connection health. `healthy` = session active. `needsReauth` = user must # # @param status [String] # @@ -71,10 +71,10 @@ class XAccount < XTwitterScraper::Internal::Type::BaseModel # # @param cookies_obtained_at [Time] - # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user - # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # Derived connection health. `healthy` = session active. `needsReauth` = user must + # submit fresh credentials. `locked` = X locked the account; unlock on x.com # first. `suspended` = X banned the account. `recovering` = past cooldown, will - # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry # shortly. # # @see XTwitterScraper::Models::X::XAccount#health 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 9547e7e..4b18a58 100644 --- a/lib/x_twitter_scraper/models/x/x_account_detail.rb +++ b/lib/x_twitter_scraper/models/x/x_account_detail.rb @@ -46,7 +46,7 @@ class XAccountDetail < XTwitterScraper::Internal::Type::BaseModel optional :updated_at, Time, api_name: :updatedAt # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:, cookies_obtained_at: nil, updated_at: nil) - # Full X account details with status, cookies, and update timestamp. + # Connected X account details with health and timestamp metadata. # # @param id [String] # @param created_at [Time] diff --git a/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi b/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi index 002b972..a53b771 100644 --- a/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi +++ b/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi @@ -165,19 +165,101 @@ module XTwitterScraper ) end - sig { returns(Symbol) } + sig do + returns( + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header::TaggedSymbol + ) + end attr_accessor :header - sig { returns(Symbol) } + sig do + returns( + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme::TaggedSymbol + ) + end attr_accessor :scheme - sig { params(header: Symbol, scheme: Symbol).returns(T.attached_class) } - def self.new(header: :Authorization, scheme: :Bearer) + sig do + params( + header: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header::OrSymbol, + scheme: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme::OrSymbol + ).returns(T.attached_class) + end + def self.new(header:, scheme:) end - sig { override.returns({ header: Symbol, scheme: Symbol }) } + sig do + override.returns( + { + header: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header::TaggedSymbol, + scheme: + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme::TaggedSymbol + } + ) + end def to_hash end + + module Header + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let( + :Authorization, + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Header::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BEARER = + T.let( + :Bearer, + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::Scheme::TaggedSymbol + ] + ) + end + def self.values + end + end end module Status diff --git a/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi b/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi index 4b5088a..cb85cfd 100644 --- a/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi +++ b/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi @@ -245,19 +245,101 @@ module XTwitterScraper ) end - sig { returns(Symbol) } + sig do + returns( + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header::TaggedSymbol + ) + end attr_accessor :header - sig { returns(Symbol) } + sig do + returns( + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme::TaggedSymbol + ) + end attr_accessor :scheme - sig { params(header: Symbol, scheme: Symbol).returns(T.attached_class) } - def self.new(header: :Authorization, scheme: :Bearer) + sig do + params( + header: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header::OrSymbol, + scheme: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme::OrSymbol + ).returns(T.attached_class) + end + def self.new(header:, scheme:) end - sig { override.returns({ header: Symbol, scheme: Symbol }) } + sig do + override.returns( + { + header: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header::TaggedSymbol, + scheme: + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme::TaggedSymbol + } + ) + end def to_hash end + + module Header + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let( + :Authorization, + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Header::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BEARER = + T.let( + :Bearer, + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::Scheme::TaggedSymbol + ] + ) + end + def self.values + end + end end module CredentialNotice diff --git a/rbi/x_twitter_scraper/models/x/tweet_author.rbi b/rbi/x_twitter_scraper/models/x/tweet_author.rbi index 539887b..313a4fd 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_author.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_author.rbi @@ -12,23 +12,13 @@ module XTwitterScraper ) end - sig { returns(Integer) } - attr_accessor :followers - - sig { returns(T::Boolean) } - attr_accessor :verified - # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. - sig do - params(followers: Integer, verified: T::Boolean).returns( - T.attached_class - ) - end - def self.new(followers:, verified:) + sig { returns(T.attached_class) } + def self.new end - sig { override.returns({ followers: Integer, verified: T::Boolean }) } + sig { override.returns({}) } def to_hash end end diff --git a/rbi/x_twitter_scraper/models/x/x_account.rbi b/rbi/x_twitter_scraper/models/x/x_account.rbi index 8d964ae..1b1a736 100644 --- a/rbi/x_twitter_scraper/models/x/x_account.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account.rbi @@ -20,10 +20,10 @@ module XTwitterScraper sig { returns(Time) } attr_accessor :created_at - # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user - # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # Derived connection health. `healthy` = session active. `needsReauth` = user must + # submit fresh credentials. `locked` = X locked the account; unlock on x.com # first. `suspended` = X banned the account. `recovering` = past cooldown, will - # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry # shortly. sig { returns(XTwitterScraper::X::XAccount::Health::TaggedSymbol) } attr_accessor :health @@ -62,10 +62,10 @@ module XTwitterScraper def self.new( id:, created_at:, - # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user - # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # Derived connection health. `healthy` = session active. `needsReauth` = user must + # submit fresh credentials. `locked` = X locked the account; unlock on x.com # first. `suspended` = X banned the account. `recovering` = past cooldown, will - # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry # shortly. health:, status:, @@ -93,10 +93,10 @@ module XTwitterScraper def to_hash end - # Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user - # must submit fresh credentials. `locked` = X locked the account; unlock on x.com + # Derived connection health. `healthy` = session active. `needsReauth` = user must + # submit fresh credentials. `locked` = X locked the account; unlock on x.com # first. `suspended` = X banned the account. `recovering` = past cooldown, will - # auto-retry on next use. `temporaryIssue` = transient backend problem; retry + # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry # shortly. module Health extend XTwitterScraper::Internal::Type::Enum 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 8201186..2b364ab 100644 --- a/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/x_account_detail.rbi @@ -46,7 +46,7 @@ module XTwitterScraper sig { params(updated_at: Time).void } attr_writer :updated_at - # Full X account details with status, cookies, and update timestamp. + # Connected X account details with health and timestamp metadata. sig do params( id: String, diff --git a/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs b/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs index bb1d99a..d407306 100644 --- a/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs +++ b/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs @@ -86,16 +86,46 @@ module XTwitterScraper wallet_id: String } - type authorization = { header: :Authorization, scheme: :Bearer } + type authorization = + { + header: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::scheme + } class Authorization < XTwitterScraper::Internal::Type::BaseModel - attr_accessor header: :Authorization + attr_accessor header: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::header - attr_accessor scheme: :Bearer + attr_accessor scheme: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::scheme - def initialize: (?header: :Authorization, ?scheme: :Bearer) -> void + def initialize: ( + header: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::scheme + ) -> void - def to_hash: -> { header: :Authorization, scheme: :Bearer } + def to_hash: -> { + header: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::scheme + } + + type header = :Authorization + + module Header + extend XTwitterScraper::Internal::Type::Enum + + AUTHORIZATION: :Authorization + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::header] + end + + type scheme = :Bearer + + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + BEARER: :Bearer + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletCreateResponse::Authorization::scheme] + end end type status = diff --git a/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs b/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs index 1ddc17e..7a87a53 100644 --- a/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs +++ b/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs @@ -119,16 +119,46 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletTopupResponse::status] end - type authorization = { header: :Authorization, scheme: :Bearer } + type authorization = + { + header: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::scheme + } class Authorization < XTwitterScraper::Internal::Type::BaseModel - attr_accessor header: :Authorization + attr_accessor header: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::header - attr_accessor scheme: :Bearer + attr_accessor scheme: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::scheme - def initialize: (?header: :Authorization, ?scheme: :Bearer) -> void + def initialize: ( + header: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::scheme + ) -> void - def to_hash: -> { header: :Authorization, scheme: :Bearer } + def to_hash: -> { + header: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::header, + scheme: XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::scheme + } + + type header = :Authorization + + module Header + extend XTwitterScraper::Internal::Type::Enum + + AUTHORIZATION: :Authorization + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::header] + end + + type scheme = :Bearer + + module Scheme + extend XTwitterScraper::Internal::Type::Enum + + BEARER: :Bearer + + def self?.values: -> ::Array[XTwitterScraper::Models::GuestWalletTopupResponse::Authorization::scheme] + end end type credential_notice = diff --git a/sig/x_twitter_scraper/models/x/tweet_author.rbs b/sig/x_twitter_scraper/models/x/tweet_author.rbs index f8316db..b63afc7 100644 --- a/sig/x_twitter_scraper/models/x/tweet_author.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_author.rbs @@ -1,20 +1,12 @@ module XTwitterScraper module Models module X - type tweet_author = { followers: Integer, verified: bool } + type tweet_author = { } class TweetAuthor < XTwitterScraper::Models::UserProfile - def followers: -> Integer + def initialize: -> void - def followers=: (Integer _) -> Integer - - def verified: -> bool - - def verified=: (bool _) -> bool - - def initialize: (followers: Integer, verified: bool) -> void - - def to_hash: -> { followers: Integer, verified: bool } + def to_hash: -> { } end end end diff --git a/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb index d8baead..9973634 100644 --- a/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb +++ b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb @@ -6,7 +6,8 @@ class XTwitterScraper::Test::Resources::X::AccountConnectionChallengesTest < XTw def test_submit_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.account_connection_challenges.submit("id", email_code: "123456") + response = + @x_twitter_scraper.x.account_connection_challenges.submit("id", email_code: "") assert_pattern do response => XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse diff --git a/test/x_twitter_scraper/resources/x/accounts_test.rb b/test/x_twitter_scraper/resources/x/accounts_test.rb index f414fb2..129c002 100644 --- a/test/x_twitter_scraper/resources/x/accounts_test.rb +++ b/test/x_twitter_scraper/resources/x/accounts_test.rb @@ -8,9 +8,9 @@ def test_create_required_params response = @x_twitter_scraper.x.accounts.create( - email: "user@example.com", - password: "s3cur3Pa$$w0rd", - username: "elonmusk" + email: "account@example.invalid", + password: "", + username: "your_x_username" ) assert_pattern do @@ -103,7 +103,7 @@ def test_bulk_retry def test_reauth_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.accounts.reauth("id", password: "password_value") + response = @x_twitter_scraper.x.accounts.reauth("id", password: "") assert_pattern do response => XTwitterScraper::Models::X::AccountReauthResponse From b433f8d824bcb1ca60592d21d9f90b8baa79878a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 07:14:16 +0000 Subject: [PATCH 09/12] feat(api): propagate production write-action contract --- .stats.yml | 4 +- lib/x_twitter_scraper/models/error.rb | 36 +- .../models/support/ticket_create_params.rb | 8 +- .../models/support/ticket_create_response.rb | 37 +- .../models/support/ticket_reply_params.rb | 8 +- .../models/support/ticket_reply_response.rb | 37 +- .../support/ticket_retrieve_response.rb | 98 +- .../x/communities/join_create_params.rb | 9 +- .../x/communities/join_create_response.rb | 581 ++++++++- .../x/communities/join_delete_all_params.rb | 9 +- .../x/communities/join_delete_all_response.rb | 589 ++++++++- .../models/x/community_create_params.rb | 9 +- .../models/x/community_create_response.rb | 576 +++++++- .../models/x/community_delete_params.rb | 9 +- .../models/x/community_delete_response.rb | 580 ++++++++- .../models/x/dm_send_params.rb | 9 +- .../models/x/dm_send_response.rb | 580 ++++++++- .../models/x/media_upload_params.rb | 9 +- .../models/x/media_upload_response.rb | 579 ++++++++- .../models/x/profile_update_avatar_params.rb | 9 +- .../x/profile_update_avatar_response.rb | 580 ++++++++- .../models/x/profile_update_banner_params.rb | 9 +- .../x/profile_update_banner_response.rb | 580 ++++++++- .../models/x/profile_update_params.rb | 9 +- .../models/x/profile_update_response.rb | 580 ++++++++- .../models/x/tweet_create_params.rb | 10 +- .../models/x/tweet_create_response.rb | 563 +++++++- .../models/x/tweet_delete_params.rb | 9 +- .../models/x/tweet_delete_response.rb | 580 ++++++++- .../models/x/tweets/like_create_params.rb | 9 +- .../models/x/tweets/like_create_response.rb | 580 ++++++++- .../models/x/tweets/like_delete_params.rb | 9 +- .../models/x/tweets/like_delete_response.rb | 580 ++++++++- .../models/x/tweets/retweet_create_params.rb | 9 +- .../x/tweets/retweet_create_response.rb | 580 ++++++++- .../models/x/tweets/retweet_delete_params.rb | 9 +- .../x/tweets/retweet_delete_response.rb | 580 ++++++++- .../models/x/user_remove_follower_params.rb | 9 +- .../models/x/user_remove_follower_response.rb | 580 ++++++++- .../models/x/users/follow_create_params.rb | 9 +- .../models/x/users/follow_create_response.rb | 580 ++++++++- .../x/users/follow_delete_all_params.rb | 9 +- .../x/users/follow_delete_all_response.rb | 580 ++++++++- .../x/write_action_retrieve_response.rb | 521 +++++++- .../resources/support/tickets.rb | 32 +- lib/x_twitter_scraper/resources/x.rb | 1 - .../resources/x/communities.rb | 34 +- .../resources/x/communities/join.rb | 30 +- lib/x_twitter_scraper/resources/x/dm.rb | 19 +- lib/x_twitter_scraper/resources/x/media.rb | 22 +- lib/x_twitter_scraper/resources/x/profile.rb | 63 +- lib/x_twitter_scraper/resources/x/tweets.rb | 45 +- .../resources/x/tweets/like.rb | 30 +- .../resources/x/tweets/retweet.rb | 30 +- lib/x_twitter_scraper/resources/x/users.rb | 15 +- .../resources/x/users/follow.rb | 30 +- rbi/x_twitter_scraper/models/error.rbi | 62 +- .../models/support/ticket_create_params.rbi | 10 +- .../models/support/ticket_create_response.rbi | 126 +- .../models/support/ticket_reply_params.rbi | 10 +- .../models/support/ticket_reply_response.rbi | 126 +- .../support/ticket_retrieve_response.rbi | 271 +++- .../x/communities/join_create_params.rbi | 6 + .../x/communities/join_create_response.rbi | 1157 ++++++++++++++++- .../x/communities/join_delete_all_params.rbi | 6 + .../communities/join_delete_all_response.rbi | 1157 ++++++++++++++++- .../models/x/community_create_params.rbi | 6 + .../models/x/community_create_response.rbi | 1132 +++++++++++++++- .../models/x/community_delete_params.rbi | 6 + .../models/x/community_delete_response.rbi | 1151 +++++++++++++++- .../models/x/dm_send_params.rbi | 6 + .../models/x/dm_send_response.rbi | 1118 +++++++++++++++- .../models/x/media_upload_params.rbi | 6 + .../models/x/media_upload_response.rbi | 1133 +++++++++++++++- .../models/x/profile_update_avatar_params.rbi | 6 + .../x/profile_update_avatar_response.rbi | 1155 +++++++++++++++- .../models/x/profile_update_banner_params.rbi | 6 + .../x/profile_update_banner_response.rbi | 1155 +++++++++++++++- .../models/x/profile_update_params.rbi | 6 + .../models/x/profile_update_response.rbi | 1147 +++++++++++++++- .../models/x/tweet_create_params.rbi | 13 +- .../models/x/tweet_create_response.rbi | 1122 +++++++++++++++- .../models/x/tweet_delete_params.rbi | 6 + .../models/x/tweet_delete_response.rbi | 1143 +++++++++++++++- .../models/x/tweets/like_create_params.rbi | 6 + .../models/x/tweets/like_create_response.rbi | 1157 ++++++++++++++++- .../models/x/tweets/like_delete_params.rbi | 6 + .../models/x/tweets/like_delete_response.rbi | 1157 ++++++++++++++++- .../models/x/tweets/retweet_create_params.rbi | 6 + .../x/tweets/retweet_create_response.rbi | 1157 ++++++++++++++++- .../models/x/tweets/retweet_delete_params.rbi | 6 + .../x/tweets/retweet_delete_response.rbi | 1157 ++++++++++++++++- .../models/x/user_remove_follower_params.rbi | 6 + .../x/user_remove_follower_response.rbi | 1155 +++++++++++++++- .../models/x/users/follow_create_params.rbi | 6 + .../models/x/users/follow_create_response.rbi | 1157 ++++++++++++++++- .../x/users/follow_delete_all_params.rbi | 6 + .../x/users/follow_delete_all_response.rbi | 1157 ++++++++++++++++- .../x/write_action_retrieve_response.rbi | 996 +++++++++++++- .../resources/support/tickets.rbi | 19 +- rbi/x_twitter_scraper/resources/x.rbi | 1 - .../resources/x/communities.rbi | 24 +- .../resources/x/communities/join.rbi | 20 +- rbi/x_twitter_scraper/resources/x/dm.rbi | 13 +- rbi/x_twitter_scraper/resources/x/media.rbi | 11 +- rbi/x_twitter_scraper/resources/x/profile.rbi | 35 +- rbi/x_twitter_scraper/resources/x/tweets.rbi | 41 +- .../resources/x/tweets/like.rbi | 20 +- .../resources/x/tweets/retweet.rbi | 20 +- rbi/x_twitter_scraper/resources/x/users.rbi | 10 +- .../resources/x/users/follow.rbi | 20 +- sig/x_twitter_scraper/models/error.rbs | 45 +- .../models/support/ticket_create_params.rbs | 8 +- .../models/support/ticket_create_response.rbs | 56 +- .../models/support/ticket_reply_params.rbs | 8 +- .../models/support/ticket_reply_response.rbs | 56 +- .../support/ticket_retrieve_response.rbs | 115 +- .../x/communities/join_create_params.rbs | 6 +- .../x/communities/join_create_response.rbs | 544 +++++++- .../x/communities/join_delete_all_params.rbs | 6 +- .../communities/join_delete_all_response.rbs | 544 +++++++- .../models/x/community_create_params.rbs | 11 +- .../models/x/community_create_response.rbs | 535 +++++++- .../models/x/community_delete_params.rbs | 11 +- .../models/x/community_delete_response.rbs | 544 +++++++- .../models/x/dm_send_params.rbs | 5 + .../models/x/dm_send_response.rbs | 544 +++++++- .../models/x/media_upload_params.rbs | 6 +- .../models/x/media_upload_response.rbs | 541 +++++++- .../models/x/profile_update_avatar_params.rbs | 6 +- .../x/profile_update_avatar_response.rbs | 544 +++++++- .../models/x/profile_update_banner_params.rbs | 6 +- .../x/profile_update_banner_response.rbs | 544 +++++++- .../models/x/profile_update_params.rbs | 5 + .../models/x/profile_update_response.rbs | 544 +++++++- .../models/x/tweet_create_params.rbs | 10 +- .../models/x/tweet_create_response.rbs | 529 +++++++- .../models/x/tweet_delete_params.rbs | 6 +- .../models/x/tweet_delete_response.rbs | 544 +++++++- .../models/x/tweets/like_create_params.rbs | 6 +- .../models/x/tweets/like_create_response.rbs | 544 +++++++- .../models/x/tweets/like_delete_params.rbs | 6 +- .../models/x/tweets/like_delete_response.rbs | 544 +++++++- .../models/x/tweets/retweet_create_params.rbs | 6 +- .../x/tweets/retweet_create_response.rbs | 544 +++++++- .../models/x/tweets/retweet_delete_params.rbs | 6 +- .../x/tweets/retweet_delete_response.rbs | 544 +++++++- .../models/x/user_remove_follower_params.rbs | 6 +- .../x/user_remove_follower_response.rbs | 544 +++++++- .../models/x/users/follow_create_params.rbs | 6 +- .../models/x/users/follow_create_response.rbs | 544 +++++++- .../x/users/follow_delete_all_params.rbs | 6 +- .../x/users/follow_delete_all_response.rbs | 544 +++++++- .../x/write_action_retrieve_response.rbs | 482 ++++++- .../resources/support/tickets.rbs | 2 + .../resources/x/communities.rbs | 2 + .../resources/x/communities/join.rbs | 2 + sig/x_twitter_scraper/resources/x/dm.rbs | 1 + sig/x_twitter_scraper/resources/x/media.rbs | 1 + sig/x_twitter_scraper/resources/x/profile.rbs | 3 + sig/x_twitter_scraper/resources/x/tweets.rbs | 3 +- .../resources/x/tweets/like.rbs | 2 + .../resources/x/tweets/retweet.rbs | 2 + sig/x_twitter_scraper/resources/x/users.rbs | 1 + .../resources/x/users/follow.rbs | 2 + .../resources/support/tickets_test.rb | 2 + .../resources/x/communities/join_test.rb | 102 +- .../resources/x/communities_test.rb | 104 +- test/x_twitter_scraper/resources/x/dm_test.rb | 53 +- .../resources/x/media_test.rb | 53 +- .../resources/x/profile_test.rb | 146 ++- .../resources/x/tweets/like_test.rb | 94 +- .../resources/x/tweets/retweet_test.rb | 102 +- .../resources/x/tweets_test.rb | 93 +- .../resources/x/users/follow_test.rb | 98 +- .../resources/x/users_test.rb | 51 +- .../resources/x/write_actions_test.rb | 39 +- 177 files changed, 45187 insertions(+), 734 deletions(-) diff --git a/.stats.yml b/.stats.yml index b67870c..d174a6f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-d053a3e575a411e23fdd316b0b97626192c13564ef91814a4831e20a809cfdc5.yml -openapi_spec_hash: 0dc9eb7d023b1a16c08c6fec5a231957 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-1a468d8933b6612e40e8b8ebdf84f9e3f014799d0e9a05789b93a242324cd158.yml +openapi_spec_hash: 25b9bc2b3b13c649eccc0a8624c233d3 config_hash: 4b64fbd16fd09008417c5a460d27f053 diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index eb1aa4d..0061c01 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -8,12 +8,44 @@ class Error < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::Error::Error::LegacyErrorCode, XTwitterScraper::Models::Error::Error::StructuredError] required :error, union: -> { XTwitterScraper::Error::Error } - # @!method initialize(error:) + # @!attribute message + # Human-readable error guidance. + # + # @return [String, nil] + optional :message, String + + # @!attribute reason + # Machine-readable reason for a login cooldown. + # + # @return [String, nil] + optional :reason, String + + # @!attribute retry_after + # Required wait in seconds. + # + # @return [Integer, nil] + optional :retry_after, Integer, api_name: :retryAfter + + # @!attribute retry_after_ms + # Required wait in milliseconds. + # + # @return [Integer, nil] + optional :retry_after_ms, Integer, api_name: :retryAfterMs + + # @!method initialize(error:, message: nil, reason: nil, retry_after: nil, retry_after_ms: nil) # Error response. Default v1 returns a legacy string error code. Send # `xquik-api-contract: 2026-04-29` to receive the structured best-practice error # object. # # @param error [Symbol, XTwitterScraper::Models::Error::Error::LegacyErrorCode, XTwitterScraper::Models::Error::Error::StructuredError] + # + # @param message [String] Human-readable error guidance. + # + # @param reason [String] Machine-readable reason for a login cooldown. + # + # @param retry_after [Integer] Required wait in seconds. + # + # @param retry_after_ms [Integer] Required wait in milliseconds. # @see XTwitterScraper::Models::Error#error module Error @@ -92,7 +124,6 @@ module LegacyErrorCode X_USER_LOOKUP_FAILED = :x_user_lookup_failed X_WRITE_AMBIGUOUS = :x_write_ambiguous X_WRITE_FAILED = :x_write_failed - X_WRITE_UNCONFIRMED = :x_write_unconfirmed # @!method self.values # @return [Array] @@ -189,7 +220,6 @@ module Code X_USER_LOOKUP_FAILED = :x_user_lookup_failed X_WRITE_AMBIGUOUS = :x_write_ambiguous X_WRITE_FAILED = :x_write_failed - X_WRITE_UNCONFIRMED = :x_write_unconfirmed # @!method self.values # @return [Array] diff --git a/lib/x_twitter_scraper/models/support/ticket_create_params.rb b/lib/x_twitter_scraper/models/support/ticket_create_params.rb index ffad8dc..72f7822 100644 --- a/lib/x_twitter_scraper/models/support/ticket_create_params.rb +++ b/lib/x_twitter_scraper/models/support/ticket_create_params.rb @@ -18,9 +18,15 @@ class TicketCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :subject, String - # @!method initialize(body:, subject:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(body:, subject:, idempotency_key: nil, request_options: {}) # @param body [String] # @param subject [String] + # @param idempotency_key [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/support/ticket_create_response.rb b/lib/x_twitter_scraper/models/support/ticket_create_response.rb index 813b9ec..2e8bd61 100644 --- a/lib/x_twitter_scraper/models/support/ticket_create_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_create_response.rb @@ -5,13 +5,48 @@ module Models module Support # @see XTwitterScraper::Resources::Support::Tickets#create class TicketCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute attachments + # + # @return [Array, nil] + optional :attachments, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] } + # @!attribute public_id # # @return [String, nil] optional :public_id, String, api_name: :publicId - # @!method initialize(public_id: nil) + # @!method initialize(attachments: nil, public_id: nil) + # @param attachments [Array] # @param public_id [String] + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + # @!attribute public_id + # + # @return [String] + required :public_id, String, api_name: :publicId + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status] + required :status, enum: -> { XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status } + + # @!method initialize(public_id:, status:) + # @param public_id [String] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status] + + # @see XTwitterScraper::Models::Support::TicketCreateResponse::Attachment#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING = :pending + READY = :ready + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_reply_params.rb b/lib/x_twitter_scraper/models/support/ticket_reply_params.rb index ecdf38b..1270730 100644 --- a/lib/x_twitter_scraper/models/support/ticket_reply_params.rb +++ b/lib/x_twitter_scraper/models/support/ticket_reply_params.rb @@ -18,9 +18,15 @@ class TicketReplyParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :body, String - # @!method initialize(id:, body:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(id:, body:, idempotency_key: nil, request_options: {}) # @param id [String] # @param body [String] + # @param idempotency_key [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/support/ticket_reply_response.rb b/lib/x_twitter_scraper/models/support/ticket_reply_response.rb index a3c15a1..2982486 100644 --- a/lib/x_twitter_scraper/models/support/ticket_reply_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_reply_response.rb @@ -5,13 +5,48 @@ module Models module Support # @see XTwitterScraper::Resources::Support::Tickets#reply class TicketReplyResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute attachments + # + # @return [Array, nil] + optional :attachments, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] } + # @!attribute public_id # # @return [String, nil] optional :public_id, String, api_name: :publicId - # @!method initialize(public_id: nil) + # @!method initialize(attachments: nil, public_id: nil) + # @param attachments [Array] # @param public_id [String] + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + # @!attribute public_id + # + # @return [String] + required :public_id, String, api_name: :publicId + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status] + required :status, enum: -> { XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status } + + # @!method initialize(public_id:, status:) + # @param public_id [String] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status] + + # @see XTwitterScraper::Models::Support::TicketReplyResponse::Attachment#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING = :pending + READY = :ready + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb index 413883f..df9db57 100644 --- a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb @@ -45,6 +45,12 @@ class TicketRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @param updated_at [Time] class Message < XTwitterScraper::Internal::Type::BaseModel + # @!attribute attachments + # + # @return [Array, nil] + optional :attachments, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] } + # @!attribute body # # @return [String, nil] @@ -60,10 +66,100 @@ class Message < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :sender, String - # @!method initialize(body: nil, created_at: nil, sender: nil) + # @!method initialize(attachments: nil, body: nil, created_at: nil, sender: nil) + # @param attachments [Array] # @param body [String] # @param created_at [Time] # @param sender [String] + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + # @!attribute content_type + # + # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType] + required :content_type, + enum: -> { XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType }, + api_name: :contentType + + # @!attribute filename + # + # @return [String] + required :filename, String + + # @!attribute kind + # + # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind] + required :kind, + enum: -> { XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind } + + # @!attribute public_id + # + # @return [String] + required :public_id, String, api_name: :publicId + + # @!attribute size_bytes + # + # @return [Integer] + required :size_bytes, Integer, api_name: :sizeBytes + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status] + required :status, + enum: -> { XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status } + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(content_type:, filename:, kind:, public_id:, size_bytes:, status:, url:) + # @param content_type [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType] + # @param filename [String] + # @param kind [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind] + # @param public_id [String] + # @param size_bytes [Integer] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status] + # @param url [String] + + # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#content_type + module ContentType + extend XTwitterScraper::Internal::Type::Enum + + IMAGE_JPEG = :"image/jpeg" + IMAGE_PNG = :"image/png" + IMAGE_GIF = :"image/gif" + IMAGE_WEBP = :"image/webp" + VIDEO_MP4 = :"video/mp4" + VIDEO_QUICKTIME = :"video/quicktime" + VIDEO_WEBM = :"video/webm" + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#kind + module Kind + extend XTwitterScraper::Internal::Type::Enum + + IMAGE = :image + VIDEO = :video + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING = :pending + READY = :ready + FAILED = :failed + + # @!method self.values + # @return [Array] + 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 239256b..0d7fff2 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 @@ -20,11 +20,18 @@ class JoinCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 index dee9156..aab2292 100644 --- a/lib/x_twitter_scraper/models/x/communities/join_create_response.rb +++ b/lib/x_twitter_scraper/models/x/communities/join_create_response.rb @@ -6,13 +6,586 @@ module X module Communities # @see XTwitterScraper::Resources::X::Communities::Join#create class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::JoinCreateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status] + required :status, + enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + 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 7b3e401..eab1b41 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 @@ -20,11 +20,18 @@ class JoinDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 index 170190e..cefcde3 100644 --- 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 @@ -6,13 +6,594 @@ module X module Communities # @see XTwitterScraper::Resources::X::Communities::Join#delete_all class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account, nil] + required :account, + -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account }, + nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result, nil] + required :result, + -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result }, + nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target, nil] + required :target, + -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target }, + nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse} for more + # details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status] + required :status, + enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type] + required :type, + enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end 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 fcab891..202d494 100644 --- a/lib/x_twitter_scraper/models/x/community_create_params.rb +++ b/lib/x_twitter_scraper/models/x/community_create_params.rb @@ -20,17 +20,24 @@ class CommunityCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :name, String + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + # @!attribute description # Community description # # @return [String, nil] optional :description, String - # @!method initialize(account:, name:, description: nil, request_options: {}) + # @!method initialize(account:, name:, idempotency_key:, description: nil, request_options: {}) # @param account [String] X account (@username or ID) creating the community # # @param name [String] Community name # + # @param idempotency_key [String] + # # @param description [String] Community description # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/x_twitter_scraper/models/x/community_create_response.rb b/lib/x_twitter_scraper/models/x/community_create_response.rb index f30cd89..de9cad2 100644 --- a/lib/x_twitter_scraper/models/x/community_create_response.rb +++ b/lib/x_twitter_scraper/models/x/community_create_response.rb @@ -5,25 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Communities#create class CommunityCreateResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute community_id + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::CommunityCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::CommunityCreateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::CommunityCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::CommunityCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::CommunityCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::Status } + + # @!attribute status_url # # @return [String] - required :community_id, String, api_name: :communityId + required :status_url, String, api_name: :statusUrl # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::CommunityCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::CommunityCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId # @!attribute community_name + # Confirmed community name when available. # # @return [String, nil] optional :community_name, String, api_name: :communityName - # @!method initialize(community_id:, community_name: nil, success: true) - # @param community_id [String] - # @param community_name [String] - # @param success [Boolean, true] + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityCreateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::CommunityCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::CommunityCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::CommunityCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::CommunityCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::CommunityCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::CommunityCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::CommunityCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::CommunityCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::CommunityCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::CommunityCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::CommunityCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community + + # @!method self.values + # @return [Array] + end + end end end end 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 fbc8a83..8c4eda7 100644 --- a/lib/x_twitter_scraper/models/x/community_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/community_delete_params.rb @@ -25,13 +25,20 @@ class CommunityDeleteParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :community_name, String - # @!method initialize(id:, account:, community_name:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, community_name:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account (@username or ID) deleting the community # # @param community_name [String] Community name for confirmation # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/community_delete_response.rb b/lib/x_twitter_scraper/models/x/community_delete_response.rb index c7f18ac..830dc80 100644 --- a/lib/x_twitter_scraper/models/x/community_delete_response.rb +++ b/lib/x_twitter_scraper/models/x/community_delete_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Communities#delete class CommunityDeleteResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::Request] + required :request, -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::CommunityDeleteResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityDeleteResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::CommunityDeleteResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::CommunityDeleteResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::CommunityDeleteResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::CommunityDeleteResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::CommunityDeleteResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type] + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type] + + # @see XTwitterScraper::Models::X::CommunityDeleteResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end 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 cfd99cd..4ac09dc 100644 --- a/lib/x_twitter_scraper/models/x/dm_send_params.rb +++ b/lib/x_twitter_scraper/models/x/dm_send_params.rb @@ -24,19 +24,26 @@ class DmSendParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :text, String + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + # @!attribute media_ids # Optional array containing exactly 1 uploaded media ID. # # @return [Array, nil] optional :media_ids, XTwitterScraper::Internal::Type::ArrayOf[String] - # @!method initialize(user_id:, account:, text:, media_ids: nil, request_options: {}) + # @!method initialize(user_id:, account:, text:, idempotency_key:, media_ids: nil, request_options: {}) # @param user_id [String] # # @param account [String] X account (@username or ID) sending the DM # # @param text [String] # + # @param idempotency_key [String] + # # @param media_ids [Array] Optional array containing exactly 1 uploaded media ID. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/x_twitter_scraper/models/x/dm_send_response.rb b/lib/x_twitter_scraper/models/x/dm_send_response.rb index 34e892f..3f7b35e 100644 --- a/lib/x_twitter_scraper/models/x/dm_send_response.rb +++ b/lib/x_twitter_scraper/models/x/dm_send_response.rb @@ -5,19 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Dm#send_ class DmSendResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute message_id + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::DmSendResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::DmSendResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::DmSendResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits # # @return [String] - required :message_id, String, api_name: :messageId + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::DmSendResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::Request] + required :request, -> { XTwitterScraper::Models::X::DmSendResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::DmSendResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::DmSendResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::DmSendResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::DmSendResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::DmSendResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::DmSendResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::DmSendResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::DmSendResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::DmSendResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::DmSendResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::DmSendResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::DmSendResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::DmSendResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::DmSendResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::DmSendResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::DmSendResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::DmSendResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::DmSendResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::DmSendResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::DmSendResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::DmSendResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::DmSendResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::DmSendResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::DmSendResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::DmSendResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::DmSendResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::DmSendResponse::Result::Type] + + # @see XTwitterScraper::Models::X::DmSendResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::DmSendResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::DmSendResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::DmSendResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::DmSendResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::DmSendResponse::Target::Type] + + # @see XTwitterScraper::Models::X::DmSendResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(message_id:, success: true) - # @param message_id [String] - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end 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 408953b..e1dd470 100644 --- a/lib/x_twitter_scraper/models/x/media_upload_params.rb +++ b/lib/x_twitter_scraper/models/x/media_upload_params.rb @@ -20,11 +20,18 @@ class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :url, String - # @!method initialize(account:, url:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(account:, url:, idempotency_key:, request_options: {}) # @param account [String] X account (@username or ID) uploading media from URL # # @param url [String] HTTPS URL to download and upload as media # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/media_upload_response.rb b/lib/x_twitter_scraper/models/x/media_upload_response.rb index 674668e..424e8d8 100644 --- a/lib/x_twitter_scraper/models/x/media_upload_response.rb +++ b/lib/x_twitter_scraper/models/x/media_upload_response.rb @@ -5,28 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Media#upload class MediaUploadResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute media_id + # @!attribute id # # @return [String] - required :media_id, String, api_name: :mediaId + required :id, String - # @!attribute media_url - # Public media URL for tweet `media` arrays. + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::MediaUploadResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::MediaUploadResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits # # @return [String] - required :media_url, String, api_name: :mediaUrl + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::MediaUploadResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::Request] + required :request, -> { XTwitterScraper::Models::X::MediaUploadResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::MediaUploadResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::MediaUploadResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::MediaUploadResponse::Target }, nil?: true - # @!method initialize(media_id:, media_url:, success: true) - # @param media_id [String] + # @!attribute target_id # - # @param media_url [String] Public media URL for tweet `media` arrays. + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::MediaUploadResponse} for more details. # - # @param success [Boolean, true] + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::MediaUploadResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::MediaUploadResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::MediaUploadResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::MediaUploadResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::MediaUploadResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::MediaUploadResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::MediaUploadResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::MediaUploadResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::MediaUploadResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Result::Type] + + # @see XTwitterScraper::Models::X::MediaUploadResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::MediaUploadResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::MediaUploadResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::MediaUploadResponse::Target::Type] + + # @see XTwitterScraper::Models::X::MediaUploadResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community + + # @!method self.values + # @return [Array] + end + end end end end 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 b4a63d2..b91e53e 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 @@ -20,11 +20,18 @@ class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :url, String - # @!method initialize(account:, url:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(account:, url:, idempotency_key:, request_options: {}) # @param account [String] X account (@username or ID) receiving avatar from URL # # @param url [String] HTTPS URL to the avatar image to download # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb b/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb index 568798a..2949bf9 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Profile#update_avatar class ProfileUpdateAvatarResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request] + required :request, -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateAvatarResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end 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 f646929..3e71896 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 @@ -20,11 +20,18 @@ class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :url, String - # @!method initialize(account:, url:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(account:, url:, idempotency_key:, request_options: {}) # @param account [String] X account (@username or ID) receiving banner from URL # # @param url [String] HTTPS URL to the banner image to download # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb b/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb index 207dc37..5bea45f 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Profile#update_banner class ProfileUpdateBannerResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request] + required :request, -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateBannerResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end 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 b96a96a..c9fa18d 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_params.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_params.rb @@ -14,6 +14,11 @@ class ProfileUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + # @!attribute description # Bio description # @@ -37,9 +42,11 @@ class ProfileUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :url, String - # @!method initialize(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) + # @!method initialize(account:, idempotency_key:, description: nil, location: nil, name: nil, url: nil, request_options: {}) # @param account [String] X account (@username or ID) to update profile # + # @param idempotency_key [String] + # # @param description [String] Bio description # # @param location [String] diff --git a/lib/x_twitter_scraper/models/x/profile_update_response.rb b/lib/x_twitter_scraper/models/x/profile_update_response.rb index c5dfc16..c1105cd 100644 --- a/lib/x_twitter_scraper/models/x/profile_update_response.rb +++ b/lib/x_twitter_scraper/models/x/profile_update_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Profile#update class ProfileUpdateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::ProfileUpdateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::ProfileUpdateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::ProfileUpdateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::ProfileUpdateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::ProfileUpdateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::ProfileUpdateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::ProfileUpdateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_create_params.rb b/lib/x_twitter_scraper/models/x/tweet_create_params.rb index cef87b1..7fa161a 100644 --- a/lib/x_twitter_scraper/models/x/tweet_create_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_create_params.rb @@ -14,10 +14,10 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!attribute attachment_url + # @!attribute idempotency_key # - # @return [String, nil] - optional :attachment_url, String + # @return [String] + required :idempotency_key, String # @!attribute community_id # @@ -48,13 +48,13 @@ class TweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :text, String - # @!method initialize(account:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) + # @!method initialize(account:, idempotency_key:, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetCreateParams} for more details. # # @param account [String] X account (@username or account ID) # - # @param attachment_url [String] + # @param idempotency_key [String] # # @param community_id [String] # diff --git a/lib/x_twitter_scraper/models/x/tweet_create_response.rb b/lib/x_twitter_scraper/models/x/tweet_create_response.rb index 9f7ca0b..60c7eb9 100644 --- a/lib/x_twitter_scraper/models/x/tweet_create_response.rb +++ b/lib/x_twitter_scraper/models/x/tweet_create_response.rb @@ -5,46 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Tweets#create class TweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::TweetCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::TweetCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::TweetCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::TweetCreateResponse::Billing } + # @!attribute charged # # @return [Boolean] required :charged, XTwitterScraper::Internal::Type::Boolean # @!attribute charged_credits - # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; - # attached media adds 2 credits per started MB. # # @return [String] required :charged_credits, String, api_name: :chargedCredits - # @!attribute success + # @!attribute next_action + # Exact follow-up an API client or agent should perform. # - # @return [Boolean, true] - required :success, const: true + # @return [XTwitterScraper::Models::X::TweetCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::TweetCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true - # @!attribute tweet_id + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::TweetCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::TweetCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::TweetCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::TweetCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::Status } + + # @!attribute status_url # # @return [String] - required :tweet_id, String, api_name: :tweetId + required :status_url, String, api_name: :statusUrl + + # @!attribute success + # + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::TweetCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::TweetCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean # @!attribute write_action_id # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # # @return [String, nil] - optional :write_action_id, String, api_name: :writeActionId + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt - # @!method initialize(charged:, charged_credits:, tweet_id:, write_action_id: nil, success: true) + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetCreateResponse} for more details. # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::TweetCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::TweetCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # # @param charged [Boolean] # - # @param charged_credits [String] Credits charged for this tweet. Text-only tweets and replies cost 30 credits; at + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::TweetCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::TweetCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::TweetCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Status] + # + # @param status_url [String] # - # @param tweet_id [String] + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::TweetCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] # # @param write_action_id [String] # - # @param success [Boolean, true] + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::TweetCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::TweetCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::TweetCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::TweetCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::TweetCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::TweetCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::TweetCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::TweetCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community + + # @!method self.values + # @return [Array] + end + end end end end 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 cc4c0d2..952d6d2 100644 --- a/lib/x_twitter_scraper/models/x/tweet_delete_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_delete_params.rb @@ -19,11 +19,18 @@ class TweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweet_delete_response.rb b/lib/x_twitter_scraper/models/x/tweet_delete_response.rb index 8316b1c..afa3f85 100644 --- a/lib/x_twitter_scraper/models/x/tweet_delete_response.rb +++ b/lib/x_twitter_scraper/models/x/tweet_delete_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Tweets#delete class TweetDeleteResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::TweetDeleteResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::TweetDeleteResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::TweetDeleteResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::Request] + required :request, -> { XTwitterScraper::Models::X::TweetDeleteResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::TweetDeleteResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::TweetDeleteResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::TweetDeleteResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetDeleteResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::TweetDeleteResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::TweetDeleteResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::TweetDeleteResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::TweetDeleteResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::TweetDeleteResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::TweetDeleteResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::TweetDeleteResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::TweetDeleteResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type] + + # @see XTwitterScraper::Models::X::TweetDeleteResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::TweetDeleteResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type] + + # @see XTwitterScraper::Models::X::TweetDeleteResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + 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 81be06b..f9c9383 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 @@ -20,11 +20,18 @@ class LikeCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb b/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb index 57247ba..fd4e6e8 100644 --- a/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb +++ b/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb @@ -6,13 +6,585 @@ module X module Tweets # @see XTwitterScraper::Resources::X::Tweets::Like#create class LikeCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::LikeCreateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end 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 5957625..464dc53 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 @@ -20,11 +20,18 @@ class LikeDeleteParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb b/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb index c65f121..37b5626 100644 --- a/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb +++ b/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb @@ -6,13 +6,585 @@ module X module Tweets # @see XTwitterScraper::Resources::X::Tweets::Like#delete class LikeDeleteResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::LikeDeleteResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end 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 f1626c2..b7e64a5 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 @@ -20,11 +20,18 @@ class RetweetCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb b/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb index 0c1b16d..ca7c0e2 100644 --- a/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb +++ b/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb @@ -6,13 +6,585 @@ module X module Tweets # @see XTwitterScraper::Resources::X::Tweets::Retweet#create class RetweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::RetweetCreateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end 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 115dc5e..85b333f 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 @@ -20,11 +20,18 @@ class RetweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb b/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb index 581ce97..5c1b670 100644 --- a/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb +++ b/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb @@ -6,13 +6,585 @@ module X module Tweets # @see XTwitterScraper::Resources::X::Tweets::Retweet#delete class RetweetDeleteResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb b/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb index e491002..bb0ad37 100644 --- a/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb +++ b/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb @@ -19,11 +19,18 @@ class UserRemoveFollowerParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb b/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb index 915143a..50ebb48 100644 --- a/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb +++ b/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb @@ -5,13 +5,585 @@ module Models module X # @see XTwitterScraper::Resources::X::Users#remove_follower class UserRemoveFollowerResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request] + required :request, -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRemoveFollowerResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type] + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type] + + # @see XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end 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 ae79adb..7a5c048 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 @@ -20,11 +20,18 @@ class FollowCreateParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/users/follow_create_response.rb b/lib/x_twitter_scraper/models/x/users/follow_create_response.rb index d59b4eb..a28f7eb 100644 --- a/lib/x_twitter_scraper/models/x/users/follow_create_response.rb +++ b/lib/x_twitter_scraper/models/x/users/follow_create_response.rb @@ -6,13 +6,585 @@ module X module Users # @see XTwitterScraper::Resources::X::Users::Follow#create class FollowCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Users::FollowCreateResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Users::FollowCreateResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Users::FollowCreateResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Users::FollowCreateResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Users::FollowCreateResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Users::FollowCreateResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Users::FollowCreateResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end 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 76b44c9..d7cd974 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 @@ -20,11 +20,18 @@ class FollowDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :account, String - # @!method initialize(id:, account:, request_options: {}) + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!method initialize(id:, account:, idempotency_key:, request_options: {}) # @param id [String] # # @param account [String] X account identifier (@username or account ID) # + # @param idempotency_key [String] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb b/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb index a8afee1..05869f3 100644 --- a/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb +++ b/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb @@ -6,13 +6,585 @@ module X module Users # @see XTwitterScraper::Resources::X::Users::Follow#delete_all class FollowDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing } + + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute next_action + # Exact follow-up an API client or agent should perform. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction }, + api_name: :nextAction, + nil?: true + + # @!attribute object + # + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request] + required :request, -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result }, nil?: true + + # @!attribute retryable + # True only when a new attempt can reasonably succeed. + # + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry + + # @!attribute send_dispatched + # + # @return [Boolean] + required :send_dispatched, XTwitterScraper::Internal::Type::Boolean, api_name: :sendDispatched + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status } + + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + # @!attribute success # - # @return [Boolean, true] - required :success, const: true + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + + # @!attribute write_action_id + # + # @return [String] + required :write_action_id, String, api_name: :writeActionId + + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + + # @!attribute confirmation_attempts + # + # @return [Integer, nil] + optional :confirmation_attempts, Integer, api_name: :confirmationAttempts + + # @!attribute confirmation_checked_at + # + # @return [Time, nil] + optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt + + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error + # + # @return [String, nil] + optional :error, String + + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + # + # @return [Time, nil] + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl + + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!attribute message_id + # Compatibility field for a confirmed direct message ID. + # + # @return [String, nil] + optional :message_id, String, api_name: :messageId + + # @!attribute request_hash + # + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash + + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. + # + # @return [String, nil] + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + + # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. + # + # @return [String, nil] + optional :tweet_id, String, api_name: :tweetId + + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Users::FollowDeleteAllResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # + # @param charged [Boolean] + # + # @param charged_credits [String] + # + # @param next_action [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # + # @param send_dispatched [Boolean] + # + # @param status [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # + # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # + # @param confirmation_attempts [Integer] + # + # @param confirmation_checked_at [Time] + # + # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # + # @param message [String] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged + # + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean + + # @!attribute charged_credits + # + # @return [String] + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type } + + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type] + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation + SUCCESS = :success + FAILED = :failed + EXPIRED = :expired + + # @!method self.values + # @return [Array] + end + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type] + + # @see XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community - # @!method initialize(success: true) - # @param success [Boolean, true] + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb b/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb index 37bcc93..a3f4b70 100644 --- a/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb @@ -5,10 +5,28 @@ module Models module X # @see XTwitterScraper::Resources::X::WriteActions#retrieve class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - # @!attribute action + # @!attribute id # # @return [String] - required :action, String + required :id, String + + # @!attribute account + # Connected account selected for the write. + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account, nil] + required :account, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account }, nil?: true + + # @!attribute action + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action] + required :action, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action } + + # @!attribute billing + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing] + required :billing, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing } # @!attribute charged # @@ -20,20 +38,48 @@ class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :charged_credits, String, api_name: :chargedCredits - # @!attribute created_at + # @!attribute next_action + # Exact follow-up an API client or agent should perform. # - # @return [Time] - required :created_at, Time, api_name: :createdAt + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction, nil] + required :next_action, + -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction }, + api_name: :nextAction, + nil?: true - # @!attribute media + # @!attribute object # - # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media] - required :media, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media } + # @return [Symbol, :x_write_action] + required :object, const: :x_write_action + + # @!attribute poll_after_ms + # + # @return [Integer, nil] + required :poll_after_ms, Integer, api_name: :pollAfterMs, nil?: true + + # @!attribute request + # Stable fingerprint and sanitized payload for replay checks. + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request] + required :request, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request } + + # @!attribute result + # Confirmed result produced by the write, when available. + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result, nil] + required :result, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result }, nil?: true # @!attribute retryable + # True only when a new attempt can reasonably succeed. # - # @return [Boolean, false] - required :retryable, const: false + # @return [Boolean] + required :retryable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute safe_to_retry + # True only when no write was dispatched and a new idempotency key may be used. + # + # @return [Boolean] + required :safe_to_retry, XTwitterScraper::Internal::Type::Boolean, api_name: :safeToRetry # @!attribute send_dispatched # @@ -45,11 +91,54 @@ class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status] required :status, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status } + # @!attribute status_url + # + # @return [String] + required :status_url, String, api_name: :statusUrl + + # @!attribute success + # + # @return [Boolean] + required :success, XTwitterScraper::Internal::Type::Boolean + + # @!attribute target + # Existing X resource targeted by the write, when applicable. + # + # @return [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target, nil] + required :target, -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target }, nil?: true + + # @!attribute target_id + # + # @return [String, nil] + required :target_id, String, api_name: :targetId, nil?: true + + # @!attribute terminal + # + # @return [Boolean] + required :terminal, XTwitterScraper::Internal::Type::Boolean + # @!attribute write_action_id # # @return [String] required :write_action_id, String, api_name: :writeActionId + # @!attribute community_id + # Compatibility field for a confirmed community ID. + # + # @return [String, nil] + optional :community_id, String, api_name: :communityId + + # @!attribute community_name + # Confirmed community name when available. + # + # @return [String, nil] + optional :community_name, String, api_name: :communityName + + # @!attribute completed_at + # + # @return [Time, nil] + optional :completed_at, Time, api_name: :completedAt + # @!attribute confirmation_attempts # # @return [Integer, nil] @@ -60,15 +149,56 @@ class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @return [Time, nil] optional :confirmation_checked_at, Time, api_name: :confirmationCheckedAt - # @!attribute confirmation_source + # @!attribute confirmed_at + # + # @return [Time, nil] + optional :confirmed_at, Time, api_name: :confirmedAt + + # @!attribute created_at + # + # @return [Time, nil] + optional :created_at, Time, api_name: :createdAt + + # @!attribute details + # Structured recovery context for a failed write. + # + # @return [Hash{Symbol=>Object}, nil] + optional :details, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute error # # @return [String, nil] - optional :confirmation_source, String, api_name: :confirmationSource, nil?: true + optional :error, String - # @!attribute confirmed_at + # @!attribute expires_at + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. # # @return [Time, nil] - optional :confirmed_at, Time, api_name: :confirmedAt + optional :expires_at, Time, api_name: :expiresAt + + # @!attribute idempotent + # + # @return [Boolean, nil] + optional :idempotent, XTwitterScraper::Internal::Type::Boolean + + # @!attribute media + # Media count, kind, size, and billing details when used. + # + # @return [Hash{Symbol=>Object}, nil] + optional :media, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute media_id + # Compatibility field for a confirmed media upload ID. + # + # @return [String, nil] + optional :media_id, String, api_name: :mediaId + + # @!attribute media_url + # Public media URL when the upload creates one. + # + # @return [String, nil] + optional :media_url, String, api_name: :mediaUrl # @!attribute message # @@ -76,80 +206,333 @@ class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel optional :message, String # @!attribute message_id + # Compatibility field for a confirmed direct message ID. # # @return [String, nil] optional :message_id, String, api_name: :messageId - # @!attribute send_dispatched_at + # @!attribute request_hash # - # @return [Time, nil] - optional :send_dispatched_at, Time, api_name: :sendDispatchedAt + # @return [String, nil] + optional :request_hash, String, api_name: :requestHash - # @!attribute target_id + # @!attribute request_id + # + # @return [String, nil] + optional :request_id, String, api_name: :requestId + + # @!attribute result_id + # Compatibility result ID for other write actions. # # @return [String, nil] - optional :target_id, String, api_name: :targetId, nil?: true + optional :result_id, String, api_name: :resultId + + # @!attribute send_dispatched_at + # Dispatch timestamp when the write reached execution. + # + # @return [Time, nil] + optional :send_dispatched_at, Time, api_name: :sendDispatchedAt # @!attribute tweet_id + # Compatibility field for a confirmed tweet result ID. # # @return [String, nil] optional :tweet_id, String, api_name: :tweetId - # @!method initialize(action:, charged:, charged_credits:, created_at:, media:, send_dispatched:, status:, write_action_id:, confirmation_attempts: nil, confirmation_checked_at: nil, confirmation_source: nil, confirmed_at: nil, message: nil, message_id: nil, send_dispatched_at: nil, target_id: nil, tweet_id: nil, retryable: false) - # @param action [String] + # @!attribute updated_at + # + # @return [Time, nil] + optional :updated_at, Time, api_name: :updatedAt + + # @!method initialize(id:, account:, action:, billing:, charged:, charged_credits:, next_action:, poll_after_ms:, request:, result:, retryable:, safe_to_retry:, send_dispatched:, status:, status_url:, success:, target:, target_id:, terminal:, write_action_id:, community_id: nil, community_name: nil, completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, confirmed_at: nil, created_at: nil, details: nil, error: nil, expires_at: nil, idempotent: nil, media: nil, media_id: nil, media_url: nil, message: nil, message_id: nil, request_hash: nil, request_id: nil, result_id: nil, send_dispatched_at: nil, tweet_id: nil, updated_at: nil, object: :x_write_action) + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::WriteActionRetrieveResponse} for more details. + # + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + # + # @param id [String] + # + # @param account [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account, nil] Connected account selected for the write. + # + # @param action [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action] + # + # @param billing [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing] plannedCredits is the approved maximum. chargedCredits comes from the settled cr + # # @param charged [Boolean] + # # @param charged_credits [String] - # @param created_at [Time] - # @param media [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media] + # + # @param next_action [XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction, nil] Exact follow-up an API client or agent should perform. + # + # @param poll_after_ms [Integer, nil] + # + # @param request [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request] Stable fingerprint and sanitized payload for replay checks. + # + # @param result [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result, nil] Confirmed result produced by the write, when available. + # + # @param retryable [Boolean] True only when a new attempt can reasonably succeed. + # + # @param safe_to_retry [Boolean] True only when no write was dispatched and a new idempotency key may be used. + # # @param send_dispatched [Boolean] + # # @param status [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status] + # + # @param status_url [String] + # + # @param success [Boolean] + # + # @param target [XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target, nil] Existing X resource targeted by the write, when applicable. + # + # @param target_id [String, nil] + # + # @param terminal [Boolean] + # # @param write_action_id [String] + # + # @param community_id [String] Compatibility field for a confirmed community ID. + # + # @param community_name [String] Confirmed community name when available. + # + # @param completed_at [Time] + # # @param confirmation_attempts [Integer] + # # @param confirmation_checked_at [Time] - # @param confirmation_source [String, nil] + # # @param confirmed_at [Time] + # + # @param created_at [Time] + # + # @param details [Hash{Symbol=>Object}] Structured recovery context for a failed write. + # + # @param error [String] + # + # @param expires_at [Time] Deadline for resolving a non-terminal write. This is not the Idempotency-Key ret + # + # @param idempotent [Boolean] + # + # @param media [Hash{Symbol=>Object}] Media count, kind, size, and billing details when used. + # + # @param media_id [String] Compatibility field for a confirmed media upload ID. + # + # @param media_url [String] Public media URL when the upload creates one. + # # @param message [String] - # @param message_id [String] - # @param send_dispatched_at [Time] - # @param target_id [String, nil] - # @param tweet_id [String] - # @param retryable [Boolean, false] + # + # @param message_id [String] Compatibility field for a confirmed direct message ID. + # + # @param request_hash [String] + # + # @param request_id [String] + # + # @param result_id [String] Compatibility result ID for other write actions. + # + # @param send_dispatched_at [Time] Dispatch timestamp when the write reached execution. + # + # @param tweet_id [String] Compatibility field for a confirmed tweet result ID. + # + # @param updated_at [Time] + # + # @param object [Symbol, :x_write_action] - # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#media - class Media < XTwitterScraper::Internal::Type::BaseModel - # @!attribute count + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#account + class Account < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id # - # @return [Integer] - required :count, Integer + # @return [String] + required :id, String - # @!attribute credits + # @!attribute username # # @return [String] - required :credits, String + required :username, String + + # @!method initialize(id:, username:) + # Connected account selected for the write. + # + # @param id [String] + # @param username [String] + end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#action + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET = :create_tweet + DELETE_TWEET = :delete_tweet + LIKE = :like + UNLIKE = :unlike + RETWEET = :retweet + UNRETWEET = :unretweet + FOLLOW = :follow + UNFOLLOW = :unfollow + REMOVE_FOLLOWER = :remove_follower + SEND_DM = :send_dm + UPLOAD_MEDIA = :upload_media + UPDATE_PROFILE = :update_profile + UPDATE_AVATAR = :update_avatar + UPDATE_BANNER = :update_banner + CREATE_COMMUNITY = :create_community + DELETE_COMMUNITY = :delete_community + JOIN_COMMUNITY = :join_community + LEAVE_COMMUNITY = :leave_community + + # @!method self.values + # @return [Array] + end - # @!attribute kind + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#billing + class Billing < XTwitterScraper::Internal::Type::BaseModel + # @!attribute charged # - # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind] - required :kind, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind } + # @return [Boolean] + required :charged, XTwitterScraper::Internal::Type::Boolean - # @!attribute total_bytes + # @!attribute charged_credits # # @return [String] - required :total_bytes, String, api_name: :totalBytes + required :charged_credits, String, api_name: :chargedCredits + + # @!attribute planned_credits + # + # @return [String] + required :planned_credits, String, api_name: :plannedCredits + + # @!attribute status + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status] + required :status, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status } + + # @!method initialize(charged:, charged_credits:, planned_credits:, status:) + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + # + # @param charged [Boolean] + # @param charged_credits [String] + # @param planned_credits [String] + # @param status [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED = :not_charged + PENDING = :pending + CHARGED = :charged + CHARGE_FAILED = :charge_failed + REFUNDED = :refunded + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#next_action + class NextAction < XTwitterScraper::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type] + required :type, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type } + + # @!attribute after_ms + # + # @return [Integer, nil] + optional :after_ms, Integer, api_name: :afterMs + + # @!attribute requires_new_idempotency_key + # + # @return [Boolean, nil] + optional :requires_new_idempotency_key, + XTwitterScraper::Internal::Type::Boolean, + api_name: :requiresNewIdempotencyKey + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type:, after_ms: nil, requires_new_idempotency_key: nil, url: nil) + # Exact follow-up an API client or agent should perform. + # + # @param type [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type] + # @param after_ms [Integer] + # @param requires_new_idempotency_key [Boolean] + # @param url [String] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL = :poll + RETRY = :retry + VERIFY_RESULT = :verify_result + FIX_REQUEST = :fix_request + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#request + class Request < XTwitterScraper::Internal::Type::BaseModel + # @!attribute hash_ + # Stable hash of account, action, target, and payload. + # + # @return [String, nil] + required :hash_, String, api_name: :hash, nil?: true + + # @!attribute payload + # Exact sanitized payload dispatched for this action. + # + # @return [Hash{Symbol=>Object}, nil] + required :payload, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + nil?: true + + # @!method initialize(hash_:, payload:) + # Stable fingerprint and sanitized payload for replay checks. + # + # @param hash_ [String, nil] Stable hash of account, action, target, and payload. + # + # @param payload [Hash{Symbol=>Object}, nil] Exact sanitized payload dispatched for this action. + end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#result + class Result < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String - # @!method initialize(count:, credits:, kind:, total_bytes:) - # @param count [Integer] - # @param credits [String] - # @param kind [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind] - # @param total_bytes [String] + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type, nil] + optional :type, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type } - # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media#kind - module Kind + # @!method initialize(id: nil, state: nil, type: nil) + # Confirmed result produced by the write, when available. + # + # @param id [String] + # @param state [String] + # @param type [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result#type + module Type extend XTwitterScraper::Internal::Type::Enum - NONE = :none - IMAGE = :image - VIDEO = :video + TWEET = :tweet + DIRECT_MESSAGE = :direct_message + MEDIA = :media + COMMUNITY = :community + STATE_CHANGE = :state_change # @!method self.values # @return [Array] @@ -160,13 +543,47 @@ module Kind module Status extend XTwitterScraper::Internal::Type::Enum + ACCEPTED = :accepted + DISPATCHING = :dispatching + PENDING_CONFIRMATION = :pending_confirmation SUCCESS = :success FAILED = :failed - PENDING_CONFIRMATION = :pending_confirmation + EXPIRED = :expired # @!method self.values # @return [Array] end + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse#target + class Target < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type] + required :type, enum: -> { XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type } + + # @!method initialize(id:, type:) + # Existing X resource targeted by the write, when applicable. + # + # @param id [String] + # @param type [Symbol, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type] + + # @see XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target#type + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET = :tweet + USER = :user + COMMUNITY = :community + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/x_twitter_scraper/resources/support/tickets.rb b/lib/x_twitter_scraper/resources/support/tickets.rb index 00e6226..73dddcc 100644 --- a/lib/x_twitter_scraper/resources/support/tickets.rb +++ b/lib/x_twitter_scraper/resources/support/tickets.rb @@ -5,12 +5,19 @@ module Resources class Support # Support ticket management class Tickets + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::Support::TicketCreateParams} for more details. + # # Create a support ticket # - # @overload create(body:, subject:, request_options: {}) + # @overload create(body:, subject:, idempotency_key: nil, request_options: {}) + # + # @param body [String] Body param + # + # @param subject [String] Body param + # + # @param idempotency_key [String] Header param: Generate one random value per ticket or reply. Reuse it only when # - # @param body [String] - # @param subject [String] # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::Support::TicketCreateResponse] @@ -18,10 +25,12 @@ class Tickets # @see XTwitterScraper::Models::Support::TicketCreateParams def create(params) parsed, options = XTwitterScraper::Support::TicketCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "support/tickets", - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::Support::TicketCreateResponse, options: options ) @@ -89,13 +98,18 @@ def list(params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::Support::TicketReplyParams} for more details. + # # Reply to a support ticket # - # @overload reply(id, body:, request_options: {}) + # @overload reply(id, body:, idempotency_key: nil, request_options: {}) # - # @param id [String] Support ticket public ID for the reply + # @param id [String] Path param: Support ticket public ID for the reply # - # @param body [String] + # @param body [String] Body param + # + # @param idempotency_key [String] Header param: Generate one random value per ticket or reply. Reuse it only when # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -104,10 +118,12 @@ def list(params = {}) # @see XTwitterScraper::Models::Support::TicketReplyParams def reply(id, params) parsed, options = XTwitterScraper::Support::TicketReplyParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["support/tickets/%1$s/messages", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::Support::TicketReplyResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x.rb b/lib/x_twitter_scraper/resources/x.rb index 90eef37..530cd56 100644 --- a/lib/x_twitter_scraper/resources/x.rb +++ b/lib/x_twitter_scraper/resources/x.rb @@ -20,7 +20,6 @@ class X # @return [XTwitterScraper::Resources::X::Dm] attr_reader :dm - # Media upload and download # @return [XTwitterScraper::Resources::X::Media] attr_reader :media diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index fc5bc66..33a06a7 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -12,15 +12,20 @@ class Communities # @return [XTwitterScraper::Resources::X::Communities::Tweets] attr_reader :tweets + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityCreateParams} for more details. + # # Create community # - # @overload create(account:, name:, description: nil, request_options: {}) + # @overload create(account:, name:, idempotency_key:, description: nil, request_options: {}) + # + # @param account [String] Body param: X account (@username or ID) creating the community # - # @param account [String] X account (@username or ID) creating the community + # @param name [String] Body param: Community name # - # @param name [String] Community name + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # - # @param description [String] Community description + # @param description [String] Body param: Community description # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -29,24 +34,31 @@ class Communities # @see XTwitterScraper::Models::X::CommunityCreateParams def create(params) parsed, options = XTwitterScraper::X::CommunityCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "x/communities", - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::CommunityCreateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::CommunityDeleteParams} for more details. + # # Delete community # - # @overload delete(id, account:, community_name:, request_options: {}) + # @overload delete(id, account:, community_name:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Resource ID returned by the matching create or list endpoint. # - # @param id [String] Resource ID returned by the matching create or list endpoint. + # @param account [String] Body param: X account (@username or ID) deleting the community # - # @param account [String] X account (@username or ID) deleting the community + # @param community_name [String] Body param: Community name for confirmation # - # @param community_name [String] Community name for confirmation + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -55,10 +67,12 @@ def create(params) # @see XTwitterScraper::Models::X::CommunityDeleteParams def delete(id, params) parsed, options = XTwitterScraper::X::CommunityDeleteParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/communities/%1$s", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::CommunityDeleteResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/communities/join.rb b/lib/x_twitter_scraper/resources/x/communities/join.rb index e14bf34..dc3cc0c 100644 --- a/lib/x_twitter_scraper/resources/x/communities/join.rb +++ b/lib/x_twitter_scraper/resources/x/communities/join.rb @@ -6,13 +6,18 @@ class X class Communities # X write actions (tweets, likes, follows, DMs) class Join + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::JoinCreateParams} for more details. + # # Join community # - # @overload create(id, account:, request_options: {}) + # @overload create(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Resource ID returned by the matching create or list endpoint. # - # @param id [String] Resource ID returned by the matching create or list endpoint. + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -21,22 +26,29 @@ class Join # @see XTwitterScraper::Models::X::Communities::JoinCreateParams def create(id, params) parsed, options = XTwitterScraper::X::Communities::JoinCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/communities/%1$s/join", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Communities::JoinCreateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Communities::JoinDeleteAllParams} for more details. + # # Leave community # - # @overload delete_all(id, account:, request_options: {}) + # @overload delete_all(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Resource ID returned by the matching create or list endpoint. # - # @param id [String] Resource ID returned by the matching create or list endpoint. + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -45,10 +57,12 @@ def create(id, params) # @see XTwitterScraper::Models::X::Communities::JoinDeleteAllParams def delete_all(id, params) parsed, options = XTwitterScraper::X::Communities::JoinDeleteAllParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/communities/%1$s/join", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/dm.rb b/lib/x_twitter_scraper/resources/x/dm.rb index 5743b22..5768d0e 100644 --- a/lib/x_twitter_scraper/resources/x/dm.rb +++ b/lib/x_twitter_scraper/resources/x/dm.rb @@ -36,17 +36,22 @@ def retrieve_history(user_id, params) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::DmSendParams} for more details. + # # Send direct message # - # @overload send_(user_id, account:, text:, media_ids: nil, request_options: {}) + # @overload send_(user_id, account:, text:, idempotency_key:, media_ids: nil, request_options: {}) + # + # @param user_id [String] Path param: Recipient user ID # - # @param user_id [String] Recipient user ID + # @param account [String] Body param: X account (@username or ID) sending the DM # - # @param account [String] X account (@username or ID) sending the DM + # @param text [String] Body param # - # @param text [String] + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # - # @param media_ids [Array] Optional array containing exactly 1 uploaded media ID. + # @param media_ids [Array] Body param: Optional array containing exactly 1 uploaded media ID. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -55,10 +60,12 @@ def retrieve_history(user_id, params) # @see XTwitterScraper::Models::X::DmSendParams def send_(user_id, params) parsed, options = XTwitterScraper::X::DmSendParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/dm/%1$s", user_id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::DmSendResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/media.rb b/lib/x_twitter_scraper/resources/x/media.rb index efd3343..2b0ee52 100644 --- a/lib/x_twitter_scraper/resources/x/media.rb +++ b/lib/x_twitter_scraper/resources/x/media.rb @@ -3,7 +3,6 @@ module XTwitterScraper module Resources class X - # Media upload and download class Media # Download images & videos from tweets # @@ -33,13 +32,18 @@ def download(params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::MediaUploadParams} for more details. + # # Upload media # - # @overload upload(account:, url:, request_options: {}) + # @overload upload(account:, url:, idempotency_key:, request_options: {}) + # + # @param account [String] Body param: X account (@username or ID) uploading media from URL # - # @param account [String] X account (@username or ID) uploading media from URL + # @param url [String] Body param: HTTPS URL to download and upload as media # - # @param url [String] HTTPS URL to download and upload as media + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -48,11 +52,17 @@ def download(params = {}) # @see XTwitterScraper::Models::X::MediaUploadParams def upload(params) parsed, options = XTwitterScraper::X::MediaUploadParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "x/media", - headers: {"content-type" => "multipart/form-data"}, - body: parsed, + headers: { + "content-type" => "multipart/form-data", + **parsed.slice(*header_params.keys) + }.transform_keys( + header_params + ), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::MediaUploadResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/profile.rb b/lib/x_twitter_scraper/resources/x/profile.rb index 3c8726d..6da86aa 100644 --- a/lib/x_twitter_scraper/resources/x/profile.rb +++ b/lib/x_twitter_scraper/resources/x/profile.rb @@ -5,19 +5,24 @@ module Resources class X # X write actions (tweets, likes, follows, DMs) class Profile + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateParams} for more details. + # # Update X profile # - # @overload update(account:, description: nil, location: nil, name: nil, url: nil, request_options: {}) + # @overload update(account:, idempotency_key:, description: nil, location: nil, name: nil, url: nil, request_options: {}) + # + # @param account [String] Body param: X account (@username or ID) to update profile # - # @param account [String] X account (@username or ID) to update profile + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # - # @param description [String] Bio description + # @param description [String] Body param: Bio description # - # @param location [String] + # @param location [String] Body param # - # @param name [String] Display name + # @param name [String] Body param: Display name # - # @param url [String] Website URL + # @param url [String] Body param: Website URL # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -26,22 +31,29 @@ class Profile # @see XTwitterScraper::Models::X::ProfileUpdateParams def update(params) parsed, options = XTwitterScraper::X::ProfileUpdateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :patch, path: "x/profile", - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::ProfileUpdateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateAvatarParams} for more details. + # # Update profile avatar # - # @overload update_avatar(account:, url:, request_options: {}) + # @overload update_avatar(account:, url:, idempotency_key:, request_options: {}) # - # @param account [String] X account (@username or ID) receiving avatar from URL + # @param account [String] Body param: X account (@username or ID) receiving avatar from URL # - # @param url [String] HTTPS URL to the avatar image to download + # @param url [String] Body param: HTTPS URL to the avatar image to download + # + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -50,23 +62,34 @@ def update(params) # @see XTwitterScraper::Models::X::ProfileUpdateAvatarParams def update_avatar(params) parsed, options = XTwitterScraper::X::ProfileUpdateAvatarParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :patch, path: "x/profile/avatar", - headers: {"content-type" => "multipart/form-data"}, - body: parsed, + headers: { + "content-type" => "multipart/form-data", + **parsed.slice(*header_params.keys) + }.transform_keys( + header_params + ), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::ProfileUpdateBannerParams} for more details. + # # Update profile banner # - # @overload update_banner(account:, url:, request_options: {}) + # @overload update_banner(account:, url:, idempotency_key:, request_options: {}) + # + # @param account [String] Body param: X account (@username or ID) receiving banner from URL # - # @param account [String] X account (@username or ID) receiving banner from URL + # @param url [String] Body param: HTTPS URL to the banner image to download # - # @param url [String] HTTPS URL to the banner image to download + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -75,11 +98,17 @@ def update_avatar(params) # @see XTwitterScraper::Models::X::ProfileUpdateBannerParams def update_banner(params) parsed, options = XTwitterScraper::X::ProfileUpdateBannerParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :patch, path: "x/profile/banner", - headers: {"content-type" => "multipart/form-data"}, - body: parsed, + headers: { + "content-type" => "multipart/form-data", + **parsed.slice(*header_params.keys) + }.transform_keys( + header_params + ), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::ProfileUpdateBannerResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index ee33a08..67cbdbc 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -17,21 +17,21 @@ class Tweets # # Create tweet # - # @overload create(account:, attachment_url: nil, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) + # @overload create(account:, idempotency_key:, community_id: nil, is_note_tweet: nil, media: nil, reply_to_tweet_id: nil, text: nil, request_options: {}) # - # @param account [String] X account (@username or account ID) + # @param account [String] Body param: X account (@username or account ID) # - # @param attachment_url [String] + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # - # @param community_id [String] + # @param community_id [String] Body param # - # @param is_note_tweet [Boolean] + # @param is_note_tweet [Boolean] Body param # - # @param media [Array] Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 v + # @param media [Array] Body param: Array of public media URLs to attach. Supports up to 4 images or exa # - # @param reply_to_tweet_id [String] + # @param reply_to_tweet_id [String] Body param # - # @param text [String] Tweet text (optional when media is provided) + # @param text [String] Body param: Tweet text (optional when media is provided) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -40,10 +40,12 @@ class Tweets # @see XTwitterScraper::Models::X::TweetCreateParams def create(params) parsed, options = XTwitterScraper::X::TweetCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "x/tweets", - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::TweetCreateResponse, options: options ) @@ -92,13 +94,18 @@ def list(params) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::TweetDeleteParams} for more details. + # # Delete tweet # - # @overload delete(id, account:, request_options: {}) + # @overload delete(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Tweet ID to delete # - # @param id [String] Tweet ID to delete + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -107,10 +114,12 @@ def list(params) # @see XTwitterScraper::Models::X::TweetDeleteParams def delete(id, params) parsed, options = XTwitterScraper::X::TweetDeleteParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/tweets/%1$s", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::TweetDeleteResponse, options: options ) @@ -119,7 +128,9 @@ def delete(id, params) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetGetFavoritersParams} for more details. # - # List users who liked a tweet + # Returns liker profiles that X makes visible for the post. X can withhold liker + # identities even when the post reports likes. In that case this endpoint returns + # 424 `favoriters_unavailable` instead of a misleading empty success. # # @overload get_favoriters(id, cursor: nil, page_size: nil, request_options: {}) # @@ -257,7 +268,11 @@ def get_quotes(id, params = {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetGetRepliesParams} for more details. # - # List replies to a tweet + # Returns visible replies. For an unfiltered first page, Xquik compares a terminal + # page with the post's reported reply count. If the page is visibly incomplete, + # the endpoint returns 424 `replies_incomplete` instead of presenting partial + # coverage as complete. Use tweet search with a `conversation_id:{id}` query as + # the broader fallback. # # @overload get_replies(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/tweets/like.rb b/lib/x_twitter_scraper/resources/x/tweets/like.rb index 483942c..34ae25d 100644 --- a/lib/x_twitter_scraper/resources/x/tweets/like.rb +++ b/lib/x_twitter_scraper/resources/x/tweets/like.rb @@ -6,13 +6,18 @@ class X class Tweets # X write actions (tweets, likes, follows, DMs) class Like + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::LikeCreateParams} for more details. + # # Like tweet # - # @overload create(id, account:, request_options: {}) + # @overload create(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Tweet ID to like # - # @param id [String] Tweet ID to like + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -21,22 +26,29 @@ class Like # @see XTwitterScraper::Models::X::Tweets::LikeCreateParams def create(id, params) parsed, options = XTwitterScraper::X::Tweets::LikeCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/tweets/%1$s/like", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Tweets::LikeCreateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::LikeDeleteParams} for more details. + # # Unlike tweet # - # @overload delete(id, account:, request_options: {}) + # @overload delete(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Tweet ID to unlike # - # @param id [String] Tweet ID to unlike + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -45,10 +57,12 @@ def create(id, params) # @see XTwitterScraper::Models::X::Tweets::LikeDeleteParams def delete(id, params) parsed, options = XTwitterScraper::X::Tweets::LikeDeleteParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/tweets/%1$s/like", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), 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 7571505..60c91c0 100644 --- a/lib/x_twitter_scraper/resources/x/tweets/retweet.rb +++ b/lib/x_twitter_scraper/resources/x/tweets/retweet.rb @@ -6,13 +6,18 @@ class X class Tweets # X write actions (tweets, likes, follows, DMs) class Retweet + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::RetweetCreateParams} for more details. + # # Retweet # - # @overload create(id, account:, request_options: {}) + # @overload create(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Tweet ID to retweet # - # @param id [String] Tweet ID to retweet + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -21,22 +26,29 @@ class Retweet # @see XTwitterScraper::Models::X::Tweets::RetweetCreateParams def create(id, params) parsed, options = XTwitterScraper::X::Tweets::RetweetCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/tweets/%1$s/retweet", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Tweets::RetweetDeleteParams} for more details. + # # Unretweet # - # @overload delete(id, account:, request_options: {}) + # @overload delete(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: Tweet ID to unretweet # - # @param id [String] Tweet ID to unretweet + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -45,10 +57,12 @@ def create(id, params) # @see XTwitterScraper::Models::X::Tweets::RetweetDeleteParams def delete(id, params) parsed, options = XTwitterScraper::X::Tweets::RetweetDeleteParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/tweets/%1$s/retweet", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), 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 43310a8..4f31248 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -28,13 +28,18 @@ def retrieve(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::UserRemoveFollowerParams} for more details. + # # Remove follower # - # @overload remove_follower(id, account:, request_options: {}) + # @overload remove_follower(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: User ID to remove from your followers # - # @param id [String] User ID to remove from your followers + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -43,10 +48,12 @@ def retrieve(id, params = {}) # @see XTwitterScraper::Models::X::UserRemoveFollowerParams def remove_follower(id, params) parsed, options = XTwitterScraper::X::UserRemoveFollowerParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/users/%1$s/remove-follower", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::UserRemoveFollowerResponse, options: options ) diff --git a/lib/x_twitter_scraper/resources/x/users/follow.rb b/lib/x_twitter_scraper/resources/x/users/follow.rb index 1272c93..175b9d4 100644 --- a/lib/x_twitter_scraper/resources/x/users/follow.rb +++ b/lib/x_twitter_scraper/resources/x/users/follow.rb @@ -6,13 +6,18 @@ class X class Users # X write actions (tweets, likes, follows, DMs) class Follow + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Users::FollowCreateParams} for more details. + # # Follow user # - # @overload create(id, account:, request_options: {}) + # @overload create(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: User ID to follow # - # @param id [String] User ID to follow + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -21,22 +26,29 @@ class Follow # @see XTwitterScraper::Models::X::Users::FollowCreateParams def create(id, params) parsed, options = XTwitterScraper::X::Users::FollowCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["x/users/%1$s/follow", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Users::FollowCreateResponse, options: options ) end + # Some parameter documentations has been truncated, see + # {XTwitterScraper::Models::X::Users::FollowDeleteAllParams} for more details. + # # Unfollow user # - # @overload delete_all(id, account:, request_options: {}) + # @overload delete_all(id, account:, idempotency_key:, request_options: {}) + # + # @param id [String] Path param: User ID to unfollow # - # @param id [String] User ID to unfollow + # @param account [String] Body param: X account identifier (@username or account ID) # - # @param account [String] X account identifier (@username or account ID) + # @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -45,10 +57,12 @@ def create(id, params) # @see XTwitterScraper::Models::X::Users::FollowDeleteAllParams def delete_all(id, params) parsed, options = XTwitterScraper::X::Users::FollowDeleteAllParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} @client.request( method: :delete, path: ["x/users/%1$s/follow", id], - body: parsed, + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), model: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse, options: options ) diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index 2f9a416..54fc0cf 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -18,6 +18,34 @@ module XTwitterScraper end attr_accessor :error + # Human-readable error guidance. + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Machine-readable reason for a login cooldown. + sig { returns(T.nilable(String)) } + attr_reader :reason + + sig { params(reason: String).void } + attr_writer :reason + + # Required wait in seconds. + sig { returns(T.nilable(Integer)) } + attr_reader :retry_after + + sig { params(retry_after: Integer).void } + attr_writer :retry_after + + # Required wait in milliseconds. + sig { returns(T.nilable(Integer)) } + attr_reader :retry_after_ms + + sig { params(retry_after_ms: Integer).void } + attr_writer :retry_after_ms + # Error response. Default v1 returns a legacy string error code. Send # `xquik-api-contract: 2026-04-29` to receive the structured best-practice error # object. @@ -27,10 +55,24 @@ module XTwitterScraper T.any( XTwitterScraper::Error::Error::LegacyErrorCode::OrSymbol, XTwitterScraper::Error::Error::StructuredError::OrHash - ) + ), + message: String, + reason: String, + retry_after: Integer, + retry_after_ms: Integer ).returns(T.attached_class) end - def self.new(error:) + def self.new( + error:, + # Human-readable error guidance. + message: nil, + # Machine-readable reason for a login cooldown. + reason: nil, + # Required wait in seconds. + retry_after: nil, + # Required wait in milliseconds. + retry_after_ms: nil + ) end sig do @@ -40,7 +82,11 @@ module XTwitterScraper T.any( XTwitterScraper::Error::Error::LegacyErrorCode::OrSymbol, XTwitterScraper::Error::Error::StructuredError - ) + ), + message: String, + reason: String, + retry_after: Integer, + retry_after_ms: Integer } ) end @@ -397,11 +443,6 @@ module XTwitterScraper :x_write_failed, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) - X_WRITE_UNCONFIRMED = - T.let( - :x_write_unconfirmed, - XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol - ) sig do override.returns( @@ -808,11 +849,6 @@ module XTwitterScraper :x_write_failed, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) - X_WRITE_UNCONFIRMED = - T.let( - :x_write_unconfirmed, - XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol - ) sig do override.returns( diff --git a/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi b/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi index 71f45c8..46c61ce 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi @@ -21,14 +21,21 @@ module XTwitterScraper sig { returns(String) } attr_accessor :subject + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + sig do params( body: String, subject: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(body:, subject:, request_options: {}) + def self.new(body:, subject:, idempotency_key: nil, request_options: {}) end sig do @@ -36,6 +43,7 @@ module XTwitterScraper { body: String, subject: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi index 265d338..5b13a89 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi @@ -12,19 +12,139 @@ module XTwitterScraper ) end + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment + ] + ) + ) + end + attr_reader :attachments + + sig do + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::OrHash + ] + ).void + end + attr_writer :attachments + sig { returns(T.nilable(String)) } attr_reader :public_id sig { params(public_id: String).void } attr_writer :public_id - sig { params(public_id: String).returns(T.attached_class) } - def self.new(public_id: nil) + sig do + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::OrHash + ], + public_id: String + ).returns(T.attached_class) + end + def self.new(attachments: nil, public_id: nil) end - sig { override.returns({ public_id: String }) } + sig do + override.returns( + { + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment + ], + public_id: String + } + ) + end def to_hash end + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :public_id + + sig do + returns( + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + params( + public_id: String, + status: + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(public_id:, status:) + end + + sig do + override.returns( + { + public_id: String, + status: + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + ) + READY = + T.let( + :ready, + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi b/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi index 9119abf..66327fb 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi @@ -21,14 +21,21 @@ module XTwitterScraper sig { returns(String) } attr_accessor :body + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + sig do params( id: String, body: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, body:, request_options: {}) + def self.new(id:, body:, idempotency_key: nil, request_options: {}) end sig do @@ -36,6 +43,7 @@ module XTwitterScraper { id: String, body: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi index 3d1089c..268b7ad 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi @@ -12,19 +12,139 @@ module XTwitterScraper ) end + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment + ] + ) + ) + end + attr_reader :attachments + + sig do + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::OrHash + ] + ).void + end + attr_writer :attachments + sig { returns(T.nilable(String)) } attr_reader :public_id sig { params(public_id: String).void } attr_writer :public_id - sig { params(public_id: String).returns(T.attached_class) } - def self.new(public_id: nil) + sig do + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::OrHash + ], + public_id: String + ).returns(T.attached_class) + end + def self.new(attachments: nil, public_id: nil) end - sig { override.returns({ public_id: String }) } + sig do + override.returns( + { + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment + ], + public_id: String + } + ) + end def to_hash end + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :public_id + + sig do + returns( + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + params( + public_id: String, + status: + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(public_id:, status:) + end + + sig do + override.returns( + { + public_id: String, + status: + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + ) + READY = + T.let( + :ready, + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi index c96754d..7511e25 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi @@ -113,6 +113,27 @@ module XTwitterScraper ) end + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment + ] + ) + ) + end + attr_reader :attachments + + sig do + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::OrHash + ] + ).void + end + attr_writer :attachments + sig { returns(T.nilable(String)) } attr_reader :body @@ -132,18 +153,258 @@ module XTwitterScraper attr_writer :sender sig do - params(body: String, created_at: Time, sender: String).returns( - T.attached_class - ) + params( + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::OrHash + ], + body: String, + created_at: Time, + sender: String + ).returns(T.attached_class) end - def self.new(body: nil, created_at: nil, sender: nil) + def self.new( + attachments: nil, + body: nil, + created_at: nil, + sender: nil + ) end sig do - override.returns({ body: String, created_at: Time, sender: String }) + override.returns( + { + attachments: + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment + ], + body: String, + created_at: Time, + sender: String + } + ) end def to_hash end + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + end + attr_accessor :content_type + + sig { returns(String) } + attr_accessor :filename + + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol + ) + end + attr_accessor :kind + + sig { returns(String) } + attr_accessor :public_id + + sig { returns(Integer) } + attr_accessor :size_bytes + + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :url + + sig do + params( + content_type: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::OrSymbol, + filename: String, + kind: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::OrSymbol, + public_id: String, + size_bytes: Integer, + status: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + content_type:, + filename:, + kind:, + public_id:, + size_bytes:, + status:, + url: + ) + end + + sig do + override.returns( + { + content_type: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol, + filename: String, + kind: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol, + public_id: String, + size_bytes: Integer, + status: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module ContentType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGE_JPEG = + T.let( + :"image/jpeg", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + IMAGE_PNG = + T.let( + :"image/png", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + IMAGE_GIF = + T.let( + :"image/gif", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + IMAGE_WEBP = + T.let( + :"image/webp", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + VIDEO_MP4 = + T.let( + :"video/mp4", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + VIDEO_QUICKTIME = + T.let( + :"video/quicktime", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + VIDEO_WEBM = + T.let( + :"video/webm", + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Kind + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGE = + T.let( + :image, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol + ) + VIDEO = + T.let( + :video, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ) + READY = + T.let( + :ready, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ] + ) + end + def self.values + 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 b27db72..cd6118f 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) 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 index f44d3d3..54accf5 100644 --- a/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + 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 b43addd..354bade 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) 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 index caec047..2801a81 100644 --- 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 @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account + ), + action: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 9af899d..29eb3ae 100644 --- a/rbi/x_twitter_scraper/models/x/community_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_create_params.rbi @@ -23,6 +23,9 @@ module XTwitterScraper sig { returns(String) } attr_accessor :name + sig { returns(String) } + attr_accessor :idempotency_key + # Community description sig { returns(T.nilable(String)) } attr_reader :description @@ -34,6 +37,7 @@ module XTwitterScraper params( account: String, name: String, + idempotency_key: String, description: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) @@ -43,6 +47,7 @@ module XTwitterScraper account:, # Community name name:, + idempotency_key:, # Community description description: nil, request_options: {} @@ -54,6 +59,7 @@ module XTwitterScraper { account: String, name: String, + idempotency_key: String, description: String, request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/community_create_response.rbi b/rbi/x_twitter_scraper/models/x/community_create_response.rbi index 25db66d..75db57e 100644 --- a/rbi/x_twitter_scraper/models/x/community_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/community_create_response.rbi @@ -13,38 +13,1160 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :community_id + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::CommunityCreateResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::CommunityCreateResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::CommunityCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url sig { returns(T::Boolean) } attr_accessor :success + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. sig { returns(T.nilable(String)) } attr_reader :community_name sig { params(community_name: String).void } attr_writer :community_name + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. sig do params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::CommunityCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::CommunityCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::CommunityCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, community_id: String, community_name: String, - success: T::Boolean + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol ).returns(T.attached_class) end - def self.new(community_id:, community_name: nil, success: true) + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end sig do override.returns( { - community_id: String, + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::CommunityCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol, + status_url: String, success: T::Boolean, - community_name: String + target: + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time } ) end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 8138efb..7de6ab3 100644 --- a/rbi/x_twitter_scraper/models/x/community_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_delete_params.rbi @@ -26,11 +26,15 @@ module XTwitterScraper sig { returns(String) } attr_accessor :community_name + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, community_name: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -40,6 +44,7 @@ module XTwitterScraper account:, # Community name for confirmation community_name:, + idempotency_key:, request_options: {} ) end @@ -50,6 +55,7 @@ module XTwitterScraper id: String, account: String, community_name: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/community_delete_response.rbi b/rbi/x_twitter_scraper/models/x/community_delete_response.rbi index 9135313..cc2f54a 100644 --- a/rbi/x_twitter_scraper/models/x/community_delete_response.rbi +++ b/rbi/x_twitter_scraper/models/x/community_delete_response.rbi @@ -12,16 +12,1161 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::CommunityDeleteResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::CommunityDeleteResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::CommunityDeleteResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target + ) + ) end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at - sig { override.returns({ success: T::Boolean }) } + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::CommunityDeleteResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Account + ), + action: + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::CommunityDeleteResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 4a15731..055d223 100644 --- a/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_send_params.rbi @@ -25,6 +25,9 @@ module XTwitterScraper sig { returns(String) } attr_accessor :text + sig { returns(String) } + attr_accessor :idempotency_key + # Optional array containing exactly 1 uploaded media ID. sig { returns(T.nilable(T::Array[String])) } attr_reader :media_ids @@ -37,6 +40,7 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, media_ids: T::Array[String], request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) @@ -46,6 +50,7 @@ module XTwitterScraper # X account (@username or ID) sending the DM account:, text:, + idempotency_key:, # Optional array containing exactly 1 uploaded media ID. media_ids: nil, request_options: {} @@ -58,6 +63,7 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, media_ids: T::Array[String], request_options: XTwitterScraper::RequestOptions } diff --git a/rbi/x_twitter_scraper/models/x/dm_send_response.rbi b/rbi/x_twitter_scraper/models/x/dm_send_response.rbi index 7b32e68..58b8b20 100644 --- a/rbi/x_twitter_scraper/models/x/dm_send_response.rbi +++ b/rbi/x_twitter_scraper/models/x/dm_send_response.rbi @@ -13,22 +13,1128 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :message_id + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::DmSendResponse::Account) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig { returns(XTwitterScraper::Models::X::DmSendResponse::Billing) } + attr_reader :billing + + sig do + params( + billing: XTwitterScraper::Models::X::DmSendResponse::Billing::OrHash + ).void + end + attr_writer :billing sig { returns(T::Boolean) } - attr_accessor :success + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::DmSendResponse::NextAction) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig { returns(XTwitterScraper::Models::X::DmSendResponse::Request) } + attr_reader :request + + sig do + params( + request: XTwitterScraper::Models::X::DmSendResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns(T.nilable(XTwitterScraper::Models::X::DmSendResponse::Result)) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched sig do - params(message_id: String, success: T::Boolean).returns( - T.attached_class + returns( + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol ) end - def self.new(message_id:, success: true) + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + + sig { returns(T::Boolean) } + attr_accessor :success + + # Existing X resource targeted by the write, when applicable. + sig do + returns(T.nilable(XTwitterScraper::Models::X::DmSendResponse::Target)) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Target::OrHash + ) + ).void end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at - sig { override.returns({ message_id: String, success: T::Boolean }) } + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::DmSendResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::DmSendResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::DmSendResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::DmSendResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable(XTwitterScraper::Models::X::DmSendResponse::Account), + action: + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol, + billing: XTwitterScraper::Models::X::DmSendResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: XTwitterScraper::Models::X::DmSendResponse::Request, + result: + T.nilable(XTwitterScraper::Models::X::DmSendResponse::Result), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable(XTwitterScraper::Models::X::DmSendResponse::Target), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::Models::X::DmSendResponse::Action) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::DmSendResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::DmSendResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::DmSendResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::Models::X::DmSendResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::DmSendResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::DmSendResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::DmSendResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::DmSendResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 16da9f1..0623289 100644 --- a/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +++ b/rbi/x_twitter_scraper/models/x/media_upload_params.rbi @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -35,6 +39,7 @@ module XTwitterScraper account:, # HTTPS URL to download and upload as media url:, + idempotency_key:, request_options: {} ) end @@ -44,6 +49,7 @@ module XTwitterScraper { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/media_upload_response.rbi b/rbi/x_twitter_scraper/models/x/media_upload_response.rbi index c84fa01..9322f41 100644 --- a/rbi/x_twitter_scraper/models/x/media_upload_response.rbi +++ b/rbi/x_twitter_scraper/models/x/media_upload_response.rbi @@ -13,37 +13,1152 @@ module XTwitterScraper end sig { returns(String) } - attr_accessor :media_id + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::MediaUploadResponse::Account) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::MediaUploadResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::MediaUploadResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::MediaUploadResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::MediaUploadResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::MediaUploadResponse::Result) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + end + attr_accessor :status - # Public media URL for tweet `media` arrays. sig { returns(String) } - attr_accessor :media_url + attr_accessor :status_url sig { returns(T::Boolean) } attr_accessor :success + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::MediaUploadResponse::Target) + ) + end + attr_reader :target + sig do params( + target: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::MediaUploadResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::MediaUploadResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::MediaUploadResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::MediaUploadResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], media_id: String, media_url: String, - success: T::Boolean + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol ).returns(T.attached_class) end def self.new( - media_id:, - # Public media URL for tweet `media` arrays. - media_url:, - success: true + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action ) end sig do override.returns( - { media_id: String, media_url: String, success: T::Boolean } + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Account + ), + action: + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol, + billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: XTwitterScraper::Models::X::MediaUploadResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } ) end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::MediaUploadResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::MediaUploadResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 007d17c..e1320f7 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -35,6 +39,7 @@ module XTwitterScraper account:, # HTTPS URL to the avatar image to download url:, + idempotency_key:, request_options: {} ) end @@ -44,6 +49,7 @@ module XTwitterScraper { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi b/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi index fce82f8..d918bef 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi @@ -12,16 +12,1165 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target + ) + ) end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at - sig { override.returns({ success: T::Boolean }) } + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account + ), + action: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 595c077..3b1c36c 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -35,6 +39,7 @@ module XTwitterScraper account:, # HTTPS URL to the banner image to download url:, + idempotency_key:, request_options: {} ) end @@ -44,6 +49,7 @@ module XTwitterScraper { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi b/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi index d7ce018..baa4436 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi @@ -12,16 +12,1165 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target + ) + ) end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at - sig { override.returns({ success: T::Boolean }) } + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account + ), + action: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 9a81885..dea1be6 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_params.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_params.rbi @@ -19,6 +19,9 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + # Bio description sig { returns(T.nilable(String)) } attr_reader :description @@ -49,6 +52,7 @@ module XTwitterScraper sig do params( account: String, + idempotency_key: String, description: String, location: String, name: String, @@ -59,6 +63,7 @@ module XTwitterScraper def self.new( # X account (@username or ID) to update profile account:, + idempotency_key:, # Bio description description: nil, location: nil, @@ -74,6 +79,7 @@ module XTwitterScraper override.returns( { account: String, + idempotency_key: String, description: String, location: String, name: String, diff --git a/rbi/x_twitter_scraper/models/x/profile_update_response.rbi b/rbi/x_twitter_scraper/models/x/profile_update_response.rbi index e8a8ba8..9220021 100644 --- a/rbi/x_twitter_scraper/models/x/profile_update_response.rbi +++ b/rbi/x_twitter_scraper/models/x/profile_update_response.rbi @@ -12,16 +12,1157 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::ProfileUpdateResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::ProfileUpdateResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::ProfileUpdateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::ProfileUpdateResponse::Result) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::ProfileUpdateResponse::Target) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Account + ), + action: + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::ProfileUpdateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::ProfileUpdateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi index 6da3333..e939309 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi @@ -19,11 +19,8 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account - sig { returns(T.nilable(String)) } - attr_reader :attachment_url - - sig { params(attachment_url: String).void } - attr_writer :attachment_url + sig { returns(String) } + attr_accessor :idempotency_key sig { returns(T.nilable(String)) } attr_reader :community_id @@ -62,7 +59,7 @@ module XTwitterScraper sig do params( account: String, - attachment_url: String, + idempotency_key: String, community_id: String, is_note_tweet: T::Boolean, media: T::Array[String], @@ -74,7 +71,7 @@ module XTwitterScraper def self.new( # X account (@username or account ID) account:, - attachment_url: nil, + idempotency_key:, community_id: nil, is_note_tweet: nil, # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 @@ -92,7 +89,7 @@ module XTwitterScraper override.returns( { account: String, - attachment_url: String, + idempotency_key: String, community_id: String, is_note_tweet: T::Boolean, media: T::Array[String], diff --git a/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi index 4d9027f..03dce23 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi @@ -12,59 +12,1153 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetCreateResponse::Account) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::TweetCreateResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::TweetCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + sig { returns(T::Boolean) } attr_accessor :charged - # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; - # attached media adds 2 credits per started MB. sig { returns(String) } attr_accessor :charged_credits + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::TweetCreateResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::TweetCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetCreateResponse::Result) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetCreateResponse::Target) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + sig { returns(String) } - attr_accessor :tweet_id + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. sig { returns(T.nilable(String)) } - attr_reader :write_action_id + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id - sig { params(write_action_id: String).void } - attr_writer :write_action_id + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. sig do params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::TweetCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::TweetCreateResponse::Billing::OrHash, charged: T::Boolean, charged_credits: String, - tweet_id: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::TweetCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::TweetCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, write_action_id: String, - success: T::Boolean + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol ).returns(T.attached_class) end def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, charged:, - # Credits charged for this tweet. Text-only tweets and replies cost 30 credits; - # attached media adds 2 credits per started MB. charged_credits:, - tweet_id:, - write_action_id: nil, - success: true + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action ) end sig do override.returns( { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol, + billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing, charged: T::Boolean, charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: XTwitterScraper::Models::X::TweetCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol, + status_url: String, success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, tweet_id: String, - write_action_id: String + updated_at: Time } ) end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 ae02874..1266b54 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi @@ -22,10 +22,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -33,6 +37,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -42,6 +47,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi index 93ac06e..799693e 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi @@ -12,16 +12,1153 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetDeleteResponse::Account) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns(XTwitterScraper::Models::X::TweetDeleteResponse::Billing) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns(XTwitterScraper::Models::X::TweetDeleteResponse::Request) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::TweetDeleteResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetDeleteResponse::Result) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable(XTwitterScraper::Models::X::TweetDeleteResponse::Target) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::TweetDeleteResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::TweetDeleteResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::TweetDeleteResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Account + ), + action: + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol, + billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: XTwitterScraper::Models::X::TweetDeleteResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetDeleteResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetDeleteResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + 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 09fd369..bdcd477 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi b/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi index f656885..0f68444 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 393b775..0018679 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi b/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi index 0c22e81..0b99f65 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account + ), + action: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 0e04b76..fddee34 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi b/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi index ac68181..f275a2e 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 255a298..a7f9f3a 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi b/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi index 7f84a36..5f4aff4 100644 --- a/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi +++ b/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account + ), + action: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi b/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi index cba2c86..b5b9d38 100644 --- a/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi @@ -22,10 +22,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -33,6 +37,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -42,6 +47,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi b/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi index 7802724..2a8f2fb 100644 --- a/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi +++ b/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi @@ -12,16 +12,1165 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target + ) + ) end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at - sig { override.returns({ success: T::Boolean }) } + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) + end + + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account + ), + action: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 9afc6ae..00350db 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi b/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi index 30b0870..57df1aa 100644 --- a/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Account + ), + action: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end 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 a68fc3f..780f4a7 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 @@ -23,10 +23,14 @@ module XTwitterScraper sig { returns(String) } attr_accessor :account + sig { returns(String) } + attr_accessor :idempotency_key + sig do params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end @@ -34,6 +38,7 @@ module XTwitterScraper id:, # X account identifier (@username or account ID) account:, + idempotency_key:, request_options: {} ) end @@ -43,6 +48,7 @@ module XTwitterScraper { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } ) diff --git a/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi b/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi index b4ba98c..10faff3 100644 --- a/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi +++ b/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi @@ -13,16 +13,1167 @@ module XTwitterScraper ) end + sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + end + attr_accessor :action + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::OrHash + ).void + end + attr_writer :billing + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request + ) + end + attr_reader :request + + sig do + params( + request: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request::OrHash + ).void + end + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. + sig { returns(T::Boolean) } + attr_accessor :retryable + + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + + sig { returns(T::Boolean) } + attr_accessor :send_dispatched + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :status_url + sig { returns(T::Boolean) } attr_accessor :success - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success: true) + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + + sig { returns(String) } + attr_accessor :write_action_id + + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + sig { returns(T.nilable(Integer)) } + attr_reader :confirmation_attempts + + sig { params(confirmation_attempts: Integer).void } + attr_writer :confirmation_attempts + + sig { returns(T.nilable(Time)) } + attr_reader :confirmation_checked_at + + sig { params(confirmation_checked_at: Time).void } + attr_writer :confirmation_checked_at + + sig { returns(T.nilable(Time)) } + attr_reader :confirmed_at + + sig { params(confirmed_at: Time).void } + attr_writer :confirmed_at + + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + # Compatibility field for a confirmed direct message ID. + sig { returns(T.nilable(String)) } + attr_reader :message_id + + sig { params(message_id: String).void } + attr_writer :message_id + + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. + sig { returns(T.nilable(Time)) } + attr_reader :send_dispatched_at + + sig { params(send_dispatched_at: Time).void } + attr_writer :send_dispatched_at + + # Compatibility field for a confirmed tweet result ID. + sig { returns(T.nilable(String)) } + attr_reader :tweet_id + + sig { params(tweet_id: String).void } + attr_writer :tweet_id + + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. + sig do + params( + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::OrHash, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + # Connected account selected for the write. + account:, + action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, + charged:, + charged_credits:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, + send_dispatched:, + status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, + write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, + confirmation_attempts: nil, + confirmation_checked_at: nil, + confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, + message: nil, + # Compatibility field for a confirmed direct message ID. + message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. + send_dispatched_at: nil, + # Compatibility field for a confirmed tweet result ID. + tweet_id: nil, + updated_at: nil, + object: :x_write_action + ) end - sig { override.returns({ success: T::Boolean }) } + sig do + override.returns( + { + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account + ), + action: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + charged: T::Boolean, + charged_credits: String, + next_action: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, + send_dispatched: T::Boolean, + status: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + ) + end def to_hash end + + class Account < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :username + + # Connected account selected for the write. + sig do + params(id: String, username: String).returns(T.attached_class) + end + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits + + sig { returns(String) } + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Exact follow-up an API client or agent should perform. + sig do + params( + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + ).returns(T.attached_class) + end + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) + end + + sig do + override.returns( + { + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + RETRY = + T.let( + :retry, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + VERIFY_RESULT = + T.let( + :verify_result, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + FIX_REQUEST = + T.let( + :fix_request, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :success, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi index d9e6f3a..2ae6f48 100644 --- a/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi @@ -13,35 +13,128 @@ module XTwitterScraper end sig { returns(String) } + attr_accessor :id + + # Connected account selected for the write. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account + ) + ) + end + attr_reader :account + + sig do + params( + account: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account::OrHash + ) + ).void + end + attr_writer :account + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + end attr_accessor :action + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing + ) + end + attr_reader :billing + + sig do + params( + billing: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::OrHash + ).void + end + attr_writer :billing + sig { returns(T::Boolean) } attr_accessor :charged sig { returns(String) } attr_accessor :charged_credits - sig { returns(Time) } - attr_accessor :created_at + # Exact follow-up an API client or agent should perform. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction + ) + ) + end + attr_reader :next_action + + sig do + params( + next_action: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::OrHash + ) + ).void + end + attr_writer :next_action + + sig { returns(Symbol) } + attr_accessor :object + sig { returns(T.nilable(Integer)) } + attr_accessor :poll_after_ms + + # Stable fingerprint and sanitized payload for replay checks. sig do returns( - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request ) end - attr_reader :media + attr_reader :request sig do params( - media: - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::OrHash + request: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request::OrHash ).void end - attr_writer :media + attr_writer :request + + # Confirmed result produced by the write, when available. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result + ) + ) + end + attr_reader :result + sig do + params( + result: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::OrHash + ) + ).void + end + attr_writer :result + + # True only when a new attempt can reasonably succeed. sig { returns(T::Boolean) } attr_accessor :retryable + # True only when no write was dispatched and a new idempotency key may be used. + sig { returns(T::Boolean) } + attr_accessor :safe_to_retry + sig { returns(T::Boolean) } attr_accessor :send_dispatched @@ -52,9 +145,61 @@ module XTwitterScraper end attr_accessor :status + sig { returns(String) } + attr_accessor :status_url + + sig { returns(T::Boolean) } + attr_accessor :success + + # Existing X resource targeted by the write, when applicable. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target + ) + ) + end + attr_reader :target + + sig do + params( + target: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::OrHash + ) + ).void + end + attr_writer :target + + sig { returns(T.nilable(String)) } + attr_accessor :target_id + + sig { returns(T::Boolean) } + attr_accessor :terminal + sig { returns(String) } attr_accessor :write_action_id + # Compatibility field for a confirmed community ID. + sig { returns(T.nilable(String)) } + attr_reader :community_id + + sig { params(community_id: String).void } + attr_writer :community_id + + # Confirmed community name when available. + sig { returns(T.nilable(String)) } + attr_reader :community_name + + sig { params(community_name: String).void } + attr_writer :community_name + + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + sig { returns(T.nilable(Integer)) } attr_reader :confirmation_attempts @@ -67,200 +212,822 @@ module XTwitterScraper sig { params(confirmation_checked_at: Time).void } attr_writer :confirmation_checked_at - sig { returns(T.nilable(String)) } - attr_accessor :confirmation_source - sig { returns(T.nilable(Time)) } attr_reader :confirmed_at sig { params(confirmed_at: Time).void } attr_writer :confirmed_at + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Structured recovery context for a failed write. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :details + + sig { params(details: T::Hash[Symbol, T.anything]).void } + attr_writer :details + + sig { returns(T.nilable(String)) } + attr_reader :error + + sig { params(error: String).void } + attr_writer :error + + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + sig { returns(T.nilable(Time)) } + attr_reader :expires_at + + sig { params(expires_at: Time).void } + attr_writer :expires_at + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :idempotent + + sig { params(idempotent: T::Boolean).void } + attr_writer :idempotent + + # Media count, kind, size, and billing details when used. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :media + + sig { params(media: T::Hash[Symbol, T.anything]).void } + attr_writer :media + + # Compatibility field for a confirmed media upload ID. + sig { returns(T.nilable(String)) } + attr_reader :media_id + + sig { params(media_id: String).void } + attr_writer :media_id + + # Public media URL when the upload creates one. + sig { returns(T.nilable(String)) } + attr_reader :media_url + + sig { params(media_url: String).void } + attr_writer :media_url + sig { returns(T.nilable(String)) } attr_reader :message sig { params(message: String).void } attr_writer :message + # Compatibility field for a confirmed direct message ID. sig { returns(T.nilable(String)) } attr_reader :message_id sig { params(message_id: String).void } attr_writer :message_id + sig { returns(T.nilable(String)) } + attr_reader :request_hash + + sig { params(request_hash: String).void } + attr_writer :request_hash + + sig { returns(T.nilable(String)) } + attr_reader :request_id + + sig { params(request_id: String).void } + attr_writer :request_id + + # Compatibility result ID for other write actions. + sig { returns(T.nilable(String)) } + attr_reader :result_id + + sig { params(result_id: String).void } + attr_writer :result_id + + # Dispatch timestamp when the write reached execution. sig { returns(T.nilable(Time)) } attr_reader :send_dispatched_at sig { params(send_dispatched_at: Time).void } attr_writer :send_dispatched_at - sig { returns(T.nilable(String)) } - attr_accessor :target_id - + # Compatibility field for a confirmed tweet result ID. sig { returns(T.nilable(String)) } attr_reader :tweet_id sig { params(tweet_id: String).void } attr_writer :tweet_id + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + # Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing + # the original Idempotency-Key returns this same record. Submit a new write only + # when safeToRetry is true, using a new key. sig do params( - action: String, + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account::OrHash + ), + action: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::OrSymbol, + billing: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::OrHash, charged: T::Boolean, charged_credits: String, - created_at: Time, - media: - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::OrHash, + next_action: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::OrHash + ), + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request::OrHash, + result: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::OrHash + ), + retryable: T::Boolean, + safe_to_retry: T::Boolean, send_dispatched: T::Boolean, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::OrSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::OrHash + ), + target_id: T.nilable(String), + terminal: T::Boolean, write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, confirmation_attempts: Integer, confirmation_checked_at: Time, - confirmation_source: T.nilable(String), confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, message: String, message_id: String, + request_hash: String, + request_id: String, + result_id: String, send_dispatched_at: Time, - target_id: T.nilable(String), tweet_id: String, - retryable: T::Boolean + updated_at: Time, + object: Symbol ).returns(T.attached_class) end def self.new( + id:, + # Connected account selected for the write. + account:, action:, + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + billing:, charged:, charged_credits:, - created_at:, - media:, + # Exact follow-up an API client or agent should perform. + next_action:, + poll_after_ms:, + # Stable fingerprint and sanitized payload for replay checks. + request:, + # Confirmed result produced by the write, when available. + result:, + # True only when a new attempt can reasonably succeed. + retryable:, + # True only when no write was dispatched and a new idempotency key may be used. + safe_to_retry:, send_dispatched:, status:, + status_url:, + success:, + # Existing X resource targeted by the write, when applicable. + target:, + target_id:, + terminal:, write_action_id:, + # Compatibility field for a confirmed community ID. + community_id: nil, + # Confirmed community name when available. + community_name: nil, + completed_at: nil, confirmation_attempts: nil, confirmation_checked_at: nil, - confirmation_source: nil, confirmed_at: nil, + created_at: nil, + # Structured recovery context for a failed write. + details: nil, + error: nil, + # Deadline for resolving a non-terminal write. This is not the Idempotency-Key + # retention deadline. + expires_at: nil, + idempotent: nil, + # Media count, kind, size, and billing details when used. + media: nil, + # Compatibility field for a confirmed media upload ID. + media_id: nil, + # Public media URL when the upload creates one. + media_url: nil, message: nil, + # Compatibility field for a confirmed direct message ID. message_id: nil, + request_hash: nil, + request_id: nil, + # Compatibility result ID for other write actions. + result_id: nil, + # Dispatch timestamp when the write reached execution. send_dispatched_at: nil, - target_id: nil, + # Compatibility field for a confirmed tweet result ID. tweet_id: nil, - retryable: false + updated_at: nil, + object: :x_write_action ) end sig do override.returns( { - action: String, + id: String, + account: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account + ), + action: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol, + billing: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, charged: T::Boolean, charged_credits: String, - created_at: Time, - media: - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + next_action: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction + ), + object: Symbol, + poll_after_ms: T.nilable(Integer), + request: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + result: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result + ), retryable: T::Boolean, + safe_to_retry: T::Boolean, send_dispatched: T::Boolean, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol, + status_url: String, + success: T::Boolean, + target: + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target + ), + target_id: T.nilable(String), + terminal: T::Boolean, write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, confirmation_attempts: Integer, confirmation_checked_at: Time, - confirmation_source: T.nilable(String), confirmed_at: Time, + created_at: Time, + details: T::Hash[Symbol, T.anything], + error: String, + expires_at: Time, + idempotent: T::Boolean, + media: T::Hash[Symbol, T.anything], + media_id: String, + media_url: String, message: String, message_id: String, + request_hash: String, + request_id: String, + result_id: String, send_dispatched_at: Time, - target_id: T.nilable(String), - tweet_id: String + tweet_id: String, + updated_at: Time } ) end def to_hash end - class Media < XTwitterScraper::Internal::Type::BaseModel + class Account < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account, XTwitterScraper::Internal::AnyHash ) end - sig { returns(Integer) } - attr_accessor :count + sig { returns(String) } + attr_accessor :id sig { returns(String) } - attr_accessor :credits + attr_accessor :username + + # Connected account selected for the write. + sig { params(id: String, username: String).returns(T.attached_class) } + def self.new(id:, username:) + end + + sig { override.returns({ id: String, username: String }) } + def to_hash + end + end + + module Action + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_TWEET = + T.let( + :create_tweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + DELETE_TWEET = + T.let( + :delete_tweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + LIKE = + T.let( + :like, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UNLIKE = + T.let( + :unlike, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + RETWEET = + T.let( + :retweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UNRETWEET = + T.let( + :unretweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + FOLLOW = + T.let( + :follow, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UNFOLLOW = + T.let( + :unfollow, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + REMOVE_FOLLOWER = + T.let( + :remove_follower, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + SEND_DM = + T.let( + :send_dm, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UPLOAD_MEDIA = + T.let( + :upload_media, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UPDATE_PROFILE = + T.let( + :update_profile, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UPDATE_AVATAR = + T.let( + :update_avatar, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + UPDATE_BANNER = + T.let( + :update_banner, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + CREATE_COMMUNITY = + T.let( + :create_community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + DELETE_COMMUNITY = + T.let( + :delete_community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + JOIN_COMMUNITY = + T.let( + :join_community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) + LEAVE_COMMUNITY = + T.let( + :leave_community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ) sig do - returns( - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action::TaggedSymbol + ] ) end - attr_accessor :kind + def self.values + end + end + + class Billing < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :charged + + sig { returns(String) } + attr_accessor :charged_credits sig { returns(String) } - attr_accessor :total_bytes + attr_accessor :planned_credits + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + end + attr_accessor :status + + # plannedCredits is the approved maximum. chargedCredits comes from the settled + # credit ledger. Pending or failed writes are not charged. + sig do + params( + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(charged:, charged_credits:, planned_credits:, status:) + end + + sig do + override.returns( + { + charged: T::Boolean, + charged_credits: String, + planned_credits: String, + status: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + } + ) + end + def to_hash + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_CHARGED = + T.let( + :not_charged, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + CHARGED = + T.let( + :charged, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + CHARGE_FAILED = + T.let( + :charge_failed, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + REFUNDED = + T.let( + :refunded, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction, + XTwitterScraper::Internal::AnyHash + ) + end + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(Integer)) } + attr_reader :after_ms + + sig { params(after_ms: Integer).void } + attr_writer :after_ms + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :requires_new_idempotency_key + + sig { params(requires_new_idempotency_key: T::Boolean).void } + attr_writer :requires_new_idempotency_key + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + # Exact follow-up an API client or agent should perform. sig do params( - count: Integer, - credits: String, - kind: - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::OrSymbol, - total_bytes: String + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::OrSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String ).returns(T.attached_class) end - def self.new(count:, credits:, kind:, total_bytes:) + def self.new( + type:, + after_ms: nil, + requires_new_idempotency_key: nil, + url: nil + ) end sig do override.returns( { - count: Integer, - credits: String, - kind: - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol, - total_bytes: String + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol, + after_ms: Integer, + requires_new_idempotency_key: T::Boolean, + url: String } ) end def to_hash end - module Kind + module Type extend XTwitterScraper::Internal::Type::Enum TaggedSymbol = T.type_alias do T.all( Symbol, - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type ) end OrSymbol = T.type_alias { T.any(Symbol, String) } - NONE = + POLL = + T.let( + :poll, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol + ) + RETRY = T.let( - :none, - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + :retry, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol ) - IMAGE = + VERIFY_RESULT = T.let( - :image, - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + :verify_result, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol ) - VIDEO = + FIX_REQUEST = T.let( - :video, - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + :fix_request, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol ) sig do override.returns( T::Array[ - XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::Kind::TaggedSymbol + XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Request < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + XTwitterScraper::Internal::AnyHash + ) + end + + # Stable hash of account, action, target, and payload. + sig { returns(T.nilable(String)) } + attr_accessor :hash_ + + # Exact sanitized payload dispatched for this action. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :payload + + # Stable fingerprint and sanitized payload for replay checks. + sig do + params( + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + ).returns(T.attached_class) + end + def self.new( + # Stable hash of account, action, target, and payload. + hash_:, + # Exact sanitized payload dispatched for this action. + payload: + ) + end + + sig do + override.returns( + { + hash_: T.nilable(String), + payload: T.nilable(T::Hash[Symbol, T.anything]) + } + ) + end + def to_hash + end + end + + class Result < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::OrSymbol + ).void + end + attr_writer :type + + # Confirmed result produced by the write, when available. + sig do + params( + id: String, + state: String, + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id: nil, state: nil, type: nil) + end + + sig do + override.returns( + { + id: String, + state: String, + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + DIRECT_MESSAGE = + T.let( + :direct_message, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + STATE_CHANGE = + T.let( + :state_change, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::Type::TaggedSymbol ] ) end @@ -281,6 +1048,21 @@ module XTwitterScraper end OrSymbol = T.type_alias { T.any(Symbol, String) } + ACCEPTED = + T.let( + :accepted, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + DISPATCHING = + T.let( + :dispatching, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) + PENDING_CONFIRMATION = + T.let( + :pending_confirmation, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol + ) SUCCESS = T.let( :success, @@ -291,9 +1073,9 @@ module XTwitterScraper :failed, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol ) - PENDING_CONFIRMATION = + EXPIRED = T.let( - :pending_confirmation, + :expired, XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status::TaggedSymbol ) @@ -307,6 +1089,88 @@ module XTwitterScraper def self.values end end + + class Target < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Existing X resource targeted by the write, when applicable. + sig do + params( + id: String, + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, type:) + end + + sig do + override.returns( + { + id: String, + type: + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWEET = + T.let( + :tweet, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + ) + USER = + T.let( + :user, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + ) + COMMUNITY = + T.let( + :community, + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/x_twitter_scraper/resources/support/tickets.rbi b/rbi/x_twitter_scraper/resources/support/tickets.rbi index 8cedfbf..f8a46c9 100644 --- a/rbi/x_twitter_scraper/resources/support/tickets.rbi +++ b/rbi/x_twitter_scraper/resources/support/tickets.rbi @@ -10,10 +10,20 @@ module XTwitterScraper params( body: String, subject: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::Support::TicketCreateResponse) end - def create(body:, subject:, request_options: {}) + def create( + # Body param + body:, + # Body param + subject:, + # Header param: Generate one random value per ticket or reply. Reuse it only when + # retrying identical text and attachments. Never log this value. + idempotency_key: nil, + request_options: {} + ) end # Get ticket with all messages @@ -61,13 +71,18 @@ module XTwitterScraper params( id: String, body: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::Support::TicketReplyResponse) end def reply( - # Support ticket public ID for the reply + # Path param: Support ticket public ID for the reply id, + # Body param body:, + # Header param: Generate one random value per ticket or reply. Reuse it only when + # retrying identical text and attachments. Never log this value. + idempotency_key: nil, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x.rbi b/rbi/x_twitter_scraper/resources/x.rbi index 65b7489..7e16afa 100644 --- a/rbi/x_twitter_scraper/resources/x.rbi +++ b/rbi/x_twitter_scraper/resources/x.rbi @@ -20,7 +20,6 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Dm) } attr_reader :dm - # Media upload and download sig { returns(XTwitterScraper::Resources::X::Media) } attr_reader :media diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index 9d91758..34584b6 100644 --- a/rbi/x_twitter_scraper/resources/x/communities.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities.rbi @@ -17,16 +17,22 @@ module XTwitterScraper params( account: String, name: String, + idempotency_key: String, description: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::CommunityCreateResponse) end def create( - # X account (@username or ID) creating the community + # Body param: X account (@username or ID) creating the community account:, - # Community name + # Body param: Community name name:, - # Community description + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, + # Body param: Community description description: nil, request_options: {} ) @@ -38,16 +44,22 @@ module XTwitterScraper id: String, account: String, community_name: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::CommunityDeleteResponse) end def delete( - # Resource ID returned by the matching create or list endpoint. + # Path param: Resource ID returned by the matching create or list endpoint. id, - # X account (@username or ID) deleting the community + # Body param: X account (@username or ID) deleting the community account:, - # Community name for confirmation + # Body param: Community name for confirmation community_name:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/communities/join.rbi b/rbi/x_twitter_scraper/resources/x/communities/join.rbi index 9bd1d07..0855983 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/join.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/join.rbi @@ -11,16 +11,22 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns( XTwitterScraper::Models::X::Communities::JoinCreateResponse ) end def create( - # Resource ID returned by the matching create or list endpoint. + # Path param: Resource ID returned by the matching create or list endpoint. id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end @@ -30,16 +36,22 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns( XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse ) end def delete_all( - # Resource ID returned by the matching create or list endpoint. + # Path param: Resource ID returned by the matching create or list endpoint. id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/dm.rbi b/rbi/x_twitter_scraper/resources/x/dm.rbi index 0643b0b..f6cdca4 100644 --- a/rbi/x_twitter_scraper/resources/x/dm.rbi +++ b/rbi/x_twitter_scraper/resources/x/dm.rbi @@ -34,17 +34,24 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, media_ids: T::Array[String], request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::DmSendResponse) end def send_( - # Recipient user ID + # Path param: Recipient user ID user_id, - # X account (@username or ID) sending the DM + # Body param: X account (@username or ID) sending the DM account:, + # Body param text:, - # Optional array containing exactly 1 uploaded media ID. + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, + # Body param: Optional array containing exactly 1 uploaded media ID. media_ids: nil, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/x/media.rbi b/rbi/x_twitter_scraper/resources/x/media.rbi index 32f8fb1..a40c4bc 100644 --- a/rbi/x_twitter_scraper/resources/x/media.rbi +++ b/rbi/x_twitter_scraper/resources/x/media.rbi @@ -3,7 +3,6 @@ module XTwitterScraper module Resources class X - # Media upload and download class Media # Download images & videos from tweets sig do @@ -33,14 +32,20 @@ module XTwitterScraper params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::MediaUploadResponse) end def upload( - # X account (@username or ID) uploading media from URL + # Body param: X account (@username or ID) uploading media from URL account:, - # HTTPS URL to download and upload as media + # Body param: HTTPS URL to download and upload as media url:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/profile.rbi b/rbi/x_twitter_scraper/resources/x/profile.rbi index 448cf44..b0aa364 100644 --- a/rbi/x_twitter_scraper/resources/x/profile.rbi +++ b/rbi/x_twitter_scraper/resources/x/profile.rbi @@ -9,6 +9,7 @@ module XTwitterScraper sig do params( account: String, + idempotency_key: String, description: String, location: String, name: String, @@ -17,14 +18,20 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::ProfileUpdateResponse) end def update( - # X account (@username or ID) to update profile + # Body param: X account (@username or ID) to update profile account:, - # Bio description + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, + # Body param: Bio description description: nil, + # Body param location: nil, - # Display name + # Body param: Display name name: nil, - # Website URL + # Body param: Website URL url: nil, request_options: {} ) @@ -35,14 +42,20 @@ module XTwitterScraper params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::ProfileUpdateAvatarResponse) end def update_avatar( - # X account (@username or ID) receiving avatar from URL + # Body param: X account (@username or ID) receiving avatar from URL account:, - # HTTPS URL to the avatar image to download + # Body param: HTTPS URL to the avatar image to download url:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end @@ -52,14 +65,20 @@ module XTwitterScraper params( account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::ProfileUpdateBannerResponse) end def update_banner( - # X account (@username or ID) receiving banner from URL + # Body param: X account (@username or ID) receiving banner from URL account:, - # HTTPS URL to the banner image to download + # Body param: HTTPS URL to the banner image to download url:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index c396595..5b1f170 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -16,7 +16,7 @@ module XTwitterScraper sig do params( account: String, - attachment_url: String, + idempotency_key: String, community_id: String, is_note_tweet: T::Boolean, media: T::Array[String], @@ -26,17 +26,24 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::X::TweetCreateResponse) end def create( - # X account (@username or account ID) + # Body param: X account (@username or account ID) account:, - attachment_url: nil, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, + # Body param community_id: nil, + # Body param is_note_tweet: nil, - # Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 - # video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 - # credits per started MB across all files. + # Body param: Array of public media URLs to attach. Supports up to 4 images or + # exactly 1 MP4 video up to 100 MB. Each URL must be publicly reachable. Attached + # media adds 2 credits per started MB across all files. media: nil, + # Body param reply_to_tweet_id: nil, - # Tweet text (optional when media is provided) + # Body param: Tweet text (optional when media is provided) text: nil, request_options: {} ) @@ -75,19 +82,27 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::TweetDeleteResponse) end def delete( - # Tweet ID to delete + # Path param: Tweet ID to delete id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end - # List users who liked a tweet + # Returns liker profiles that X makes visible for the post. X can withhold liker + # identities even when the post reports likes. In that case this endpoint returns + # 424 `favoriters_unavailable` instead of a misleading empty success. sig do params( id: String, @@ -222,7 +237,11 @@ module XTwitterScraper ) end - # List replies to a tweet + # Returns visible replies. For an unfiltered first page, Xquik compares a terminal + # page with the post's reported reply count. If the page is visibly incomplete, + # the endpoint returns 424 `replies_incomplete` instead of presenting partial + # coverage as complete. Use tweet search with a `conversation_id:{id}` query as + # the broader fallback. sig do params( id: String, diff --git a/rbi/x_twitter_scraper/resources/x/tweets/like.rbi b/rbi/x_twitter_scraper/resources/x/tweets/like.rbi index 3f59156..8122eef 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets/like.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets/like.rbi @@ -11,14 +11,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::LikeCreateResponse) end def create( - # Tweet ID to like + # Path param: Tweet ID to like id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end @@ -28,14 +34,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::LikeDeleteResponse) end def delete( - # Tweet ID to unlike + # Path param: Tweet ID to unlike id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi b/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi index a828256..75a062f 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi @@ -11,14 +11,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::RetweetCreateResponse) end def create( - # Tweet ID to retweet + # Path param: Tweet ID to retweet id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end @@ -28,14 +34,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse) end def delete( - # Tweet ID to unretweet + # Path param: Tweet ID to unretweet id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index d8eb1f5..2ec5814 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -27,14 +27,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::UserRemoveFollowerResponse) end def remove_follower( - # User ID to remove from your followers + # Path param: User ID to remove from your followers id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/rbi/x_twitter_scraper/resources/x/users/follow.rbi b/rbi/x_twitter_scraper/resources/x/users/follow.rbi index 35626ff..2673210 100644 --- a/rbi/x_twitter_scraper/resources/x/users/follow.rbi +++ b/rbi/x_twitter_scraper/resources/x/users/follow.rbi @@ -11,14 +11,20 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::Models::X::Users::FollowCreateResponse) end def create( - # User ID to follow + # Path param: User ID to follow id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end @@ -28,16 +34,22 @@ module XTwitterScraper params( id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions::OrHash ).returns( XTwitterScraper::Models::X::Users::FollowDeleteAllResponse ) end def delete_all( - # User ID to unfollow + # Path param: User ID to unfollow id, - # X account identifier (@username or account ID) + # Body param: X account identifier (@username or account ID) account:, + # Header param: Generate one unique value for each intended write. Reuse it only + # when retrying the exact same account, action, target, and payload. A reused key + # returns the original action. Reusing it with different input returns 409. Replay + # protection remains active for at least 90 days. + idempotency_key:, request_options: {} ) end diff --git a/sig/x_twitter_scraper/models/error.rbs b/sig/x_twitter_scraper/models/error.rbs index 3cdbfad..4478bca 100644 --- a/sig/x_twitter_scraper/models/error.rbs +++ b/sig/x_twitter_scraper/models/error.rbs @@ -1,13 +1,48 @@ module XTwitterScraper module Models - type error = { error: XTwitterScraper::Models::Error::error } + type error = + { + error: XTwitterScraper::Models::Error::error, + message: String, + reason: String, + retry_after: Integer, + retry_after_ms: Integer + } class Error < XTwitterScraper::Internal::Type::BaseModel attr_accessor error: XTwitterScraper::Models::Error::error - def initialize: (error: XTwitterScraper::Models::Error::error) -> void + attr_reader message: String? - def to_hash: -> { error: XTwitterScraper::Models::Error::error } + def message=: (String) -> String + + attr_reader reason: String? + + def reason=: (String) -> String + + attr_reader retry_after: Integer? + + def retry_after=: (Integer) -> Integer + + attr_reader retry_after_ms: Integer? + + def retry_after_ms=: (Integer) -> Integer + + def initialize: ( + error: XTwitterScraper::Models::Error::error, + ?message: String, + ?reason: String, + ?retry_after: Integer, + ?retry_after_ms: Integer + ) -> void + + def to_hash: -> { + error: XTwitterScraper::Models::Error::error, + message: String, + reason: String, + retry_after: Integer, + retry_after_ms: Integer + } type error = XTwitterScraper::Models::Error::Error::legacy_error_code @@ -83,7 +118,6 @@ module XTwitterScraper | :x_user_lookup_failed | :x_write_ambiguous | :x_write_failed - | :x_write_unconfirmed module LegacyErrorCode extend XTwitterScraper::Internal::Type::Enum @@ -154,7 +188,6 @@ module XTwitterScraper X_USER_LOOKUP_FAILED: :x_user_lookup_failed X_WRITE_AMBIGUOUS: :x_write_ambiguous X_WRITE_FAILED: :x_write_failed - X_WRITE_UNCONFIRMED: :x_write_unconfirmed def self?.values: -> ::Array[XTwitterScraper::Models::Error::Error::legacy_error_code] end @@ -252,7 +285,6 @@ module XTwitterScraper | :x_user_lookup_failed | :x_write_ambiguous | :x_write_failed - | :x_write_unconfirmed module Code extend XTwitterScraper::Internal::Type::Enum @@ -323,7 +355,6 @@ module XTwitterScraper X_USER_LOOKUP_FAILED: :x_user_lookup_failed X_WRITE_AMBIGUOUS: :x_write_ambiguous X_WRITE_FAILED: :x_write_failed - X_WRITE_UNCONFIRMED: :x_write_unconfirmed def self?.values: -> ::Array[XTwitterScraper::Models::Error::Error::StructuredError::code] end diff --git a/sig/x_twitter_scraper/models/support/ticket_create_params.rbs b/sig/x_twitter_scraper/models/support/ticket_create_params.rbs index 01388c2..957dea3 100644 --- a/sig/x_twitter_scraper/models/support/ticket_create_params.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_create_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module Support type ticket_create_params = - { body: String, subject: String } + { body: String, subject: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class TicketCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,21 @@ module XTwitterScraper attr_accessor subject: String + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + def initialize: ( body: String, subject: String, + ?idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { body: String, subject: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/support/ticket_create_response.rbs b/sig/x_twitter_scraper/models/support/ticket_create_response.rbs index 88958c5..81bb6e9 100644 --- a/sig/x_twitter_scraper/models/support/ticket_create_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_create_response.rbs @@ -1,16 +1,66 @@ module XTwitterScraper module Models module Support - type ticket_create_response = { public_id: String } + type ticket_create_response = + { + attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], + public_id: String + } class TicketCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]? + + def attachments=: ( + ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] + ) -> ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] + attr_reader public_id: String? def public_id=: (String) -> String - def initialize: (?public_id: String) -> void + def initialize: ( + ?attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], + ?public_id: String + ) -> void + + def to_hash: -> { + attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], + public_id: String + } + + type attachment = + { + public_id: String, + status: XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::status + } + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + attr_accessor public_id: String + + attr_accessor status: XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::status + + def initialize: ( + public_id: String, + status: XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::status + ) -> void + + def to_hash: -> { + public_id: String, + status: XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::status + } + + type status = :pending | :ready | :failed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING: :pending + READY: :ready + FAILED: :failed - def to_hash: -> { public_id: String } + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::status] + end + end end end end diff --git a/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs b/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs index 095a436..436b26e 100644 --- a/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module Support type ticket_reply_params = - { id: String, body: String } + { id: String, body: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class TicketReplyParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,21 @@ module XTwitterScraper attr_accessor body: String + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + def initialize: ( id: String, body: String, + ?idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, body: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs b/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs index c24231a..440f1d0 100644 --- a/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs @@ -1,16 +1,66 @@ module XTwitterScraper module Models module Support - type ticket_reply_response = { public_id: String } + type ticket_reply_response = + { + attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], + public_id: String + } class TicketReplyResponse < XTwitterScraper::Internal::Type::BaseModel + attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]? + + def attachments=: ( + ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] + ) -> ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] + attr_reader public_id: String? def public_id=: (String) -> String - def initialize: (?public_id: String) -> void + def initialize: ( + ?attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], + ?public_id: String + ) -> void + + def to_hash: -> { + attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], + public_id: String + } + + type attachment = + { + public_id: String, + status: XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::status + } + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + attr_accessor public_id: String + + attr_accessor status: XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::status + + def initialize: ( + public_id: String, + status: XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::status + ) -> void + + def to_hash: -> { + public_id: String, + status: XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::status + } + + type status = :pending | :ready | :failed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING: :pending + READY: :ready + FAILED: :failed - def to_hash: -> { public_id: String } + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::status] + end + end end end end diff --git a/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs b/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs index 8edc5fe..9e1d6ee 100644 --- a/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs @@ -56,9 +56,21 @@ module XTwitterScraper updated_at: Time } - type message = { body: String, created_at: Time, sender: String } + type message = + { + attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], + body: String, + created_at: Time, + sender: String + } class Message < XTwitterScraper::Internal::Type::BaseModel + attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment]? + + def attachments=: ( + ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] + ) -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] + attr_reader body: String? def body=: (String) -> String @@ -72,12 +84,111 @@ module XTwitterScraper def sender=: (String) -> String def initialize: ( + ?attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], ?body: String, ?created_at: Time, ?sender: String ) -> void - def to_hash: -> { body: String, created_at: Time, sender: String } + def to_hash: -> { + attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], + body: String, + created_at: Time, + sender: String + } + + type attachment = + { + content_type: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::content_type, + filename: String, + kind: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::kind, + public_id: String, + size_bytes: Integer, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status, + url: String + } + + class Attachment < XTwitterScraper::Internal::Type::BaseModel + attr_accessor content_type: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::content_type + + attr_accessor filename: String + + attr_accessor kind: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::kind + + attr_accessor public_id: String + + attr_accessor size_bytes: Integer + + attr_accessor status: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status + + attr_accessor url: String + + def initialize: ( + content_type: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::content_type, + filename: String, + kind: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::kind, + public_id: String, + size_bytes: Integer, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status, + url: String + ) -> void + + def to_hash: -> { + content_type: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::content_type, + filename: String, + kind: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::kind, + public_id: String, + size_bytes: Integer, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status, + url: String + } + + type content_type = + :"image/jpeg" + | :"image/png" + | :"image/gif" + | :"image/webp" + | :"video/mp4" + | :"video/quicktime" + | :"video/webm" + + module ContentType + extend XTwitterScraper::Internal::Type::Enum + + IMAGE_JPEG: :"image/jpeg" + IMAGE_PNG: :"image/png" + IMAGE_GIF: :"image/gif" + IMAGE_WEBP: :"image/webp" + VIDEO_MP4: :"video/mp4" + VIDEO_QUICKTIME: :"video/quicktime" + VIDEO_WEBM: :"video/webm" + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::content_type] + end + + type kind = :image | :video + + module Kind + extend XTwitterScraper::Internal::Type::Enum + + IMAGE: :image + VIDEO: :video + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::kind] + end + + type status = :pending | :ready | :failed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING: :pending + READY: :ready + FAILED: :failed + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs b/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs index e2f0b6a..d90278f 100644 --- a/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper module X module Communities type join_create_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class JoinCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } 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 index e81339c..4129ea6 100644 --- a/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Communities - type join_create_response = { success: true } + type join_create_response = + { + id: String, + account: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class JoinCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs b/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs index 5a62705..b884917 100644 --- a/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs +++ b/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs @@ -3,7 +3,7 @@ module XTwitterScraper module X module Communities type join_delete_all_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class JoinDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } 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 index b92d6b9..d8d39d7 100644 --- 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 @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Communities - type join_delete_all_response = { success: true } + type join_delete_all_response = + { + id: String, + account: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class JoinDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/community_create_params.rbs b/sig/x_twitter_scraper/models/x/community_create_params.rbs index 004813d..5e3b70e 100644 --- a/sig/x_twitter_scraper/models/x/community_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/community_create_params.rbs @@ -2,7 +2,12 @@ module XTwitterScraper module Models module X type community_create_params = - { account: String, name: String, description: String } + { + account: String, + name: String, + idempotency_key: String, + description: String + } & XTwitterScraper::Internal::Type::request_parameters class CommunityCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,6 +18,8 @@ module XTwitterScraper attr_accessor name: String + attr_accessor idempotency_key: String + attr_reader description: String? def description=: (String) -> String @@ -20,6 +27,7 @@ module XTwitterScraper def initialize: ( account: String, name: String, + idempotency_key: String, ?description: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -27,6 +35,7 @@ module XTwitterScraper def to_hash: -> { account: String, name: String, + idempotency_key: String, description: String, request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/community_create_response.rbs b/sig/x_twitter_scraper/models/x/community_create_response.rbs index 81f4977..93d4a42 100644 --- a/sig/x_twitter_scraper/models/x/community_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/community_create_response.rbs @@ -2,28 +2,549 @@ module XTwitterScraper module Models module X type community_create_response = - { community_id: String, success: true, community_name: String } + { + id: String, + account: XTwitterScraper::Models::X::CommunityCreateResponse::Account?, + action: XTwitterScraper::Models::X::CommunityCreateResponse::action, + billing: XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityCreateResponse::Request, + result: XTwitterScraper::Models::X::CommunityCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class CommunityCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor community_id: String + attr_accessor id: String + + attr_accessor account: XTwitterScraper::Models::X::CommunityCreateResponse::Account? + + attr_accessor action: XTwitterScraper::Models::X::CommunityCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::CommunityCreateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::CommunityCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::CommunityCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::CommunityCreateResponse::status + + attr_accessor status_url: String - attr_accessor success: true + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::CommunityCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String attr_reader community_name: String? def community_name=: (String) -> String + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + def initialize: ( - community_id: String, + id: String, + account: XTwitterScraper::Models::X::CommunityCreateResponse::Account?, + action: XTwitterScraper::Models::X::CommunityCreateResponse::action, + billing: XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityCreateResponse::Request, + result: XTwitterScraper::Models::X::CommunityCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, ?community_name: String, - ?success: true + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action ) -> void def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::CommunityCreateResponse::Account?, + action: XTwitterScraper::Models::X::CommunityCreateResponse::action, + billing: XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityCreateResponse::Request, + result: XTwitterScraper::Models::X::CommunityCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, community_id: String, - success: true, - community_name: String + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::CommunityCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::CommunityCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::CommunityCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::CommunityCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::CommunityCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityCreateResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/community_delete_params.rbs b/sig/x_twitter_scraper/models/x/community_delete_params.rbs index e4ba513..6a4b853 100644 --- a/sig/x_twitter_scraper/models/x/community_delete_params.rbs +++ b/sig/x_twitter_scraper/models/x/community_delete_params.rbs @@ -2,7 +2,12 @@ module XTwitterScraper module Models module X type community_delete_params = - { id: String, account: String, community_name: String } + { + id: String, + account: String, + community_name: String, + idempotency_key: String + } & XTwitterScraper::Internal::Type::request_parameters class CommunityDeleteParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,10 +20,13 @@ module XTwitterScraper attr_accessor community_name: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, community_name: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void @@ -26,6 +34,7 @@ module XTwitterScraper id: String, account: String, community_name: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/community_delete_response.rbs b/sig/x_twitter_scraper/models/x/community_delete_response.rbs index 08b1975..0b5cace 100644 --- a/sig/x_twitter_scraper/models/x/community_delete_response.rbs +++ b/sig/x_twitter_scraper/models/x/community_delete_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type community_delete_response = { success: true } + type community_delete_response = + { + id: String, + account: XTwitterScraper::Models::X::CommunityDeleteResponse::Account?, + action: XTwitterScraper::Models::X::CommunityDeleteResponse::action, + billing: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + result: XTwitterScraper::Models::X::CommunityDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class CommunityDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::CommunityDeleteResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::CommunityDeleteResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::CommunityDeleteResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::CommunityDeleteResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::CommunityDeleteResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::CommunityDeleteResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::CommunityDeleteResponse::Account?, + action: XTwitterScraper::Models::X::CommunityDeleteResponse::action, + billing: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + result: XTwitterScraper::Models::X::CommunityDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::CommunityDeleteResponse::Account?, + action: XTwitterScraper::Models::X::CommunityDeleteResponse::action, + billing: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + result: XTwitterScraper::Models::X::CommunityDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::CommunityDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_ + ) -> XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::CommunityDeleteResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::CommunityDeleteResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::CommunityDeleteResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::CommunityDeleteResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::CommunityDeleteResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/dm_send_params.rbs b/sig/x_twitter_scraper/models/x/dm_send_params.rbs index 14d2cf0..b7c65ed 100644 --- a/sig/x_twitter_scraper/models/x/dm_send_params.rbs +++ b/sig/x_twitter_scraper/models/x/dm_send_params.rbs @@ -6,6 +6,7 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, media_ids: ::Array[String] } & XTwitterScraper::Internal::Type::request_parameters @@ -20,6 +21,8 @@ module XTwitterScraper attr_accessor text: String + attr_accessor idempotency_key: String + attr_reader media_ids: ::Array[String]? def media_ids=: (::Array[String]) -> ::Array[String] @@ -28,6 +31,7 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, ?media_ids: ::Array[String], ?request_options: XTwitterScraper::request_opts ) -> void @@ -36,6 +40,7 @@ module XTwitterScraper user_id: String, account: String, text: String, + idempotency_key: String, media_ids: ::Array[String], request_options: XTwitterScraper::RequestOptions } diff --git a/sig/x_twitter_scraper/models/x/dm_send_response.rbs b/sig/x_twitter_scraper/models/x/dm_send_response.rbs index 870ea1e..cd7294a 100644 --- a/sig/x_twitter_scraper/models/x/dm_send_response.rbs +++ b/sig/x_twitter_scraper/models/x/dm_send_response.rbs @@ -1,16 +1,550 @@ module XTwitterScraper module Models module X - type dm_send_response = { message_id: String, success: true } + type dm_send_response = + { + id: String, + account: XTwitterScraper::Models::X::DmSendResponse::Account?, + action: XTwitterScraper::Models::X::DmSendResponse::action, + billing: XTwitterScraper::Models::X::DmSendResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::DmSendResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::DmSendResponse::Request, + result: XTwitterScraper::Models::X::DmSendResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::DmSendResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::DmSendResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class DmSendResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor message_id: String + attr_accessor id: String - attr_accessor success: true + attr_accessor account: XTwitterScraper::Models::X::DmSendResponse::Account? - def initialize: (message_id: String, ?success: true) -> void + attr_accessor action: XTwitterScraper::Models::X::DmSendResponse::action - def to_hash: -> { message_id: String, success: true } + attr_accessor billing: XTwitterScraper::Models::X::DmSendResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::DmSendResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::DmSendResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::DmSendResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::DmSendResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::DmSendResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::DmSendResponse::Account?, + action: XTwitterScraper::Models::X::DmSendResponse::action, + billing: XTwitterScraper::Models::X::DmSendResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::DmSendResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::DmSendResponse::Request, + result: XTwitterScraper::Models::X::DmSendResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::DmSendResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::DmSendResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::DmSendResponse::Account?, + action: XTwitterScraper::Models::X::DmSendResponse::action, + billing: XTwitterScraper::Models::X::DmSendResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::DmSendResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::DmSendResponse::Request, + result: XTwitterScraper::Models::X::DmSendResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::DmSendResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::DmSendResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::DmSendResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::DmSendResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::DmSendResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::DmSendResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::DmSendResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::DmSendResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::DmSendResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::DmSendResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::DmSendResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::DmSendResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::DmSendResponse::Result::type_ + ) -> XTwitterScraper::Models::X::DmSendResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::DmSendResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::DmSendResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::DmSendResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::DmSendResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::DmSendResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::DmSendResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::DmSendResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/media_upload_params.rbs b/sig/x_twitter_scraper/models/x/media_upload_params.rbs index 098d015..34d9c68 100644 --- a/sig/x_twitter_scraper/models/x/media_upload_params.rbs +++ b/sig/x_twitter_scraper/models/x/media_upload_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type media_upload_params = - { account: String, url: String } + { account: String, url: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class MediaUploadParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,19 @@ module XTwitterScraper attr_accessor url: String + attr_accessor idempotency_key: String + def initialize: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/media_upload_response.rbs b/sig/x_twitter_scraper/models/x/media_upload_response.rbs index c552259..b90d3d5 100644 --- a/sig/x_twitter_scraper/models/x/media_upload_response.rbs +++ b/sig/x_twitter_scraper/models/x/media_upload_response.rbs @@ -2,22 +2,549 @@ module XTwitterScraper module Models module X type media_upload_response = - { media_id: String, media_url: String, success: true } + { + id: String, + account: XTwitterScraper::Models::X::MediaUploadResponse::Account?, + action: XTwitterScraper::Models::X::MediaUploadResponse::action, + billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::MediaUploadResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::MediaUploadResponse::Request, + result: XTwitterScraper::Models::X::MediaUploadResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::MediaUploadResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::MediaUploadResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class MediaUploadResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor media_id: String + attr_accessor id: String + + attr_accessor account: XTwitterScraper::Models::X::MediaUploadResponse::Account? + + attr_accessor action: XTwitterScraper::Models::X::MediaUploadResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::MediaUploadResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::MediaUploadResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::MediaUploadResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::MediaUploadResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::MediaUploadResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? - attr_accessor media_url: String + def confirmed_at=: (Time) -> Time - attr_accessor success: true + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time def initialize: ( + id: String, + account: XTwitterScraper::Models::X::MediaUploadResponse::Account?, + action: XTwitterScraper::Models::X::MediaUploadResponse::action, + billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::MediaUploadResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::MediaUploadResponse::Request, + result: XTwitterScraper::Models::X::MediaUploadResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::MediaUploadResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::MediaUploadResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::MediaUploadResponse::Account?, + action: XTwitterScraper::Models::X::MediaUploadResponse::action, + billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::MediaUploadResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::MediaUploadResponse::Request, + result: XTwitterScraper::Models::X::MediaUploadResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::MediaUploadResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::MediaUploadResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], media_id: String, media_url: String, - ?success: true - ) -> void + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::MediaUploadResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::MediaUploadResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::MediaUploadResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::MediaUploadResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::MediaUploadResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::MediaUploadResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::MediaUploadResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::MediaUploadResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::MediaUploadResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::MediaUploadResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::MediaUploadResponse::Result::type_ + ) -> XTwitterScraper::Models::X::MediaUploadResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::MediaUploadResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::MediaUploadResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::MediaUploadResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::MediaUploadResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::MediaUploadResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::MediaUploadResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community - def to_hash: -> { media_id: String, media_url: String, success: true } + def self?.values: -> ::Array[XTwitterScraper::Models::X::MediaUploadResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs b/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs index 63af1bb..dbd9888 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type profile_update_avatar_params = - { account: String, url: String } + { account: String, url: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class ProfileUpdateAvatarParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,19 @@ module XTwitterScraper attr_accessor url: String + attr_accessor idempotency_key: String + def initialize: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs b/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs index 9ff5070..03888b4 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type profile_update_avatar_response = { success: true } + type profile_update_avatar_response = + { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class ProfileUpdateAvatarResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_ + ) -> XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs b/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs index 98caabd..0901e2e 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type profile_update_banner_params = - { account: String, url: String } + { account: String, url: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class ProfileUpdateBannerParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,19 @@ module XTwitterScraper attr_accessor url: String + attr_accessor idempotency_key: String + def initialize: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { account: String, url: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs b/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs index cfd1db5..8371aff 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type profile_update_banner_response = { success: true } + type profile_update_banner_response = + { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class ProfileUpdateBannerResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_ + ) -> XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/profile_update_params.rbs b/sig/x_twitter_scraper/models/x/profile_update_params.rbs index e5c2a6d..a91b108 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_params.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_params.rbs @@ -4,6 +4,7 @@ module XTwitterScraper type profile_update_params = { account: String, + idempotency_key: String, description: String, location: String, name: String, @@ -17,6 +18,8 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + attr_reader description: String? def description=: (String) -> String @@ -35,6 +38,7 @@ module XTwitterScraper def initialize: ( account: String, + idempotency_key: String, ?description: String, ?location: String, ?name: String, @@ -44,6 +48,7 @@ module XTwitterScraper def to_hash: -> { account: String, + idempotency_key: String, description: String, location: String, name: String, diff --git a/sig/x_twitter_scraper/models/x/profile_update_response.rbs b/sig/x_twitter_scraper/models/x/profile_update_response.rbs index 55ca5ff..5e889bd 100644 --- a/sig/x_twitter_scraper/models/x/profile_update_response.rbs +++ b/sig/x_twitter_scraper/models/x/profile_update_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type profile_update_response = { success: true } + type profile_update_response = + { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class ProfileUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::ProfileUpdateResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::ProfileUpdateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::ProfileUpdateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::ProfileUpdateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::ProfileUpdateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateResponse::Account?, + action: XTwitterScraper::Models::X::ProfileUpdateResponse::action, + billing: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::ProfileUpdateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::ProfileUpdateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::ProfileUpdateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::ProfileUpdateResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_create_params.rbs b/sig/x_twitter_scraper/models/x/tweet_create_params.rbs index ddb0bf5..aeea396 100644 --- a/sig/x_twitter_scraper/models/x/tweet_create_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_create_params.rbs @@ -4,7 +4,7 @@ module XTwitterScraper type tweet_create_params = { account: String, - attachment_url: String, + idempotency_key: String, community_id: String, is_note_tweet: bool, media: ::Array[String], @@ -19,9 +19,7 @@ module XTwitterScraper attr_accessor account: String - attr_reader attachment_url: String? - - def attachment_url=: (String) -> String + attr_accessor idempotency_key: String attr_reader community_id: String? @@ -45,7 +43,7 @@ module XTwitterScraper def initialize: ( account: String, - ?attachment_url: String, + idempotency_key: String, ?community_id: String, ?is_note_tweet: bool, ?media: ::Array[String], @@ -56,7 +54,7 @@ module XTwitterScraper def to_hash: -> { account: String, - attachment_url: String, + idempotency_key: String, community_id: String, is_note_tweet: bool, media: ::Array[String], diff --git a/sig/x_twitter_scraper/models/x/tweet_create_response.rbs b/sig/x_twitter_scraper/models/x/tweet_create_response.rbs index 5e38d24..2146a60 100644 --- a/sig/x_twitter_scraper/models/x/tweet_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_create_response.rbs @@ -3,41 +3,548 @@ module XTwitterScraper module X type tweet_create_response = { + id: String, + account: XTwitterScraper::Models::X::TweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::TweetCreateResponse::action, + billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing, charged: bool, charged_credits: String, - success: true, + next_action: XTwitterScraper::Models::X::TweetCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetCreateResponse::Request, + result: XTwitterScraper::Models::X::TweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, tweet_id: String, - write_action_id: String + updated_at: Time } class TweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account: XTwitterScraper::Models::X::TweetCreateResponse::Account? + + attr_accessor action: XTwitterScraper::Models::X::TweetCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing + attr_accessor charged: bool attr_accessor charged_credits: String - attr_accessor success: true + attr_accessor next_action: XTwitterScraper::Models::X::TweetCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::TweetCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::TweetCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::TweetCreateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::TweetCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time - attr_accessor tweet_id: String + attr_reader details: ::Hash[Symbol, top]? - attr_reader write_action_id: String? + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - def write_action_id=: (String) -> String + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time def initialize: ( + id: String, + account: XTwitterScraper::Models::X::TweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::TweetCreateResponse::action, + billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing, charged: bool, charged_credits: String, - tweet_id: String, - ?write_action_id: String, - ?success: true + next_action: XTwitterScraper::Models::X::TweetCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetCreateResponse::Request, + result: XTwitterScraper::Models::X::TweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action ) -> void def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::TweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::TweetCreateResponse::action, + billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing, charged: bool, charged_credits: String, - success: true, + next_action: XTwitterScraper::Models::X::TweetCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetCreateResponse::Request, + result: XTwitterScraper::Models::X::TweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, tweet_id: String, - write_action_id: String + updated_at: Time } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::TweetCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::TweetCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::TweetCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::TweetCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::TweetCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::TweetCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::TweetCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::TweetCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::TweetCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::TweetCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::TweetCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::TweetCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::TweetCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::TweetCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::TweetCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetCreateResponse::Target::type_] + end + end end end end 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 a554ba3..3f6509b 100644 --- a/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type tweet_delete_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class TweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs b/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs index c7435a1..0c7f260 100644 --- a/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type tweet_delete_response = { success: true } + type tweet_delete_response = + { + id: String, + account: XTwitterScraper::Models::X::TweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::TweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::TweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class TweetDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::TweetDeleteResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::TweetDeleteResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::TweetDeleteResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::TweetDeleteResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::TweetDeleteResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::TweetDeleteResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::TweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::TweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::TweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::TweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::TweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::TweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::TweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::TweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::TweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetDeleteResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::TweetDeleteResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetDeleteResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::TweetDeleteResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_ + ) -> XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::TweetDeleteResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::TweetDeleteResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::TweetDeleteResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::TweetDeleteResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetDeleteResponse::Target::type_] + 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 dcc4656..f12336a 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,7 +3,7 @@ module XTwitterScraper module X module Tweets type like_create_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class LikeCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs b/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs index f15fd18..4fb565a 100644 --- a/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Tweets - type like_create_response = { success: true } + type like_create_response = + { + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class LikeCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target::type_] + end + end end end end 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 cb8e849..dad3220 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,7 +3,7 @@ module XTwitterScraper module X module Tweets type like_delete_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class LikeDeleteParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs b/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs index b14d73c..49f7304 100644 --- a/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Tweets - type like_delete_response = { success: true } + type like_delete_response = + { + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class LikeDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target::type_] + end + end end end end 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 b3f1a82..92ab689 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,7 +3,7 @@ module XTwitterScraper module X module Tweets type retweet_create_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class RetweetCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs b/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs index f9e9ab5..3ddebbd 100644 --- a/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Tweets - type retweet_create_response = { success: true } + type retweet_create_response = + { + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class RetweetCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target::type_] + end + end end end end 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 6a5ff4e..3ac7f34 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,7 +3,7 @@ module XTwitterScraper module X module Tweets type retweet_delete_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class RetweetDeleteParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs b/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs index e6da7b0..8d7a754 100644 --- a/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs +++ b/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Tweets - type retweet_delete_response = { success: true } + type retweet_delete_response = + { + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class RetweetDeleteResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account?, + action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::action, + billing: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs b/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs index e8ccc5d..9edefe4 100644 --- a/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs +++ b/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs @@ -2,7 +2,7 @@ module XTwitterScraper module Models module X type user_remove_follower_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class UserRemoveFollowerParams < XTwitterScraper::Internal::Type::BaseModel @@ -13,15 +13,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs b/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs index 13fe45b..2ebc7d0 100644 --- a/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs +++ b/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs @@ -1,14 +1,550 @@ module XTwitterScraper module Models module X - type user_remove_follower_response = { success: true } + type user_remove_follower_response = + { + id: String, + account: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account?, + action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::action, + billing: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + result: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class UserRemoveFollowerResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account?, + action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::action, + billing: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + result: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account?, + action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::action, + billing: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + result: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_ + ) -> XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target::type_] + 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 433972b..179922e 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,7 +3,7 @@ module XTwitterScraper module X module Users type follow_create_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class FollowCreateParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs b/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs index d5bd743..9797fd4 100644 --- a/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Users - type follow_create_response = { success: true } + type follow_create_response = + { + id: String, + account: XTwitterScraper::Models::X::Users::FollowCreateResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowCreateResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class FollowCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Users::FollowCreateResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Users::FollowCreateResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Users::FollowCreateResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Users::FollowCreateResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Users::FollowCreateResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowCreateResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Users::FollowCreateResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowCreateResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowCreateResponse::Target::type_] + end + end end end end 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 4b479c7..68c6c63 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,7 +3,7 @@ module XTwitterScraper module X module Users type follow_delete_all_params = - { id: String, account: String } + { id: String, account: String, idempotency_key: String } & XTwitterScraper::Internal::Type::request_parameters class FollowDeleteAllParams < XTwitterScraper::Internal::Type::BaseModel @@ -14,15 +14,19 @@ module XTwitterScraper attr_accessor account: String + attr_accessor idempotency_key: String + def initialize: ( id: String, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, account: String, + idempotency_key: String, request_options: XTwitterScraper::RequestOptions } end diff --git a/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs b/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs index e773c2a..81ca68e 100644 --- a/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs +++ b/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs @@ -2,14 +2,550 @@ module XTwitterScraper module Models module X module Users - type follow_delete_all_response = { success: true } + type follow_delete_all_response = + { + id: String, + account: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } class FollowDeleteAllResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor success: true + attr_accessor id: String - def initialize: (?success: true) -> void + attr_accessor account: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account? - def to_hash: -> { success: true } + attr_accessor action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing + + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor next_action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? + + attr_accessor request: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request + + attr_accessor result: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool + + attr_accessor send_dispatched: bool + + attr_accessor status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::status + + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + + attr_accessor write_action_id: String + + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + attr_reader confirmation_attempts: Integer? + + def confirmation_attempts=: (Integer) -> Integer + + attr_reader confirmation_checked_at: Time? + + def confirmation_checked_at=: (Time) -> Time + + attr_reader confirmed_at: Time? + + def confirmed_at=: (Time) -> Time + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + + attr_reader message: String? + + def message=: (String) -> String + + attr_reader message_id: String? + + def message_id=: (String) -> String + + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + + attr_reader send_dispatched_at: Time? + + def send_dispatched_at=: (Time) -> Time + + attr_reader tweet_id: String? + + def tweet_id=: (String) -> String + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + id: String, + account: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, + ?confirmation_attempts: Integer, + ?confirmation_checked_at: Time, + ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, + ?message: String, + ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, + ?send_dispatched_at: Time, + ?tweet_id: String, + ?updated_at: Time, + ?object: :x_write_action + ) -> void + + def to_hash: -> { + id: String, + account: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account?, + action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::action, + billing: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + charged: bool, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result?, + retryable: bool, + safe_to_retry: bool, + send_dispatched: bool, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target?, + target_id: String?, + terminal: bool, + write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, + confirmation_attempts: Integer, + confirmation_checked_at: Time, + confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, + message: String, + message_id: String, + request_hash: String, + request_id: String, + result_id: String, + send_dispatched_at: Time, + tweet_id: String, + updated_at: Time + } + + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::action] + end + + type billing = + { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::status + } + + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool + + attr_accessor charged_credits: String + + attr_accessor planned_credits: String + + attr_accessor status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::status + + def initialize: ( + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::status + ) -> void + + def to_hash: -> { + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::status + } + + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded + + module Status + extend XTwitterScraper::Internal::Type::Enum + + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing::status] + end + end + + type next_action = + { + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_ + ) -> XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired + + module Status + extend XTwitterScraper::Internal::Type::Enum + + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation + SUCCESS: :success + FAILED: :failed + EXPIRED: :expired + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::status] + end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs index 8c521f2..08b41a6 100644 --- a/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs @@ -3,45 +3,106 @@ module XTwitterScraper module X type write_action_retrieve_response = { - action: String, + id: String, + account: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account?, + action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::action, + billing: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, charged: bool, charged_credits: String, - created_at: Time, - media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, - retryable: false, + next_action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + result: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result?, + retryable: bool, + safe_to_retry: bool, send_dispatched: bool, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target?, + target_id: String?, + terminal: bool, write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, confirmation_attempts: Integer, confirmation_checked_at: Time, - confirmation_source: String?, confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, message: String, message_id: String, + request_hash: String, + request_id: String, + result_id: String, send_dispatched_at: Time, - target_id: String?, - tweet_id: String + tweet_id: String, + updated_at: Time } class WriteActionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor action: String + attr_accessor id: String + + attr_accessor account: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account? + + attr_accessor action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::action + + attr_accessor billing: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing attr_accessor charged: bool attr_accessor charged_credits: String - attr_accessor created_at: Time + attr_accessor next_action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction? + + attr_accessor object: :x_write_action + + attr_accessor poll_after_ms: Integer? - attr_accessor media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media + attr_accessor request: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request - attr_accessor retryable: false + attr_accessor result: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result? + + attr_accessor retryable: bool + + attr_accessor safe_to_retry: bool attr_accessor send_dispatched: bool attr_accessor status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status + attr_accessor status_url: String + + attr_accessor success: bool + + attr_accessor target: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target? + + attr_accessor target_id: String? + + attr_accessor terminal: bool + attr_accessor write_action_id: String + attr_reader community_id: String? + + def community_id=: (String) -> String + + attr_reader community_name: String? + + def community_name=: (String) -> String + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + attr_reader confirmation_attempts: Integer? def confirmation_attempts=: (Integer) -> Integer @@ -50,12 +111,42 @@ module XTwitterScraper def confirmation_checked_at=: (Time) -> Time - attr_accessor confirmation_source: String? - attr_reader confirmed_at: Time? def confirmed_at=: (Time) -> Time + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader details: ::Hash[Symbol, top]? + + def details=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader error: String? + + def error=: (String) -> String + + attr_reader expires_at: Time? + + def expires_at=: (Time) -> Time + + attr_reader idempotent: bool? + + def idempotent=: (bool) -> bool + + attr_reader media: ::Hash[Symbol, top]? + + def media=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader media_id: String? + + def media_id=: (String) -> String + + attr_reader media_url: String? + + def media_url=: (String) -> String + attr_reader message: String? def message=: (String) -> String @@ -64,113 +155,396 @@ module XTwitterScraper def message_id=: (String) -> String + attr_reader request_hash: String? + + def request_hash=: (String) -> String + + attr_reader request_id: String? + + def request_id=: (String) -> String + + attr_reader result_id: String? + + def result_id=: (String) -> String + attr_reader send_dispatched_at: Time? def send_dispatched_at=: (Time) -> Time - attr_accessor target_id: String? - attr_reader tweet_id: String? def tweet_id=: (String) -> String + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + def initialize: ( - action: String, + id: String, + account: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account?, + action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::action, + billing: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, charged: bool, charged_credits: String, - created_at: Time, - media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, + next_action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction?, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + result: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result?, + retryable: bool, + safe_to_retry: bool, send_dispatched: bool, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target?, + target_id: String?, + terminal: bool, write_action_id: String, + ?community_id: String, + ?community_name: String, + ?completed_at: Time, ?confirmation_attempts: Integer, ?confirmation_checked_at: Time, - ?confirmation_source: String?, ?confirmed_at: Time, + ?created_at: Time, + ?details: ::Hash[Symbol, top], + ?error: String, + ?expires_at: Time, + ?idempotent: bool, + ?media: ::Hash[Symbol, top], + ?media_id: String, + ?media_url: String, ?message: String, ?message_id: String, + ?request_hash: String, + ?request_id: String, + ?result_id: String, ?send_dispatched_at: Time, - ?target_id: String?, ?tweet_id: String, - ?retryable: false + ?updated_at: Time, + ?object: :x_write_action ) -> void def to_hash: -> { - action: String, + id: String, + account: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account?, + action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::action, + billing: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, charged: bool, charged_credits: String, - created_at: Time, - media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, - retryable: false, + next_action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction?, + object: :x_write_action, + poll_after_ms: Integer?, + request: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + result: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result?, + retryable: bool, + safe_to_retry: bool, send_dispatched: bool, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::status, + status_url: String, + success: bool, + target: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target?, + target_id: String?, + terminal: bool, write_action_id: String, + community_id: String, + community_name: String, + completed_at: Time, confirmation_attempts: Integer, confirmation_checked_at: Time, - confirmation_source: String?, confirmed_at: Time, + created_at: Time, + details: ::Hash[Symbol, top], + error: String, + expires_at: Time, + idempotent: bool, + media: ::Hash[Symbol, top], + media_id: String, + media_url: String, message: String, message_id: String, + request_hash: String, + request_id: String, + result_id: String, send_dispatched_at: Time, - target_id: String?, - tweet_id: String + tweet_id: String, + updated_at: Time } - type media = + type account = { id: String, username: String } + + class Account < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor username: String + + def initialize: (id: String, username: String) -> void + + def to_hash: -> { id: String, username: String } + end + + type action = + :create_tweet + | :delete_tweet + | :like + | :unlike + | :retweet + | :unretweet + | :follow + | :unfollow + | :remove_follower + | :send_dm + | :upload_media + | :update_profile + | :update_avatar + | :update_banner + | :create_community + | :delete_community + | :join_community + | :leave_community + + module Action + extend XTwitterScraper::Internal::Type::Enum + + CREATE_TWEET: :create_tweet + DELETE_TWEET: :delete_tweet + LIKE: :like + UNLIKE: :unlike + RETWEET: :retweet + UNRETWEET: :unretweet + FOLLOW: :follow + UNFOLLOW: :unfollow + REMOVE_FOLLOWER: :remove_follower + SEND_DM: :send_dm + UPLOAD_MEDIA: :upload_media + UPDATE_PROFILE: :update_profile + UPDATE_AVATAR: :update_avatar + UPDATE_BANNER: :update_banner + CREATE_COMMUNITY: :create_community + DELETE_COMMUNITY: :delete_community + JOIN_COMMUNITY: :join_community + LEAVE_COMMUNITY: :leave_community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::action] + end + + type billing = { - count: Integer, - credits: String, - kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, - total_bytes: String + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::status } - class Media < XTwitterScraper::Internal::Type::BaseModel - attr_accessor count: Integer + class Billing < XTwitterScraper::Internal::Type::BaseModel + attr_accessor charged: bool - attr_accessor credits: String + attr_accessor charged_credits: String - attr_accessor kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind + attr_accessor planned_credits: String - attr_accessor total_bytes: String + attr_accessor status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::status def initialize: ( - count: Integer, - credits: String, - kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, - total_bytes: String + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::status ) -> void def to_hash: -> { - count: Integer, - credits: String, - kind: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind, - total_bytes: String + charged: bool, + charged_credits: String, + planned_credits: String, + status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::status } - type kind = :none | :image | :video + type status = + :not_charged | :pending | :charged | :charge_failed | :refunded - module Kind + module Status extend XTwitterScraper::Internal::Type::Enum - NONE: :none - IMAGE: :image - VIDEO: :video + NOT_CHARGED: :not_charged + PENDING: :pending + CHARGED: :charged + CHARGE_FAILED: :charge_failed + REFUNDED: :refunded - def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media::kind] + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing::status] end end - type status = :success | :failed | :pending_confirmation + type next_action = + { + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + class NextAction < XTwitterScraper::Internal::Type::BaseModel + attr_accessor type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::type_ + + attr_reader after_ms: Integer? + + def after_ms=: (Integer) -> Integer + + attr_reader requires_new_idempotency_key: bool? + + def requires_new_idempotency_key=: (bool) -> bool + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::type_, + ?after_ms: Integer, + ?requires_new_idempotency_key: bool, + ?url: String + ) -> void + + def to_hash: -> { + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::type_, + after_ms: Integer, + requires_new_idempotency_key: bool, + url: String + } + + type type_ = :poll | :retry | :verify_result | :fix_request + + module Type + extend XTwitterScraper::Internal::Type::Enum + + POLL: :poll + RETRY: :retry + VERIFY_RESULT: :verify_result + FIX_REQUEST: :fix_request + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction::type_] + end + end + + type request = { hash_: String?, payload: ::Hash[Symbol, top]? } + + class Request < XTwitterScraper::Internal::Type::BaseModel + attr_accessor hash_: String? + + attr_accessor payload: ::Hash[Symbol, top]? + + def initialize: ( + hash_: String?, + payload: ::Hash[Symbol, top]? + ) -> void + + def to_hash: -> { hash_: String?, payload: ::Hash[Symbol, top]? } + end + + type result = + { + id: String, + state: String, + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_ + } + + class Result < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + attr_reader type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_? + + def type=: ( + XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_ + ) -> XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_ + + def initialize: ( + ?id: String, + ?state: String, + ?type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_ + ) -> void + + def to_hash: -> { + id: String, + state: String, + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_ + } + + type type_ = + :tweet | :direct_message | :media | :community | :state_change + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + DIRECT_MESSAGE: :direct_message + MEDIA: :media + COMMUNITY: :community + STATE_CHANGE: :state_change + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result::type_] + end + end + + type status = + :accepted + | :dispatching + | :pending_confirmation + | :success + | :failed + | :expired module Status extend XTwitterScraper::Internal::Type::Enum + ACCEPTED: :accepted + DISPATCHING: :dispatching + PENDING_CONFIRMATION: :pending_confirmation SUCCESS: :success FAILED: :failed - PENDING_CONFIRMATION: :pending_confirmation + EXPIRED: :expired def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::status] end + + type target = + { + id: String, + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::type_ + } + + class Target < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::type_ + + def initialize: ( + id: String, + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::type_ + ) -> void + + def to_hash: -> { + id: String, + type: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::type_ + } + + type type_ = :tweet | :user | :community + + module Type + extend XTwitterScraper::Internal::Type::Enum + + TWEET: :tweet + USER: :user + COMMUNITY: :community + + def self?.values: -> ::Array[XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target::type_] + end + end end end end diff --git a/sig/x_twitter_scraper/resources/support/tickets.rbs b/sig/x_twitter_scraper/resources/support/tickets.rbs index 3427cd0..a2f604a 100644 --- a/sig/x_twitter_scraper/resources/support/tickets.rbs +++ b/sig/x_twitter_scraper/resources/support/tickets.rbs @@ -5,6 +5,7 @@ module XTwitterScraper def create: ( body: String, subject: String, + ?idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::Support::TicketCreateResponse @@ -26,6 +27,7 @@ module XTwitterScraper def reply: ( String id, body: String, + ?idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::Support::TicketReplyResponse diff --git a/sig/x_twitter_scraper/resources/x/communities.rbs b/sig/x_twitter_scraper/resources/x/communities.rbs index f3ac38c..f57e035 100644 --- a/sig/x_twitter_scraper/resources/x/communities.rbs +++ b/sig/x_twitter_scraper/resources/x/communities.rbs @@ -9,6 +9,7 @@ module XTwitterScraper def create: ( account: String, name: String, + idempotency_key: String, ?description: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::CommunityCreateResponse @@ -17,6 +18,7 @@ module XTwitterScraper String id, account: String, community_name: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::CommunityDeleteResponse diff --git a/sig/x_twitter_scraper/resources/x/communities/join.rbs b/sig/x_twitter_scraper/resources/x/communities/join.rbs index 924aea3..fbac9f3 100644 --- a/sig/x_twitter_scraper/resources/x/communities/join.rbs +++ b/sig/x_twitter_scraper/resources/x/communities/join.rbs @@ -6,12 +6,14 @@ module XTwitterScraper def create: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Communities::JoinCreateResponse def delete_all: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse diff --git a/sig/x_twitter_scraper/resources/x/dm.rbs b/sig/x_twitter_scraper/resources/x/dm.rbs index 1c4016c..f4958df 100644 --- a/sig/x_twitter_scraper/resources/x/dm.rbs +++ b/sig/x_twitter_scraper/resources/x/dm.rbs @@ -14,6 +14,7 @@ module XTwitterScraper String user_id, account: String, text: String, + idempotency_key: String, ?media_ids: ::Array[String], ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::DmSendResponse diff --git a/sig/x_twitter_scraper/resources/x/media.rbs b/sig/x_twitter_scraper/resources/x/media.rbs index 70b42e5..6cf70c5 100644 --- a/sig/x_twitter_scraper/resources/x/media.rbs +++ b/sig/x_twitter_scraper/resources/x/media.rbs @@ -13,6 +13,7 @@ module XTwitterScraper def upload: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::MediaUploadResponse diff --git a/sig/x_twitter_scraper/resources/x/profile.rbs b/sig/x_twitter_scraper/resources/x/profile.rbs index 68fb792..895c8bd 100644 --- a/sig/x_twitter_scraper/resources/x/profile.rbs +++ b/sig/x_twitter_scraper/resources/x/profile.rbs @@ -4,6 +4,7 @@ module XTwitterScraper class Profile def update: ( account: String, + idempotency_key: String, ?description: String, ?location: String, ?name: String, @@ -14,12 +15,14 @@ module XTwitterScraper def update_avatar: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::ProfileUpdateAvatarResponse def update_banner: ( account: String, url: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::ProfileUpdateBannerResponse diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index 977a8af..a5813ff 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -8,7 +8,7 @@ module XTwitterScraper def create: ( account: String, - ?attachment_url: String, + idempotency_key: String, ?community_id: String, ?is_note_tweet: bool, ?media: ::Array[String], @@ -30,6 +30,7 @@ module XTwitterScraper def delete: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::TweetDeleteResponse diff --git a/sig/x_twitter_scraper/resources/x/tweets/like.rbs b/sig/x_twitter_scraper/resources/x/tweets/like.rbs index 386eba2..9625115 100644 --- a/sig/x_twitter_scraper/resources/x/tweets/like.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets/like.rbs @@ -6,12 +6,14 @@ module XTwitterScraper def create: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::LikeCreateResponse def delete: ( String id, account: String, + idempotency_key: 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 a6023e2..51f71d3 100644 --- a/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs @@ -6,12 +6,14 @@ module XTwitterScraper def create: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Tweets::RetweetCreateResponse def delete: ( String id, account: String, + idempotency_key: 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 82b9236..c9257bb 100644 --- a/sig/x_twitter_scraper/resources/x/users.rbs +++ b/sig/x_twitter_scraper/resources/x/users.rbs @@ -12,6 +12,7 @@ module XTwitterScraper def remove_follower: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::UserRemoveFollowerResponse diff --git a/sig/x_twitter_scraper/resources/x/users/follow.rbs b/sig/x_twitter_scraper/resources/x/users/follow.rbs index 02b26cf..fb76330 100644 --- a/sig/x_twitter_scraper/resources/x/users/follow.rbs +++ b/sig/x_twitter_scraper/resources/x/users/follow.rbs @@ -6,12 +6,14 @@ module XTwitterScraper def create: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Users::FollowCreateResponse def delete_all: ( String id, account: String, + idempotency_key: String, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::Models::X::Users::FollowDeleteAllResponse diff --git a/test/x_twitter_scraper/resources/support/tickets_test.rb b/test/x_twitter_scraper/resources/support/tickets_test.rb index ea55519..779e3de 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -18,6 +18,7 @@ def test_create_required_params assert_pattern do response => { + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]) | nil, public_id: String | nil } end @@ -92,6 +93,7 @@ def test_reply_required_params assert_pattern do response => { + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]) | nil, public_id: String | nil } 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 9eebf06..1910a13 100644 --- a/test/x_twitter_scraper/resources/x/communities/join_test.rb +++ b/test/x_twitter_scraper/resources/x/communities/join_test.rb @@ -6,7 +6,12 @@ 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: "@elonmusk") + response = + @x_twitter_scraper.x.communities.join.create( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::Communities::JoinCreateResponse @@ -14,7 +19,49 @@ def test_create_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Action, + billing: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Communities::JoinCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -22,7 +69,12 @@ 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: "@elonmusk") + response = + @x_twitter_scraper.x.communities.join.delete_all( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse @@ -30,7 +82,49 @@ def test_delete_all_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Account | nil, + action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Action, + billing: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } 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 9723f0d..3c36374 100644 --- a/test/x_twitter_scraper/resources/x/communities_test.rb +++ b/test/x_twitter_scraper/resources/x/communities_test.rb @@ -6,7 +6,12 @@ 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: "@elonmusk", name: "Example Name") + response = + @x_twitter_scraper.x.communities.create( + account: "@elonmusk", + name: "Example Name", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::CommunityCreateResponse @@ -14,9 +19,49 @@ def test_create_required_params assert_pattern do response => { - community_id: String, - success: true | false, - community_name: String | nil + id: String, + account: XTwitterScraper::Models::X::CommunityCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::CommunityCreateResponse::Action, + billing: XTwitterScraper::Models::X::CommunityCreateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::CommunityCreateResponse::Request, + result: XTwitterScraper::Models::X::CommunityCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::CommunityCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::CommunityCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -25,7 +70,12 @@ def test_delete_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.communities.delete("id", account: "@elonmusk", community_name: "Tesla Fans") + @x_twitter_scraper.x.communities.delete( + "id", + account: "@elonmusk", + community_name: "Tesla Fans", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::CommunityDeleteResponse @@ -33,7 +83,49 @@ def test_delete_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::CommunityDeleteResponse::Account | nil, + action: XTwitterScraper::Models::X::CommunityDeleteResponse::Action, + billing: XTwitterScraper::Models::X::CommunityDeleteResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::CommunityDeleteResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::CommunityDeleteResponse::Request, + result: XTwitterScraper::Models::X::CommunityDeleteResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::CommunityDeleteResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::CommunityDeleteResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } 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 c78625d..16db71b 100644 --- a/test/x_twitter_scraper/resources/x/dm_test.rb +++ b/test/x_twitter_scraper/resources/x/dm_test.rb @@ -24,7 +24,13 @@ def test_retrieve_history_required_params def test_send__required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.dm.send_("userId", account: "@elonmusk", text: "Example text content") + response = + @x_twitter_scraper.x.dm.send_( + "userId", + account: "@elonmusk", + text: "Example text content", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::DmSendResponse @@ -32,8 +38,49 @@ def test_send__required_params assert_pattern do response => { - message_id: String, - success: true | false + id: String, + account: XTwitterScraper::Models::X::DmSendResponse::Account | nil, + action: XTwitterScraper::Models::X::DmSendResponse::Action, + billing: XTwitterScraper::Models::X::DmSendResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::DmSendResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::DmSendResponse::Request, + result: XTwitterScraper::Models::X::DmSendResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::DmSendResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::DmSendResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } 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 2a75101..8eac842 100644 --- a/test/x_twitter_scraper/resources/x/media_test.rb +++ b/test/x_twitter_scraper/resources/x/media_test.rb @@ -26,7 +26,12 @@ def test_download def test_upload_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.media.upload(account: "@elonmusk", url: "https://example.com/image.png") + response = + @x_twitter_scraper.x.media.upload( + account: "@elonmusk", + url: "https://example.com/image.png", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::MediaUploadResponse @@ -34,9 +39,49 @@ def test_upload_required_params assert_pattern do response => { - media_id: String, - media_url: String, - success: true | false + id: String, + account: XTwitterScraper::Models::X::MediaUploadResponse::Account | nil, + action: XTwitterScraper::Models::X::MediaUploadResponse::Action, + billing: XTwitterScraper::Models::X::MediaUploadResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::MediaUploadResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::MediaUploadResponse::Request, + result: XTwitterScraper::Models::X::MediaUploadResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::MediaUploadResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::MediaUploadResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end diff --git a/test/x_twitter_scraper/resources/x/profile_test.rb b/test/x_twitter_scraper/resources/x/profile_test.rb index be678c9..a28cec3 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: "@elonmusk") + response = @x_twitter_scraper.x.profile.update(account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateResponse @@ -14,7 +14,49 @@ def test_update_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateResponse::Account | nil, + action: XTwitterScraper::Models::X::ProfileUpdateResponse::Action, + billing: XTwitterScraper::Models::X::ProfileUpdateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::ProfileUpdateResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::ProfileUpdateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::ProfileUpdateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -23,7 +65,11 @@ def test_update_avatar_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.profile.update_avatar(account: "@elonmusk", url: "https://example.com/avatar.png") + @x_twitter_scraper.x.profile.update_avatar( + account: "@elonmusk", + url: "https://example.com/avatar.png", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateAvatarResponse @@ -31,7 +77,49 @@ def test_update_avatar_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Account | nil, + action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Action, + billing: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -40,7 +128,11 @@ def test_update_banner_required_params skip("Mock server tests are disabled") response = - @x_twitter_scraper.x.profile.update_banner(account: "@elonmusk", url: "https://example.com/banner.png") + @x_twitter_scraper.x.profile.update_banner( + account: "@elonmusk", + url: "https://example.com/banner.png", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::ProfileUpdateBannerResponse @@ -48,7 +140,49 @@ def test_update_banner_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Account | nil, + action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Action, + billing: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Request, + result: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::ProfileUpdateBannerResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end 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 4a72bb0..fe04830 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,8 @@ 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("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.tweets.like.create("id", account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::Tweets::LikeCreateResponse @@ -14,7 +15,49 @@ def test_create_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Action, + billing: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Tweets::LikeCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -22,7 +65,8 @@ def test_create_required_params def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.like.delete("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.tweets.like.delete("id", account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::Tweets::LikeDeleteResponse @@ -30,7 +74,49 @@ def test_delete_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Account | nil, + action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Action, + billing: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Tweets::LikeDeleteResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end 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 a88e098..3e2b280 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,12 @@ 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("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.tweets.retweet.create( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::Tweets::RetweetCreateResponse @@ -14,7 +19,49 @@ def test_create_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Action, + billing: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -22,7 +69,12 @@ def test_create_required_params def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.retweet.delete("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.tweets.retweet.delete( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse @@ -30,7 +82,49 @@ def test_delete_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Account | nil, + action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Action, + billing: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end diff --git a/test/x_twitter_scraper/resources/x/tweets_test.rb b/test/x_twitter_scraper/resources/x/tweets_test.rb index f466343..c8863c4 100644 --- a/test/x_twitter_scraper/resources/x/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets_test.rb @@ -6,7 +6,7 @@ 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: "@elonmusk") + response = @x_twitter_scraper.x.tweets.create(account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::TweetCreateResponse @@ -14,11 +14,49 @@ def test_create_required_params assert_pattern do response => { + id: String, + account: XTwitterScraper::Models::X::TweetCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::TweetCreateResponse::Action, + billing: XTwitterScraper::Models::X::TweetCreateResponse::Billing, charged: XTwitterScraper::Internal::Type::Boolean, charged_credits: String, - success: true | false, - tweet_id: String, - write_action_id: String | nil + next_action: XTwitterScraper::Models::X::TweetCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::TweetCreateResponse::Request, + result: XTwitterScraper::Models::X::TweetCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::TweetCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::TweetCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -61,7 +99,8 @@ def test_list_required_params def test_delete_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.tweets.delete("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.tweets.delete("id", account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::TweetDeleteResponse @@ -69,7 +108,49 @@ def test_delete_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::TweetDeleteResponse::Account | nil, + action: XTwitterScraper::Models::X::TweetDeleteResponse::Action, + billing: XTwitterScraper::Models::X::TweetDeleteResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::TweetDeleteResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::TweetDeleteResponse::Request, + result: XTwitterScraper::Models::X::TweetDeleteResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::TweetDeleteResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::TweetDeleteResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } 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 455457d..d57a82a 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,8 @@ 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("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.users.follow.create("id", account: "@elonmusk", idempotency_key: "Idempotency-Key") assert_pattern do response => XTwitterScraper::Models::X::Users::FollowCreateResponse @@ -14,7 +15,49 @@ def test_create_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Users::FollowCreateResponse::Account | nil, + action: XTwitterScraper::Models::X::Users::FollowCreateResponse::Action, + billing: XTwitterScraper::Models::X::Users::FollowCreateResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowCreateResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Users::FollowCreateResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowCreateResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Users::FollowCreateResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Users::FollowCreateResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end @@ -22,7 +65,12 @@ 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("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.users.follow.delete_all( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::Users::FollowDeleteAllResponse @@ -30,7 +78,49 @@ def test_delete_all_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Account | nil, + action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Action, + billing: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Request, + result: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::Users::FollowDeleteAllResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end diff --git a/test/x_twitter_scraper/resources/x/users_test.rb b/test/x_twitter_scraper/resources/x/users_test.rb index b5e7305..baaf516 100644 --- a/test/x_twitter_scraper/resources/x/users_test.rb +++ b/test/x_twitter_scraper/resources/x/users_test.rb @@ -55,7 +55,12 @@ def test_retrieve def test_remove_follower_required_params skip("Mock server tests are disabled") - response = @x_twitter_scraper.x.users.remove_follower("id", account: "@elonmusk") + response = + @x_twitter_scraper.x.users.remove_follower( + "id", + account: "@elonmusk", + idempotency_key: "Idempotency-Key" + ) assert_pattern do response => XTwitterScraper::Models::X::UserRemoveFollowerResponse @@ -63,7 +68,49 @@ def test_remove_follower_required_params assert_pattern do response => { - success: true | false + id: String, + account: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Account | nil, + action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Action, + billing: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Billing, + charged: XTwitterScraper::Internal::Type::Boolean, + charged_credits: String, + next_action: XTwitterScraper::Models::X::UserRemoveFollowerResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Request, + result: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, + send_dispatched: XTwitterScraper::Internal::Type::Boolean, + status: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::UserRemoveFollowerResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, + write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, + confirmation_attempts: Integer | nil, + confirmation_checked_at: Time | nil, + confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, + message: String | nil, + message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, + send_dispatched_at: Time | nil, + tweet_id: String | nil, + updated_at: Time | nil } end end diff --git a/test/x_twitter_scraper/resources/x/write_actions_test.rb b/test/x_twitter_scraper/resources/x/write_actions_test.rb index 6f52b74..b118bc9 100644 --- a/test/x_twitter_scraper/resources/x/write_actions_test.rb +++ b/test/x_twitter_scraper/resources/x/write_actions_test.rb @@ -14,24 +14,49 @@ def test_retrieve assert_pattern do response => { - action: String, + id: String, + account: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Account | nil, + action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Action, + billing: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Billing, charged: XTwitterScraper::Internal::Type::Boolean, charged_credits: String, - created_at: Time, - media: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Media, - retryable: true | false, + next_action: XTwitterScraper::Models::X::WriteActionRetrieveResponse::NextAction | nil, + object: Symbol, + poll_after_ms: Integer | nil, + request: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Request, + result: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Result | nil, + retryable: XTwitterScraper::Internal::Type::Boolean, + safe_to_retry: XTwitterScraper::Internal::Type::Boolean, send_dispatched: XTwitterScraper::Internal::Type::Boolean, status: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Status, + status_url: String, + success: XTwitterScraper::Internal::Type::Boolean, + target: XTwitterScraper::Models::X::WriteActionRetrieveResponse::Target | nil, + target_id: String | nil, + terminal: XTwitterScraper::Internal::Type::Boolean, write_action_id: String, + community_id: String | nil, + community_name: String | nil, + completed_at: Time | nil, confirmation_attempts: Integer | nil, confirmation_checked_at: Time | nil, - confirmation_source: String | nil, confirmed_at: Time | nil, + created_at: Time | nil, + details: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + error: String | nil, + expires_at: Time | nil, + idempotent: XTwitterScraper::Internal::Type::Boolean | nil, + media: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, + media_id: String | nil, + media_url: String | nil, message: String | nil, message_id: String | nil, + request_hash: String | nil, + request_id: String | nil, + result_id: String | nil, send_dispatched_at: Time | nil, - target_id: String | nil, - tweet_id: String | nil + tweet_id: String | nil, + updated_at: Time | nil } end end From 1ba23fdb4bed22616f690a0a75b8ef01165acfb3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:46:02 +0000 Subject: [PATCH 10/12] sync public SDK contract --- .stats.yml | 4 +- .../credit_retrieve_topup_status_params.rb | 4 +- lib/x_twitter_scraper/models/error.rb | 70 +++- .../models/extraction_estimate_cost_params.rb | 16 +- .../models/guest_wallet_create_params.rb | 4 +- .../models/guest_wallet_topup_params.rb | 4 +- lib/x_twitter_scraper/models/search_tweet.rb | 24 +- .../models/support/ticket_create_response.rb | 12 +- .../models/support/ticket_reply_response.rb | 12 +- .../support/ticket_retrieve_response.rb | 23 +- .../x/user_retrieve_following_params.rb | 4 +- .../models/x/user_retrieve_replies_params.rb | 4 +- lib/x_twitter_scraper/resources/credits.rb | 2 +- .../resources/extractions.rb | 8 +- .../resources/guest_wallets.rb | 4 +- lib/x_twitter_scraper/resources/x/users.rb | 8 +- .../credit_retrieve_topup_status_params.rbi | 4 +- rbi/x_twitter_scraper/models/error.rbi | 334 +++++++++++++++++- .../extraction_estimate_cost_params.rbi | 16 +- .../models/guest_wallet_create_params.rbi | 4 +- .../models/guest_wallet_topup_params.rbi | 4 +- rbi/x_twitter_scraper/models/search_tweet.rbi | 24 +- .../models/support/ticket_create_response.rbi | 30 +- .../models/support/ticket_reply_response.rbi | 30 +- .../support/ticket_retrieve_response.rbi | 10 + .../x/user_retrieve_following_params.rbi | 4 +- .../models/x/user_retrieve_replies_params.rbi | 4 +- rbi/x_twitter_scraper/resources/credits.rbi | 2 +- .../resources/extractions.rbi | 8 +- .../resources/guest_wallets.rbi | 4 +- rbi/x_twitter_scraper/resources/x/users.rbi | 8 +- sig/x_twitter_scraper/models/error.rbs | 132 +++++++ .../models/support/ticket_create_response.rbs | 14 +- .../models/support/ticket_reply_response.rbs | 14 +- .../resources/support/tickets_test.rb | 8 +- 35 files changed, 688 insertions(+), 169 deletions(-) diff --git a/.stats.yml b/.stats.yml index d174a6f..9953b89 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-1a468d8933b6612e40e8b8ebdf84f9e3f014799d0e9a05789b93a242324cd158.yml -openapi_spec_hash: 25b9bc2b3b13c649eccc0a8624c233d3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-6390fae0cb8c75f6da61d4aabc5cf067cdcc1dd4ff5631e84e7e4067cb551b0c.yml +openapi_spec_hash: c4bbf09f0a8a87fdd49cbea797a3e3af config_hash: 4b64fbd16fd09008417c5a460d27f053 diff --git a/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb index 455db92..d7934d0 100644 --- a/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb +++ b/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb @@ -8,13 +8,13 @@ class CreditRetrieveTopupStatusParams < XTwitterScraper::Internal::Type::BaseMod include XTwitterScraper::Internal::Type::RequestParameters # @!attribute session_id - # Billing session ID returned by the top-up billing flow. + # Top-up session ID to inspect. # # @return [String] required :session_id, String # @!method initialize(session_id:, request_options: {}) - # @param session_id [String] Billing session ID returned by the top-up billing flow. + # @param session_id [String] Top-up session ID to inspect. # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index 0061c01..d9b8783 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -21,7 +21,7 @@ class Error < XTwitterScraper::Internal::Type::BaseModel optional :reason, String # @!attribute retry_after - # Required wait in seconds. + # Seconds until the next permitted request. # # @return [Integer, nil] optional :retry_after, Integer, api_name: :retryAfter @@ -43,7 +43,7 @@ class Error < XTwitterScraper::Internal::Type::BaseModel # # @param reason [String] Machine-readable reason for a login cooldown. # - # @param retry_after [Integer] Required wait in seconds. + # @param retry_after [Integer] Seconds until the next permitted request. # # @param retry_after_ms [Integer] Required wait in milliseconds. @@ -98,6 +98,39 @@ module LegacyErrorCode UNAUTHENTICATED = :unauthenticated UNSUPPORTED_FIELD = :unsupported_field USER_NOT_FOUND = :user_not_found + BODY_TOO_LARGE = :body_too_large + CHECKOUT_UNAVAILABLE = :checkout_unavailable + CONNECTION_CHALLENGE_EXPIRED = :connection_challenge_expired + CONNECTION_CHALLENGE_INACTIVE = :connection_challenge_inactive + DRAFT_NOT_FOUND = :draft_not_found + FAVORITERS_UNAVAILABLE = :favoriters_unavailable + FORBIDDEN = :forbidden + GUEST_WALLET_UNAVAILABLE = :guest_wallet_unavailable + GUEST_WALLETS_DISABLED = :guest_wallets_disabled + GUEST_WALLETS_UNAVAILABLE = :guest_wallets_unavailable + IDEMPOTENCY_CONFLICT = :idempotency_conflict + IDEMPOTENCY_KEY_CONFLICT = :idempotency_key_conflict + INVALID_COMMUNITY_ID = :invalid_community_id + INVALID_IDEMPOTENCY_KEY = :invalid_idempotency_key + INVALID_LIST_ID = :invalid_list_id + INVALID_PAYMENT_AMOUNT = :invalid_payment_amount + INVALID_RANGE = :invalid_range + LOGIN_RATE_LIMITED = :login_rate_limited + MISSING_IDEMPOTENCY_KEY = :missing_idempotency_key + MISSING_IDS = :missing_ids + NO_CACHED_STYLE = :no_cached_style + PASSKEY_REQUIRED = :passkey_required + RATE_LIMITED = :rate_limited + READ_REQUEST_TIMEOUT = :read_request_timeout + REPLIES_INCOMPLETE = :replies_incomplete + SUPPORT_MEDIA_RATE_LIMIT = :support_media_rate_limit + SUPPORT_REQUEST_RATE_LIMIT = :support_request_rate_limit + TOO_MANY_IDS = :too_many_ids + UNKNOWN_FIELD = :unknown_field + UNSUPPORTED_MEDIA_TYPE = :unsupported_media_type + WEBHOOK_INACTIVE = :webhook_inactive + WRITE_TRACKING_UNAVAILABLE = :write_tracking_unavailable + X_WRITE_UNCONFIRMED = :x_write_unconfirmed X_ACCOUNT_FEATURE_REQUIRED = :x_account_feature_required X_ACCOUNT_PROTECTED = :x_account_protected X_ACCOUNT_SUSPENDED = :x_account_suspended @@ -194,6 +227,39 @@ module Code UNAUTHENTICATED = :unauthenticated UNSUPPORTED_FIELD = :unsupported_field USER_NOT_FOUND = :user_not_found + BODY_TOO_LARGE = :body_too_large + CHECKOUT_UNAVAILABLE = :checkout_unavailable + CONNECTION_CHALLENGE_EXPIRED = :connection_challenge_expired + CONNECTION_CHALLENGE_INACTIVE = :connection_challenge_inactive + DRAFT_NOT_FOUND = :draft_not_found + FAVORITERS_UNAVAILABLE = :favoriters_unavailable + FORBIDDEN = :forbidden + GUEST_WALLET_UNAVAILABLE = :guest_wallet_unavailable + GUEST_WALLETS_DISABLED = :guest_wallets_disabled + GUEST_WALLETS_UNAVAILABLE = :guest_wallets_unavailable + IDEMPOTENCY_CONFLICT = :idempotency_conflict + IDEMPOTENCY_KEY_CONFLICT = :idempotency_key_conflict + INVALID_COMMUNITY_ID = :invalid_community_id + INVALID_IDEMPOTENCY_KEY = :invalid_idempotency_key + INVALID_LIST_ID = :invalid_list_id + INVALID_PAYMENT_AMOUNT = :invalid_payment_amount + INVALID_RANGE = :invalid_range + LOGIN_RATE_LIMITED = :login_rate_limited + MISSING_IDEMPOTENCY_KEY = :missing_idempotency_key + MISSING_IDS = :missing_ids + NO_CACHED_STYLE = :no_cached_style + PASSKEY_REQUIRED = :passkey_required + RATE_LIMITED = :rate_limited + READ_REQUEST_TIMEOUT = :read_request_timeout + REPLIES_INCOMPLETE = :replies_incomplete + SUPPORT_MEDIA_RATE_LIMIT = :support_media_rate_limit + SUPPORT_REQUEST_RATE_LIMIT = :support_request_rate_limit + TOO_MANY_IDS = :too_many_ids + UNKNOWN_FIELD = :unknown_field + UNSUPPORTED_MEDIA_TYPE = :unsupported_media_type + WEBHOOK_INACTIVE = :webhook_inactive + WRITE_TRACKING_UNAVAILABLE = :write_tracking_unavailable + X_WRITE_UNCONFIRMED = :x_write_unconfirmed X_ACCOUNT_FEATURE_REQUIRED = :x_account_feature_required X_ACCOUNT_PROTECTED = :x_account_protected X_ACCOUNT_SUSPENDED = :x_account_suspended 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 6f142fc..2a53843 100644 --- a/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +++ b/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb @@ -185,7 +185,7 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel optional :retweets_of_tweet_id, String, api_name: :retweetsOfTweetId # @!attribute search_query - # Required for tweet_search_extractor & community_search. + # Query used to price tweet_search_extractor or community_search. # # @return [String, nil] optional :search_query, String, api_name: :searchQuery @@ -197,20 +197,20 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel optional :since_date, Date, api_name: :sinceDate # @!attribute target_community_id - # Required for community_post_extractor & community_search. + # Community ID used to price community_post_extractor or community_search. # # @return [String, nil] optional :target_community_id, String, api_name: :targetCommunityId # @!attribute target_list_id - # Required for list_follower_explorer, list_member_extractor & + # List ID used to price list_follower_explorer, list_member_extractor, or # list_post_extractor. # # @return [String, nil] optional :target_list_id, String, api_name: :targetListId # @!attribute target_space_id - # Required for space_explorer. + # Space ID used to price space_explorer. # # @return [String, nil] optional :target_space_id, String, api_name: :targetSpaceId @@ -309,15 +309,15 @@ class ExtractionEstimateCostParams < XTwitterScraper::Internal::Type::BaseModel # # @param retweets_of_tweet_id [String] Estimate only retweets of this tweet ID (tweet_search_extractor) # - # @param search_query [String] Required for tweet_search_extractor & community_search. + # @param search_query [String] Query used to price tweet_search_extractor or community_search. # # @param since_date [Date] Estimate start date in YYYY-MM-DD format (tweet_search_extractor) # - # @param target_community_id [String] Required for community_post_extractor & community_search. + # @param target_community_id [String] Community ID used to price community_post_extractor or community_search. # - # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # @param target_list_id [String] List ID used to price list_follower_explorer, list_member_extractor, or list_pos # - # @param target_space_id [String] Required for space_explorer. + # @param target_space_id [String] Space ID used to price space_explorer. # # @param target_tweet_id [String] # diff --git a/lib/x_twitter_scraper/models/guest_wallet_create_params.rb b/lib/x_twitter_scraper/models/guest_wallet_create_params.rb index d32fab8..56582b3 100644 --- a/lib/x_twitter_scraper/models/guest_wallet_create_params.rb +++ b/lib/x_twitter_scraper/models/guest_wallet_create_params.rb @@ -8,7 +8,7 @@ class GuestWalletCreateParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute amount_minor - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. # # @return [Integer] required :amount_minor, Integer @@ -24,7 +24,7 @@ class GuestWalletCreateParams < XTwitterScraper::Internal::Type::BaseModel required :idempotency_key, String # @!method initialize(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) - # @param amount_minor [Integer] Confirmed USD amount in cents. + # @param amount_minor [Integer] USD cents accepted for this checkout. # # @param idempotency_key [String] # diff --git a/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb b/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb index 9479302..fb1dc8b 100644 --- a/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb +++ b/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb @@ -8,7 +8,7 @@ class GuestWalletTopupParams < XTwitterScraper::Internal::Type::BaseModel include XTwitterScraper::Internal::Type::RequestParameters # @!attribute amount_minor - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. # # @return [Integer] required :amount_minor, Integer @@ -24,7 +24,7 @@ class GuestWalletTopupParams < XTwitterScraper::Internal::Type::BaseModel required :idempotency_key, String # @!method initialize(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) - # @param amount_minor [Integer] Confirmed USD amount in cents. + # @param amount_minor [Integer] USD cents accepted for this checkout. # # @param idempotency_key [String] # diff --git a/lib/x_twitter_scraper/models/search_tweet.rb b/lib/x_twitter_scraper/models/search_tweet.rb index 88b9a7c..962f02b 100644 --- a/lib/x_twitter_scraper/models/search_tweet.rb +++ b/lib/x_twitter_scraper/models/search_tweet.rb @@ -68,7 +68,7 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel optional :created_at, String, api_name: :createdAt # @!attribute display_text_range - # Start and end offsets for rendered tweet text + # Rendered text's start and end offsets. # # @return [Array, nil] optional :display_text_range, @@ -83,19 +83,19 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] # @!attribute in_reply_to_id - # Tweet ID being replied to + # ID of the tweet this result replies to. # # @return [String, nil] optional :in_reply_to_id, String, api_name: :inReplyToId # @!attribute in_reply_to_user_id - # User ID being replied to + # ID of the user this result replies to. # # @return [String, nil] optional :in_reply_to_user_id, String, api_name: :inReplyToUserId # @!attribute in_reply_to_username - # Username being replied to + # Username this result replies to. # # @return [String, nil] optional :in_reply_to_username, String, api_name: :inReplyToUsername @@ -125,7 +125,7 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply # @!attribute lang - # Tweet language code + # Search result language code. # # @return [String, nil] optional :lang, String @@ -164,7 +164,7 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel optional :type, String # @!attribute url - # Tweet permalink URL + # Search result permalink. # # @return [String, nil] optional :url, String @@ -200,15 +200,15 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param created_at [String] # - # @param display_text_range [Array] Start and end offsets for rendered tweet text + # @param display_text_range [Array] Rendered text's start and end offsets. # # @param entities [Hash{Symbol=>Object}] Parsed search-result entities including URLs, mentions, hashtags, and media mark # - # @param in_reply_to_id [String] Tweet ID being replied to + # @param in_reply_to_id [String] ID of the tweet this result replies to. # - # @param in_reply_to_user_id [String] User ID being replied to + # @param in_reply_to_user_id [String] ID of the user this result replies to. # - # @param in_reply_to_username [String] Username being replied to + # @param in_reply_to_username [String] Username this result replies to. # # @param is_limited_reply [Boolean] Whether the tweet has limited reply permissions # @@ -218,7 +218,7 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param is_reply [Boolean] True when this search result is a reply # - # @param lang [String] Tweet language code + # @param lang [String] Search result language code. # # @param media [Array] Search-result media attachments, omitted when no media is present # @@ -230,7 +230,7 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param type [String] # - # @param url [String] Tweet permalink URL + # @param url [String] Search result permalink. end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_create_response.rb b/lib/x_twitter_scraper/models/support/ticket_create_response.rb index 2e8bd61..70cef0c 100644 --- a/lib/x_twitter_scraper/models/support/ticket_create_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_create_response.rb @@ -7,16 +7,16 @@ module Support class TicketCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute attachments # - # @return [Array, nil] - optional :attachments, + # @return [Array] + required :attachments, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] } # @!attribute public_id # - # @return [String, nil] - optional :public_id, String, api_name: :publicId + # @return [String] + required :public_id, String, api_name: :publicId - # @!method initialize(attachments: nil, public_id: nil) + # @!method initialize(attachments:, public_id:) # @param attachments [Array] # @param public_id [String] @@ -32,6 +32,8 @@ class Attachment < XTwitterScraper::Internal::Type::BaseModel required :status, enum: -> { XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status } # @!method initialize(public_id:, status:) + # Attachment identifier and initial processing state. + # # @param public_id [String] # @param status [Symbol, XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::Status] diff --git a/lib/x_twitter_scraper/models/support/ticket_reply_response.rb b/lib/x_twitter_scraper/models/support/ticket_reply_response.rb index 2982486..279f4b0 100644 --- a/lib/x_twitter_scraper/models/support/ticket_reply_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_reply_response.rb @@ -7,16 +7,16 @@ module Support class TicketReplyResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute attachments # - # @return [Array, nil] - optional :attachments, + # @return [Array] + required :attachments, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] } # @!attribute public_id # - # @return [String, nil] - optional :public_id, String, api_name: :publicId + # @return [String] + required :public_id, String, api_name: :publicId - # @!method initialize(attachments: nil, public_id: nil) + # @!method initialize(attachments:, public_id:) # @param attachments [Array] # @param public_id [String] @@ -32,6 +32,8 @@ class Attachment < XTwitterScraper::Internal::Type::BaseModel required :status, enum: -> { XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status } # @!method initialize(public_id:, status:) + # Attachment identifier and initial processing state. + # # @param public_id [String] # @param status [Symbol, XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::Status] diff --git a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb index df9db57..144018f 100644 --- a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb @@ -74,6 +74,7 @@ class Message < XTwitterScraper::Internal::Type::BaseModel class Attachment < XTwitterScraper::Internal::Type::BaseModel # @!attribute content_type + # Validated media type. # # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType] required :content_type, @@ -86,6 +87,7 @@ class Attachment < XTwitterScraper::Internal::Type::BaseModel required :filename, String # @!attribute kind + # Attachment media class. # # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind] required :kind, @@ -102,6 +104,7 @@ class Attachment < XTwitterScraper::Internal::Type::BaseModel required :size_bytes, Integer, api_name: :sizeBytes # @!attribute status + # Storage processing state. # # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status] required :status, @@ -113,14 +116,24 @@ class Attachment < XTwitterScraper::Internal::Type::BaseModel required :url, String # @!method initialize(content_type:, filename:, kind:, public_id:, size_bytes:, status:, url:) - # @param content_type [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType] + # Downloadable image or video attached to a support message. + # + # @param content_type [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType] Validated media type. + # # @param filename [String] - # @param kind [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind] + # + # @param kind [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind] Attachment media class. + # # @param public_id [String] + # # @param size_bytes [Integer] - # @param status [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status] + # + # @param status [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status] Storage processing state. + # # @param url [String] + # Validated media type. + # # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#content_type module ContentType extend XTwitterScraper::Internal::Type::Enum @@ -137,6 +150,8 @@ module ContentType # @return [Array] end + # Attachment media class. + # # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#kind module Kind extend XTwitterScraper::Internal::Type::Enum @@ -148,6 +163,8 @@ module Kind # @return [Array] end + # Storage processing state. + # # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment#status module Status extend XTwitterScraper::Internal::Type::Enum 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 a6996e1..98e15a9 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,7 +14,7 @@ class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute after - # Legacy cursor alias. Prefer cursor. + # Deprecated following cursor alias. Prefer cursor. # # @return [String, nil] optional :after, String @@ -46,7 +46,7 @@ class UserRetrieveFollowingParams < XTwitterScraper::Internal::Type::BaseModel # # @param id [String] # - # @param after [String] Legacy cursor alias. Prefer cursor. + # @param after [String] Deprecated following cursor alias. Prefer cursor. # # @param cursor [String] Pagination cursor for following list # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb index 385d438..e9205f3 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb @@ -63,7 +63,7 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel optional :hashtags, String # @!attribute include_parent_tweet - # Include parent tweet for replies + # Include each reply's parent tweet. # # @return [Boolean, nil] optional :include_parent_tweet, XTwitterScraper::Internal::Type::Boolean @@ -208,7 +208,7 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param hashtags [String] Hashtags separated by spaces, commas, or lines. # - # @param include_parent_tweet [Boolean] Include parent tweet for replies + # @param include_parent_tweet [Boolean] Include each reply's parent tweet. # # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. # diff --git a/lib/x_twitter_scraper/resources/credits.rb b/lib/x_twitter_scraper/resources/credits.rb index 6f6e2ce..3f4e8a0 100644 --- a/lib/x_twitter_scraper/resources/credits.rb +++ b/lib/x_twitter_scraper/resources/credits.rb @@ -50,7 +50,7 @@ def retrieve_balance(params = {}) # # @overload retrieve_topup_status(session_id:, request_options: {}) # - # @param session_id [String] Billing session ID returned by the top-up billing flow. + # @param session_id [String] Top-up session ID to inspect. # # @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 ccb54a3..60bcc9a 100644 --- a/lib/x_twitter_scraper/resources/extractions.rb +++ b/lib/x_twitter_scraper/resources/extractions.rb @@ -126,15 +126,15 @@ def list(params = {}) # # @param retweets_of_tweet_id [String] Estimate only retweets of this tweet ID (tweet_search_extractor) # - # @param search_query [String] Required for tweet_search_extractor & community_search. + # @param search_query [String] Query used to price tweet_search_extractor or community_search. # # @param since_date [Date] Estimate start date in YYYY-MM-DD format (tweet_search_extractor) # - # @param target_community_id [String] Required for community_post_extractor & community_search. + # @param target_community_id [String] Community ID used to price community_post_extractor or community_search. # - # @param target_list_id [String] Required for list_follower_explorer, list_member_extractor & list_post_extractor + # @param target_list_id [String] List ID used to price list_follower_explorer, list_member_extractor, or list_pos # - # @param target_space_id [String] Required for space_explorer. + # @param target_space_id [String] Space ID used to price space_explorer. # # @param target_tweet_id [String] # diff --git a/lib/x_twitter_scraper/resources/guest_wallets.rb b/lib/x_twitter_scraper/resources/guest_wallets.rb index 6a226f5..8de4fe9 100644 --- a/lib/x_twitter_scraper/resources/guest_wallets.rb +++ b/lib/x_twitter_scraper/resources/guest_wallets.rb @@ -15,7 +15,7 @@ class GuestWallets # # @overload create(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) # - # @param amount_minor [Integer] Body param: Confirmed USD amount in cents. + # @param amount_minor [Integer] Body param: USD cents accepted for this checkout. # # @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr # @@ -72,7 +72,7 @@ def retrieve_status(params = {}) # # @overload topup(amount_minor:, idempotency_key:, currency: :usd, request_options: {}) # - # @param amount_minor [Integer] Body param: Confirmed USD amount in cents. + # @param amount_minor [Integer] Body param: USD cents accepted for this checkout. # # @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr # diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index 4f31248..166e173 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -92,7 +92,7 @@ def retrieve_batch(params) # # @overload retrieve_followers(id, after: nil, cursor: nil, limit: nil, page_size: nil, request_options: {}) # - # @param id [String] User ID or username + # @param id [String] Target user ID or username for follower lookup. # # @param after [String] Legacy cursor alias. Prefer cursor. # @@ -159,7 +159,7 @@ def retrieve_followers_you_know(id, params = {}) # # @param id [String] User ID or username for following lookup # - # @param after [String] Legacy cursor alias. Prefer cursor. + # @param after [String] Deprecated following cursor alias. Prefer cursor. # # @param cursor [String] Pagination cursor for following list # @@ -494,7 +494,7 @@ def retrieve_mentions(id, params = {}) # # @overload retrieve_replies(id, any_words: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, include_parent_tweet: nil, in_reply_to_tweet_id: nil, language: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # - # @param id [String] X user ID or username + # @param id [String] Target user ID or username for the replies timeline. # # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o # @@ -512,7 +512,7 @@ def retrieve_mentions(id, params = {}) # # @param hashtags [String] Hashtags separated by spaces, commas, or lines. # - # @param include_parent_tweet [Boolean] Include parent tweet for replies + # @param include_parent_tweet [Boolean] Include each reply's parent tweet. # # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. # diff --git a/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi index 5037662..8daa169 100644 --- a/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi +++ b/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi @@ -14,7 +14,7 @@ module XTwitterScraper ) end - # Billing session ID returned by the top-up billing flow. + # Top-up session ID to inspect. sig { returns(String) } attr_accessor :session_id @@ -25,7 +25,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Billing session ID returned by the top-up billing flow. + # Top-up session ID to inspect. session_id:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index 54fc0cf..e1f4e93 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -32,7 +32,7 @@ module XTwitterScraper sig { params(reason: String).void } attr_writer :reason - # Required wait in seconds. + # Seconds until the next permitted request. sig { returns(T.nilable(Integer)) } attr_reader :retry_after @@ -68,7 +68,7 @@ module XTwitterScraper message: nil, # Machine-readable reason for a login cooldown. reason: nil, - # Required wait in seconds. + # Seconds until the next permitted request. retry_after: nil, # Required wait in milliseconds. retry_after_ms: nil @@ -313,6 +313,171 @@ module XTwitterScraper :user_not_found, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + BODY_TOO_LARGE = + T.let( + :body_too_large, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + CHECKOUT_UNAVAILABLE = + T.let( + :checkout_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + CONNECTION_CHALLENGE_EXPIRED = + T.let( + :connection_challenge_expired, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + CONNECTION_CHALLENGE_INACTIVE = + T.let( + :connection_challenge_inactive, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + DRAFT_NOT_FOUND = + T.let( + :draft_not_found, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + FAVORITERS_UNAVAILABLE = + T.let( + :favoriters_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + FORBIDDEN = + T.let( + :forbidden, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + GUEST_WALLET_UNAVAILABLE = + T.let( + :guest_wallet_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + GUEST_WALLETS_DISABLED = + T.let( + :guest_wallets_disabled, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + GUEST_WALLETS_UNAVAILABLE = + T.let( + :guest_wallets_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + IDEMPOTENCY_CONFLICT = + T.let( + :idempotency_conflict, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + IDEMPOTENCY_KEY_CONFLICT = + T.let( + :idempotency_key_conflict, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_COMMUNITY_ID = + T.let( + :invalid_community_id, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_IDEMPOTENCY_KEY = + T.let( + :invalid_idempotency_key, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_LIST_ID = + T.let( + :invalid_list_id, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_PAYMENT_AMOUNT = + T.let( + :invalid_payment_amount, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + INVALID_RANGE = + T.let( + :invalid_range, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + LOGIN_RATE_LIMITED = + T.let( + :login_rate_limited, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MISSING_IDEMPOTENCY_KEY = + T.let( + :missing_idempotency_key, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + MISSING_IDS = + T.let( + :missing_ids, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + NO_CACHED_STYLE = + T.let( + :no_cached_style, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + PASSKEY_REQUIRED = + T.let( + :passkey_required, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + RATE_LIMITED = + T.let( + :rate_limited, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + READ_REQUEST_TIMEOUT = + T.let( + :read_request_timeout, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + REPLIES_INCOMPLETE = + T.let( + :replies_incomplete, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + SUPPORT_MEDIA_RATE_LIMIT = + T.let( + :support_media_rate_limit, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + SUPPORT_REQUEST_RATE_LIMIT = + T.let( + :support_request_rate_limit, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + TOO_MANY_IDS = + T.let( + :too_many_ids, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + UNKNOWN_FIELD = + T.let( + :unknown_field, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + UNSUPPORTED_MEDIA_TYPE = + T.let( + :unsupported_media_type, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + WEBHOOK_INACTIVE = + T.let( + :webhook_inactive, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + WRITE_TRACKING_UNAVAILABLE = + T.let( + :write_tracking_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) + X_WRITE_UNCONFIRMED = + T.let( + :x_write_unconfirmed, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) X_ACCOUNT_FEATURE_REQUIRED = T.let( :x_account_feature_required, @@ -719,6 +884,171 @@ module XTwitterScraper :user_not_found, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + BODY_TOO_LARGE = + T.let( + :body_too_large, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + CHECKOUT_UNAVAILABLE = + T.let( + :checkout_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + CONNECTION_CHALLENGE_EXPIRED = + T.let( + :connection_challenge_expired, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + CONNECTION_CHALLENGE_INACTIVE = + T.let( + :connection_challenge_inactive, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + DRAFT_NOT_FOUND = + T.let( + :draft_not_found, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + FAVORITERS_UNAVAILABLE = + T.let( + :favoriters_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + FORBIDDEN = + T.let( + :forbidden, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + GUEST_WALLET_UNAVAILABLE = + T.let( + :guest_wallet_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + GUEST_WALLETS_DISABLED = + T.let( + :guest_wallets_disabled, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + GUEST_WALLETS_UNAVAILABLE = + T.let( + :guest_wallets_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + IDEMPOTENCY_CONFLICT = + T.let( + :idempotency_conflict, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + IDEMPOTENCY_KEY_CONFLICT = + T.let( + :idempotency_key_conflict, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_COMMUNITY_ID = + T.let( + :invalid_community_id, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_IDEMPOTENCY_KEY = + T.let( + :invalid_idempotency_key, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_LIST_ID = + T.let( + :invalid_list_id, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_PAYMENT_AMOUNT = + T.let( + :invalid_payment_amount, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + INVALID_RANGE = + T.let( + :invalid_range, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + LOGIN_RATE_LIMITED = + T.let( + :login_rate_limited, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MISSING_IDEMPOTENCY_KEY = + T.let( + :missing_idempotency_key, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + MISSING_IDS = + T.let( + :missing_ids, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + NO_CACHED_STYLE = + T.let( + :no_cached_style, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + PASSKEY_REQUIRED = + T.let( + :passkey_required, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + RATE_LIMITED = + T.let( + :rate_limited, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + READ_REQUEST_TIMEOUT = + T.let( + :read_request_timeout, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + REPLIES_INCOMPLETE = + T.let( + :replies_incomplete, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + SUPPORT_MEDIA_RATE_LIMIT = + T.let( + :support_media_rate_limit, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + SUPPORT_REQUEST_RATE_LIMIT = + T.let( + :support_request_rate_limit, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + TOO_MANY_IDS = + T.let( + :too_many_ids, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + UNKNOWN_FIELD = + T.let( + :unknown_field, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + UNSUPPORTED_MEDIA_TYPE = + T.let( + :unsupported_media_type, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + WEBHOOK_INACTIVE = + T.let( + :webhook_inactive, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + WRITE_TRACKING_UNAVAILABLE = + T.let( + :write_tracking_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) + X_WRITE_UNCONFIRMED = + T.let( + :x_write_unconfirmed, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) X_ACCOUNT_FEATURE_REQUIRED = T.let( :x_account_feature_required, 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 0cb6a1c..95e233e 100644 --- a/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +++ b/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi @@ -260,7 +260,7 @@ module XTwitterScraper sig { params(retweets_of_tweet_id: String).void } attr_writer :retweets_of_tweet_id - # Required for tweet_search_extractor & community_search. + # Query used to price tweet_search_extractor or community_search. sig { returns(T.nilable(String)) } attr_reader :search_query @@ -274,14 +274,14 @@ module XTwitterScraper sig { params(since_date: Date).void } attr_writer :since_date - # Required for community_post_extractor & community_search. + # Community ID used to price community_post_extractor or community_search. sig { returns(T.nilable(String)) } attr_reader :target_community_id sig { params(target_community_id: String).void } attr_writer :target_community_id - # Required for list_follower_explorer, list_member_extractor & + # List ID used to price list_follower_explorer, list_member_extractor, or # list_post_extractor. sig { returns(T.nilable(String)) } attr_reader :target_list_id @@ -289,7 +289,7 @@ module XTwitterScraper sig { params(target_list_id: String).void } attr_writer :target_list_id - # Required for space_explorer. + # Space ID used to price space_explorer. sig { returns(T.nilable(String)) } attr_reader :target_space_id @@ -447,16 +447,16 @@ module XTwitterScraper retweets: nil, # Estimate only retweets of this tweet ID (tweet_search_extractor) retweets_of_tweet_id: nil, - # Required for tweet_search_extractor & community_search. + # Query used to price tweet_search_extractor or community_search. search_query: nil, # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) since_date: nil, - # Required for community_post_extractor & community_search. + # Community ID used to price community_post_extractor or community_search. target_community_id: nil, - # Required for list_follower_explorer, list_member_extractor & + # List ID used to price list_follower_explorer, list_member_extractor, or # list_post_extractor. target_list_id: nil, - # Required for space_explorer. + # Space ID used to price space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, diff --git a/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi b/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi index 2fd4336..3bf837e 100644 --- a/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi +++ b/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi @@ -14,7 +14,7 @@ module XTwitterScraper ) end - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. sig { returns(Integer) } attr_accessor :amount_minor @@ -33,7 +33,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. amount_minor:, idempotency_key:, currency: :usd, diff --git a/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi b/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi index 6f96c9c..e825c9d 100644 --- a/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi +++ b/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi @@ -14,7 +14,7 @@ module XTwitterScraper ) end - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. sig { returns(Integer) } attr_accessor :amount_minor @@ -33,7 +33,7 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( - # Confirmed USD amount in cents. + # USD cents accepted for this checkout. amount_minor:, idempotency_key:, currency: :usd, diff --git a/rbi/x_twitter_scraper/models/search_tweet.rbi b/rbi/x_twitter_scraper/models/search_tweet.rbi index 322add8..b1dfc65 100644 --- a/rbi/x_twitter_scraper/models/search_tweet.rbi +++ b/rbi/x_twitter_scraper/models/search_tweet.rbi @@ -67,7 +67,7 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at - # Start and end offsets for rendered tweet text + # Rendered text's start and end offsets. sig { returns(T.nilable(T::Array[Integer])) } attr_reader :display_text_range @@ -82,21 +82,21 @@ module XTwitterScraper sig { params(entities: T::Hash[Symbol, T.anything]).void } attr_writer :entities - # Tweet ID being replied to + # ID of the tweet this result replies to. sig { returns(T.nilable(String)) } attr_reader :in_reply_to_id sig { params(in_reply_to_id: String).void } attr_writer :in_reply_to_id - # User ID being replied to + # ID of the user this result replies to. sig { returns(T.nilable(String)) } attr_reader :in_reply_to_user_id sig { params(in_reply_to_user_id: String).void } attr_writer :in_reply_to_user_id - # Username being replied to + # Username this result replies to. sig { returns(T.nilable(String)) } attr_reader :in_reply_to_username @@ -131,7 +131,7 @@ module XTwitterScraper sig { params(is_reply: T::Boolean).void } attr_writer :is_reply - # Tweet language code + # Search result language code. sig { returns(T.nilable(String)) } attr_reader :lang @@ -178,7 +178,7 @@ module XTwitterScraper sig { params(type: String).void } attr_writer :type - # Tweet permalink URL + # Search result permalink. sig { returns(T.nilable(String)) } attr_reader :url @@ -236,16 +236,16 @@ module XTwitterScraper # Root tweet ID for the search result conversation conversation_id: nil, created_at: nil, - # Start and end offsets for rendered tweet text + # Rendered text's start and end offsets. display_text_range: nil, # Parsed search-result entities including URLs, mentions, hashtags, and media # markers entities: nil, - # Tweet ID being replied to + # ID of the tweet this result replies to. in_reply_to_id: nil, - # User ID being replied to + # ID of the user this result replies to. in_reply_to_user_id: nil, - # Username being replied to + # Username this result replies to. in_reply_to_username: nil, # Whether the tweet has limited reply permissions is_limited_reply: nil, @@ -255,7 +255,7 @@ module XTwitterScraper is_quote_status: nil, # True when this search result is a reply is_reply: nil, - # Tweet language code + # Search result language code. lang: nil, # Search-result media attachments, omitted when no media is present media: nil, @@ -270,7 +270,7 @@ module XTwitterScraper # Client application used to post the tweet source: nil, type: nil, - # Tweet permalink URL + # Search result permalink. url: nil ) end diff --git a/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi index 5b13a89..4c61172 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi @@ -14,30 +14,15 @@ module XTwitterScraper sig do returns( - T.nilable( - T::Array[ - XTwitterScraper::Models::Support::TicketCreateResponse::Attachment - ] - ) + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment + ] ) end - attr_reader :attachments - - sig do - params( - attachments: - T::Array[ - XTwitterScraper::Models::Support::TicketCreateResponse::Attachment::OrHash - ] - ).void - end - attr_writer :attachments - - sig { returns(T.nilable(String)) } - attr_reader :public_id + attr_accessor :attachments - sig { params(public_id: String).void } - attr_writer :public_id + sig { returns(String) } + attr_accessor :public_id sig do params( @@ -48,7 +33,7 @@ module XTwitterScraper public_id: String ).returns(T.attached_class) end - def self.new(attachments: nil, public_id: nil) + def self.new(attachments:, public_id:) end sig do @@ -84,6 +69,7 @@ module XTwitterScraper end attr_accessor :status + # Attachment identifier and initial processing state. sig do params( public_id: String, diff --git a/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi index 268b7ad..6ab98f5 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi @@ -14,30 +14,15 @@ module XTwitterScraper sig do returns( - T.nilable( - T::Array[ - XTwitterScraper::Models::Support::TicketReplyResponse::Attachment - ] - ) + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment + ] ) end - attr_reader :attachments - - sig do - params( - attachments: - T::Array[ - XTwitterScraper::Models::Support::TicketReplyResponse::Attachment::OrHash - ] - ).void - end - attr_writer :attachments - - sig { returns(T.nilable(String)) } - attr_reader :public_id + attr_accessor :attachments - sig { params(public_id: String).void } - attr_writer :public_id + sig { returns(String) } + attr_accessor :public_id sig do params( @@ -48,7 +33,7 @@ module XTwitterScraper public_id: String ).returns(T.attached_class) end - def self.new(attachments: nil, public_id: nil) + def self.new(attachments:, public_id:) end sig do @@ -84,6 +69,7 @@ module XTwitterScraper end attr_accessor :status + # Attachment identifier and initial processing state. sig do params( public_id: String, diff --git a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi index 7511e25..dcefb67 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi @@ -196,6 +196,7 @@ module XTwitterScraper ) end + # Validated media type. sig do returns( XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol @@ -206,6 +207,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :filename + # Attachment media class. sig do returns( XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Kind::TaggedSymbol @@ -219,6 +221,7 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :size_bytes + # Storage processing state. sig do returns( XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol @@ -229,6 +232,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + # Downloadable image or video attached to a support message. sig do params( content_type: @@ -244,11 +248,14 @@ module XTwitterScraper ).returns(T.attached_class) end def self.new( + # Validated media type. content_type:, filename:, + # Attachment media class. kind:, public_id:, size_bytes:, + # Storage processing state. status:, url: ) @@ -273,6 +280,7 @@ module XTwitterScraper def to_hash end + # Validated media type. module ContentType extend XTwitterScraper::Internal::Type::Enum @@ -332,6 +340,7 @@ module XTwitterScraper end end + # Attachment media class. module Kind extend XTwitterScraper::Internal::Type::Enum @@ -366,6 +375,7 @@ module XTwitterScraper end end + # Storage processing state. module Status extend XTwitterScraper::Internal::Type::Enum 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 ea179de..9f7dbc5 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,7 +18,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id - # Legacy cursor alias. Prefer cursor. + # Deprecated following cursor alias. Prefer cursor. sig { returns(T.nilable(String)) } attr_reader :after @@ -61,7 +61,7 @@ module XTwitterScraper end def self.new( id:, - # Legacy cursor alias. Prefer cursor. + # Deprecated following cursor alias. Prefer cursor. after: nil, # Pagination cursor for following list cursor: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi index e2f2f5e..5359d7e 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi @@ -75,7 +75,7 @@ module XTwitterScraper sig { params(hashtags: String).void } attr_writer :hashtags - # Include parent tweet for replies + # Include each reply's parent tweet. sig { returns(T.nilable(T::Boolean)) } attr_reader :include_parent_tweet @@ -320,7 +320,7 @@ module XTwitterScraper from_user: nil, # Hashtags separated by spaces, commas, or lines. hashtags: nil, - # Include parent tweet for replies + # Include each reply's parent tweet. include_parent_tweet: nil, # Only replies to this tweet ID. in_reply_to_tweet_id: nil, diff --git a/rbi/x_twitter_scraper/resources/credits.rbi b/rbi/x_twitter_scraper/resources/credits.rbi index 2daa192..e90fe21 100644 --- a/rbi/x_twitter_scraper/resources/credits.rbi +++ b/rbi/x_twitter_scraper/resources/credits.rbi @@ -35,7 +35,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::CreditRetrieveTopupStatusResponse) end def retrieve_topup_status( - # Billing session ID returned by the top-up billing flow. + # Top-up session ID to inspect. session_id:, request_options: {} ) diff --git a/rbi/x_twitter_scraper/resources/extractions.rbi b/rbi/x_twitter_scraper/resources/extractions.rbi index 040376f..3bb2560 100644 --- a/rbi/x_twitter_scraper/resources/extractions.rbi +++ b/rbi/x_twitter_scraper/resources/extractions.rbi @@ -162,16 +162,16 @@ module XTwitterScraper retweets: nil, # Estimate only retweets of this tweet ID (tweet_search_extractor) retweets_of_tweet_id: nil, - # Required for tweet_search_extractor & community_search. + # Query used to price tweet_search_extractor or community_search. search_query: nil, # Estimate start date in YYYY-MM-DD format (tweet_search_extractor) since_date: nil, - # Required for community_post_extractor & community_search. + # Community ID used to price community_post_extractor or community_search. target_community_id: nil, - # Required for list_follower_explorer, list_member_extractor & + # List ID used to price list_follower_explorer, list_member_extractor, or # list_post_extractor. target_list_id: nil, - # Required for space_explorer. + # Space ID used to price space_explorer. target_space_id: nil, target_tweet_id: nil, target_username: nil, diff --git a/rbi/x_twitter_scraper/resources/guest_wallets.rbi b/rbi/x_twitter_scraper/resources/guest_wallets.rbi index e2003b5..ba62143 100644 --- a/rbi/x_twitter_scraper/resources/guest_wallets.rbi +++ b/rbi/x_twitter_scraper/resources/guest_wallets.rbi @@ -18,7 +18,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::GuestWalletCreateResponse) end def create( - # Body param: Confirmed USD amount in cents. + # Body param: USD cents accepted for this checkout. amount_minor:, # Header param: Generate a cryptographically random UUID v4. Reuse it only to # retry the same wallet and amount request. Initial wallet creation can recover @@ -55,7 +55,7 @@ module XTwitterScraper ).returns(XTwitterScraper::Models::GuestWalletTopupResponse) end def topup( - # Body param: Confirmed USD amount in cents. + # Body param: USD cents accepted for this checkout. amount_minor:, # Header param: Generate a cryptographically random UUID v4. Reuse it only to # retry the same wallet and amount request. Initial wallet creation can recover diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index 2ec5814..fcdd465 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -72,7 +72,7 @@ module XTwitterScraper ).returns(XTwitterScraper::PaginatedUsers) end def retrieve_followers( - # User ID or username + # Target user ID or username for follower lookup. id, # Legacy cursor alias. Prefer cursor. after: nil, @@ -126,7 +126,7 @@ module XTwitterScraper def retrieve_following( # User ID or username for following lookup id, - # Legacy cursor alias. Prefer cursor. + # Deprecated following cursor alias. Prefer cursor. after: nil, # Pagination cursor for following list cursor: nil, @@ -499,7 +499,7 @@ module XTwitterScraper ).returns(XTwitterScraper::PaginatedTweets) end def retrieve_replies( - # X user ID or username + # Target user ID or username for the replies timeline. id, # Words or quoted phrases where any one can match. Separate with spaces, commas, # or lines. @@ -518,7 +518,7 @@ module XTwitterScraper from_user: nil, # Hashtags separated by spaces, commas, or lines. hashtags: nil, - # Include parent tweet for replies + # Include each reply's parent tweet. include_parent_tweet: nil, # Only replies to this tweet ID. in_reply_to_tweet_id: nil, diff --git a/sig/x_twitter_scraper/models/error.rbs b/sig/x_twitter_scraper/models/error.rbs index 4478bca..97a097c 100644 --- a/sig/x_twitter_scraper/models/error.rbs +++ b/sig/x_twitter_scraper/models/error.rbs @@ -92,6 +92,39 @@ module XTwitterScraper | :unauthenticated | :unsupported_field | :user_not_found + | :body_too_large + | :checkout_unavailable + | :connection_challenge_expired + | :connection_challenge_inactive + | :draft_not_found + | :favoriters_unavailable + | :forbidden + | :guest_wallet_unavailable + | :guest_wallets_disabled + | :guest_wallets_unavailable + | :idempotency_conflict + | :idempotency_key_conflict + | :invalid_community_id + | :invalid_idempotency_key + | :invalid_list_id + | :invalid_payment_amount + | :invalid_range + | :login_rate_limited + | :missing_idempotency_key + | :missing_ids + | :no_cached_style + | :passkey_required + | :rate_limited + | :read_request_timeout + | :replies_incomplete + | :support_media_rate_limit + | :support_request_rate_limit + | :too_many_ids + | :unknown_field + | :unsupported_media_type + | :webhook_inactive + | :write_tracking_unavailable + | :x_write_unconfirmed | :x_account_feature_required | :x_account_protected | :x_account_suspended @@ -162,6 +195,39 @@ module XTwitterScraper UNAUTHENTICATED: :unauthenticated UNSUPPORTED_FIELD: :unsupported_field USER_NOT_FOUND: :user_not_found + BODY_TOO_LARGE: :body_too_large + CHECKOUT_UNAVAILABLE: :checkout_unavailable + CONNECTION_CHALLENGE_EXPIRED: :connection_challenge_expired + CONNECTION_CHALLENGE_INACTIVE: :connection_challenge_inactive + DRAFT_NOT_FOUND: :draft_not_found + FAVORITERS_UNAVAILABLE: :favoriters_unavailable + FORBIDDEN: :forbidden + GUEST_WALLET_UNAVAILABLE: :guest_wallet_unavailable + GUEST_WALLETS_DISABLED: :guest_wallets_disabled + GUEST_WALLETS_UNAVAILABLE: :guest_wallets_unavailable + IDEMPOTENCY_CONFLICT: :idempotency_conflict + IDEMPOTENCY_KEY_CONFLICT: :idempotency_key_conflict + INVALID_COMMUNITY_ID: :invalid_community_id + INVALID_IDEMPOTENCY_KEY: :invalid_idempotency_key + INVALID_LIST_ID: :invalid_list_id + INVALID_PAYMENT_AMOUNT: :invalid_payment_amount + INVALID_RANGE: :invalid_range + LOGIN_RATE_LIMITED: :login_rate_limited + MISSING_IDEMPOTENCY_KEY: :missing_idempotency_key + MISSING_IDS: :missing_ids + NO_CACHED_STYLE: :no_cached_style + PASSKEY_REQUIRED: :passkey_required + RATE_LIMITED: :rate_limited + READ_REQUEST_TIMEOUT: :read_request_timeout + REPLIES_INCOMPLETE: :replies_incomplete + SUPPORT_MEDIA_RATE_LIMIT: :support_media_rate_limit + SUPPORT_REQUEST_RATE_LIMIT: :support_request_rate_limit + TOO_MANY_IDS: :too_many_ids + UNKNOWN_FIELD: :unknown_field + UNSUPPORTED_MEDIA_TYPE: :unsupported_media_type + WEBHOOK_INACTIVE: :webhook_inactive + WRITE_TRACKING_UNAVAILABLE: :write_tracking_unavailable + X_WRITE_UNCONFIRMED: :x_write_unconfirmed X_ACCOUNT_FEATURE_REQUIRED: :x_account_feature_required X_ACCOUNT_PROTECTED: :x_account_protected X_ACCOUNT_SUSPENDED: :x_account_suspended @@ -259,6 +325,39 @@ module XTwitterScraper | :unauthenticated | :unsupported_field | :user_not_found + | :body_too_large + | :checkout_unavailable + | :connection_challenge_expired + | :connection_challenge_inactive + | :draft_not_found + | :favoriters_unavailable + | :forbidden + | :guest_wallet_unavailable + | :guest_wallets_disabled + | :guest_wallets_unavailable + | :idempotency_conflict + | :idempotency_key_conflict + | :invalid_community_id + | :invalid_idempotency_key + | :invalid_list_id + | :invalid_payment_amount + | :invalid_range + | :login_rate_limited + | :missing_idempotency_key + | :missing_ids + | :no_cached_style + | :passkey_required + | :rate_limited + | :read_request_timeout + | :replies_incomplete + | :support_media_rate_limit + | :support_request_rate_limit + | :too_many_ids + | :unknown_field + | :unsupported_media_type + | :webhook_inactive + | :write_tracking_unavailable + | :x_write_unconfirmed | :x_account_feature_required | :x_account_protected | :x_account_suspended @@ -329,6 +428,39 @@ module XTwitterScraper UNAUTHENTICATED: :unauthenticated UNSUPPORTED_FIELD: :unsupported_field USER_NOT_FOUND: :user_not_found + BODY_TOO_LARGE: :body_too_large + CHECKOUT_UNAVAILABLE: :checkout_unavailable + CONNECTION_CHALLENGE_EXPIRED: :connection_challenge_expired + CONNECTION_CHALLENGE_INACTIVE: :connection_challenge_inactive + DRAFT_NOT_FOUND: :draft_not_found + FAVORITERS_UNAVAILABLE: :favoriters_unavailable + FORBIDDEN: :forbidden + GUEST_WALLET_UNAVAILABLE: :guest_wallet_unavailable + GUEST_WALLETS_DISABLED: :guest_wallets_disabled + GUEST_WALLETS_UNAVAILABLE: :guest_wallets_unavailable + IDEMPOTENCY_CONFLICT: :idempotency_conflict + IDEMPOTENCY_KEY_CONFLICT: :idempotency_key_conflict + INVALID_COMMUNITY_ID: :invalid_community_id + INVALID_IDEMPOTENCY_KEY: :invalid_idempotency_key + INVALID_LIST_ID: :invalid_list_id + INVALID_PAYMENT_AMOUNT: :invalid_payment_amount + INVALID_RANGE: :invalid_range + LOGIN_RATE_LIMITED: :login_rate_limited + MISSING_IDEMPOTENCY_KEY: :missing_idempotency_key + MISSING_IDS: :missing_ids + NO_CACHED_STYLE: :no_cached_style + PASSKEY_REQUIRED: :passkey_required + RATE_LIMITED: :rate_limited + READ_REQUEST_TIMEOUT: :read_request_timeout + REPLIES_INCOMPLETE: :replies_incomplete + SUPPORT_MEDIA_RATE_LIMIT: :support_media_rate_limit + SUPPORT_REQUEST_RATE_LIMIT: :support_request_rate_limit + TOO_MANY_IDS: :too_many_ids + UNKNOWN_FIELD: :unknown_field + UNSUPPORTED_MEDIA_TYPE: :unsupported_media_type + WEBHOOK_INACTIVE: :webhook_inactive + WRITE_TRACKING_UNAVAILABLE: :write_tracking_unavailable + X_WRITE_UNCONFIRMED: :x_write_unconfirmed X_ACCOUNT_FEATURE_REQUIRED: :x_account_feature_required X_ACCOUNT_PROTECTED: :x_account_protected X_ACCOUNT_SUSPENDED: :x_account_suspended diff --git a/sig/x_twitter_scraper/models/support/ticket_create_response.rbs b/sig/x_twitter_scraper/models/support/ticket_create_response.rbs index 81bb6e9..ba5190a 100644 --- a/sig/x_twitter_scraper/models/support/ticket_create_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_create_response.rbs @@ -8,19 +8,13 @@ module XTwitterScraper } class TicketCreateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]? + attr_accessor attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] - def attachments=: ( - ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] - ) -> ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] - - attr_reader public_id: String? - - def public_id=: (String) -> String + attr_accessor public_id: String def initialize: ( - ?attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], - ?public_id: String + attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], + public_id: String ) -> void def to_hash: -> { diff --git a/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs b/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs index 440f1d0..e447fe3 100644 --- a/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs @@ -8,19 +8,13 @@ module XTwitterScraper } class TicketReplyResponse < XTwitterScraper::Internal::Type::BaseModel - attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]? + attr_accessor attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] - def attachments=: ( - ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] - ) -> ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] - - attr_reader public_id: String? - - def public_id=: (String) -> String + attr_accessor public_id: String def initialize: ( - ?attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], - ?public_id: String + attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], + public_id: String ) -> void def to_hash: -> { diff --git a/test/x_twitter_scraper/resources/support/tickets_test.rb b/test/x_twitter_scraper/resources/support/tickets_test.rb index 779e3de..e8f75c6 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -18,8 +18,8 @@ def test_create_required_params assert_pattern do response => { - attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]) | nil, - public_id: String | nil + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]), + public_id: String } end end @@ -93,8 +93,8 @@ def test_reply_required_params assert_pattern do response => { - attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]) | nil, - public_id: String | nil + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]), + public_id: String } end end From dbe2799f901a86479520c115ff11445793c837d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:53:28 +0000 Subject: [PATCH 11/12] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9953b89..e6012c9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-6390fae0cb8c75f6da61d4aabc5cf067cdcc1dd4ff5631e84e7e4067cb551b0c.yml -openapi_spec_hash: c4bbf09f0a8a87fdd49cbea797a3e3af -config_hash: 4b64fbd16fd09008417c5a460d27f053 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-a89d9fe0de8895b2daf847c8f3ff8bc93f43039c040d0bf093ec6dc1e734f57b.yml +openapi_spec_hash: c6365ebfe4f85183f384f27865cf66ce +config_hash: 9a418581d96f0820ef923bfe5ffa2541 From 1e3b374cc23a88c1fb12832768b0cad4103daafe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 16:13:29 +0000 Subject: [PATCH 12/12] release: 0.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 20 ++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/x_twitter_scraper/version.rb | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a3cf436..f1c1e58 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.5" + ".": "0.5.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 468cdb6..25bc477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.5.0 (2026-07-22) + +Full Changelog: [v0.4.5...v0.5.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.4.5...v0.5.0) + +### Features + +* **api:** propagate durable write actions ([b959adc](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/b959adc349d87f75be1dfb858c92479c637588d8)) +* **api:** propagate production write-action contract ([b433f8d](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/b433f8d824bcb1ca60592d21d9f90b8baa79878a)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([9ad8d7c](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/9ad8d7c87cdd91232cf5ba76a5f5022d43cb7348)) + + +### Bug Fixes + +* **client:** elide content type header on requests without body ([b0186db](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/b0186db54e9074f563ae6528506fbd12d607d607)) + + +### Chores + +* **deps:** support connection_pool 3 ([ad578c2](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/ad578c2453ff451f3317606f542baa491267a250)) + ## 0.4.4 (2026-07-14) Full Changelog: [v0.4.3...v0.4.4](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.4.3...v0.4.4) diff --git a/Gemfile.lock b/Gemfile.lock index b6f02c5..f7c69f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - x-twitter-scraper (0.4.5) + x-twitter-scraper (0.5.0) base64 cgi connection_pool diff --git a/README.md b/README.md index 18d3a10..58762fc 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Add the gem to your `Gemfile`: ```ruby -gem "x-twitter-scraper", "~> 0.4.5" +gem "x-twitter-scraper", "~> 0.5.0" ``` diff --git a/lib/x_twitter_scraper/version.rb b/lib/x_twitter_scraper/version.rb index 0dd672a..458ab14 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.4.5" + VERSION = "0.5.0" end