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/ci.yml b/.github/workflows/ci.yml index ea56a79..ca67181 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,20 +22,54 @@ concurrency: cancel-in-progress: true jobs: + build: + timeout-minutes: 10 + name: build + permissions: + contents: read + id-token: write + 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') + 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: Get GitHub OIDC Token + if: |- + github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + id: github-oidc + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Build and upload gem artifacts + if: |- + github.repository == 'stainless-sdks/x-twitter-scraper-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + PACKAGE_NAME: x_twitter_scraper + run: ./scripts/utils/upload-artifact.sh lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-24.04 + 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: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -48,16 +82,12 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-24.04 + 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: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index cd7ce85..a2e41ff 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -13,24 +13,13 @@ concurrency: jobs: publish: - name: Publish gem - if: startsWith(github.ref, 'refs/tags/v') - runs-on: ubuntu-24.04 - environment: - name: rubygems - url: https://rubygems.org/gems/x-twitter-scraper - permissions: - contents: read - id-token: write # Required for RubyGems trusted publishing. + name: publish + runs-on: ubuntu-latest steps: - - name: Check out repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false ruby-version: "3.2" @@ -43,8 +32,10 @@ jobs: - name: Build gem run: bundle exec rake build:gem - - name: Configure RubyGems credentials (trusted publishing) - uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0 - - name: Publish to RubyGems.org - run: gem push x-twitter-scraper-*.gem + 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/.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 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/.stats.yml b/.stats.yml index 51d317a..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-4665e942135459ff435542ae46122294c910986fdf19a0d2d33bc301817cf36f.yml -openapi_spec_hash: 564b37a7cb3edf100a82799631e287d9 -config_hash: 7a9e1c37c84d207c5ee312091fffd2b0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-a89d9fe0de8895b2daf847c8f3ff8bc93f43039c040d0bf093ec6dc1e734f57b.yml +openapi_spec_hash: c6365ebfe4f85183f384f27865cf66ce +config_hash: 9a418581d96f0820ef923bfe5ffa2541 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/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/Gemfile.lock b/Gemfile.lock index dbbb661..f7c69f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,10 +11,10 @@ GIT PATH remote: . specs: - x-twitter-scraper (0.4.5) - base64 (~> 0.3) - cgi (~> 0.5) - connection_pool (>= 2.5, < 4.0) + x-twitter-scraper (0.5.0) + base64 + cgi + connection_pool GEM remote: https://rubygems.org/ diff --git a/README.md b/README.md index 6bce54d..58762fc 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,19 @@ -# X (Twitter) Scraper Ruby SDK: Tweet Search, Profile Tweets, Followers & Posting +# Xquik Ruby SDK -> **Xquik is an independent third-party service.** Not affiliated with X Corp. -> "Twitter" and "X" are trademarks of X Corp. - -[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13739/badge)](https://www.bestpractices.dev/projects/13739) -[![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. - -It is generated with [Stainless](https://www.stainless.com/). +Use the Xquik API from Ruby 3.2+. The SDK includes Yard, RBS, and RBI types. It uses `net/http` with connection pooling. ## Documentation -Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/x-twitter-scraper). - -The REST API documentation can be found on [xquik.com](https://xquik.com). +Read the [Ruby SDK guide](https://docs.xquik.com/sdks/ruby), [API guide](https://docs.xquik.com/api-reference/overview), or [RubyDoc reference](https://gemdocs.org/gems/x-twitter-scraper). ## Installation -To use this gem, install via Bundler by adding the following to your application's `Gemfile`: +Add the gem to your `Gemfile`: ```ruby -gem "x-twitter-scraper", "~> 0.4.5" +gem "x-twitter-scraper", "~> 0.5.0" ``` @@ -46,29 +33,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 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, control the filename and 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) -``` - -Passing a raw `IO` descriptor disables retries because pipes cannot be rewound safely. - ### 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: @@ -204,7 +168,7 @@ Unless otherwise specified, other classes in the SDK do not have locks protectin ## Sorbet -This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime. +The SDK includes [RBI](https://sorbet.org/docs/rbi) definitions. It does not depend on `sorbet-runtime`. You can provide typesafe request parameters like so: @@ -264,3 +228,5 @@ Ruby 3.2.0 or higher. ## Contributing See [the contributing documentation](https://github.com/Xquik-dev/x-twitter-scraper-ruby/tree/main/CONTRIBUTING.md). + +Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. 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/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 eb1aa4d..d9b8783 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 + # Seconds until the next permitted request. + # + # @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] Seconds until the next permitted request. + # + # @param retry_after_ms [Integer] Required wait in milliseconds. # @see XTwitterScraper::Models::Error#error module Error @@ -66,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 @@ -92,7 +157,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] @@ -163,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 @@ -189,7 +286,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/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_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_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/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/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_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..70cef0c 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,50 @@ module Models module Support # @see XTwitterScraper::Resources::Support::Tickets#create class TicketCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute 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(public_id: nil) + # @!method initialize(attachments:, public_id:) + # @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:) + # Attachment identifier and initial processing state. + # + # @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..279f4b0 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,50 @@ module Models module Support # @see XTwitterScraper::Resources::Support::Tickets#reply class TicketReplyResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute 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(public_id: nil) + # @!method initialize(attachments:, public_id:) + # @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:) + # Attachment identifier and initial processing state. + # + # @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..144018f 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,117 @@ 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 + # Validated media 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 + # Attachment media class. + # + # @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 + # Storage processing state. + # + # @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:) + # 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] Attachment media class. + # + # @param public_id [String] + # + # @param size_bytes [Integer] + # + # @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 + + 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 + + # Attachment media class. + # + # @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 + + # Storage processing state. + # + # @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_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/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/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/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/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/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/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/trends.rb b/lib/x_twitter_scraper/resources/trends.rb index dc6a521..9887ded 100644 --- a/lib/x_twitter_scraper/resources/trends.rb +++ b/lib/x_twitter_scraper/resources/trends.rb @@ -7,7 +7,7 @@ class Trends # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::TrendListParams} for more details. # - # Get trending hashtags and topics by region (alias) + # Get trending hashtags & topics by region (alias) # # @overload list(count: nil, woeid: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x.rb b/lib/x_twitter_scraper/resources/x.rb index d2042da..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 @@ -121,7 +120,7 @@ def get_notifications(params = {}) ) end - # Get trending hashtags and topics from X by region + # Get trending hashtags & topics from X by region # # @overload get_trends(count: nil, woeid: nil, request_options: {}) # diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index 23b30dc..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,16 +67,18 @@ 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 ) end - # Get community name, description and member count + # Get community name, description & member count # # @overload retrieve_info(id, request_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 580eb8c..2b0ee52 100644 --- a/lib/x_twitter_scraper/resources/x/media.rb +++ b/lib/x_twitter_scraper/resources/x/media.rb @@ -3,9 +3,8 @@ module XTwitterScraper module Resources class X - # Media upload and download class Media - # Download images and videos from tweets + # Download images & videos from tweets # # @overload download(tweet_id: nil, tweet_ids: nil, tweet_input: nil, tweet_url: nil, request_options: {}) # @@ -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 460c1a3..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,16 +40,18 @@ 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 ) end - # Get tweet with full text, author, metrics and media + # Get tweet with full text, author, metrics & media # # @overload retrieve(id, request_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 102050b..166e173 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -8,7 +8,7 @@ class Users # @return [XTwitterScraper::Resources::X::Users::Follow] attr_reader :follow - # Get user profile with follower counts and verification + # Get user profile with follower counts & verification # # @overload retrieve(id, request_options: {}) # @@ -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] User ID to remove from your followers + # @param id [String] Path param: User ID to remove from your followers # - # @param account [String] X account identifier (@username or account ID) + # @param account [String] Body param: 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 ) @@ -85,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. # @@ -152,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 # @@ -487,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 # @@ -505,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/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/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 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 2f9a416..e1f4e93 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 + + # Seconds until the next permitted request. + 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, + # Seconds until the next permitted request. + 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 @@ -267,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, @@ -397,11 +608,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( @@ -678,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, @@ -808,11 +1179,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/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_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_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/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/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_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..4c61172 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,125 @@ module XTwitterScraper ) end - sig { returns(T.nilable(String)) } - attr_reader :public_id + sig do + returns( + T::Array[ + XTwitterScraper::Models::Support::TicketCreateResponse::Attachment + ] + ) + end + attr_accessor :attachments - sig { params(public_id: String).void } - attr_writer :public_id + sig { returns(String) } + attr_accessor :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:, public_id:) 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 + + # Attachment identifier and initial processing state. + 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..6ab98f5 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,125 @@ module XTwitterScraper ) end - sig { returns(T.nilable(String)) } - attr_reader :public_id + sig do + returns( + T::Array[ + XTwitterScraper::Models::Support::TicketReplyResponse::Attachment + ] + ) + end + attr_accessor :attachments - sig { params(public_id: String).void } - attr_writer :public_id + sig { returns(String) } + attr_accessor :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:, public_id:) 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 + + # Attachment identifier and initial processing state. + 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..dcefb67 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,268 @@ 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 + + # Validated media type. + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::ContentType::TaggedSymbol + ) + end + attr_accessor :content_type + + sig { returns(String) } + attr_accessor :filename + + # Attachment media class. + 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 + + # Storage processing state. + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(String) } + attr_accessor :url + + # Downloadable image or video attached to a support message. + 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( + # Validated media type. + content_type:, + filename:, + # Attachment media class. + kind:, + public_id:, + size_bytes:, + # Storage processing state. + 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 + + # Validated media type. + 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 + + # Attachment media class. + 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 + + # Storage processing state. + 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_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/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/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/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/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/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/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/trends.rbi b/rbi/x_twitter_scraper/resources/trends.rbi index fd271c2..bf4cbcd 100644 --- a/rbi/x_twitter_scraper/resources/trends.rbi +++ b/rbi/x_twitter_scraper/resources/trends.rbi @@ -4,7 +4,7 @@ module XTwitterScraper module Resources # Trending topics and hashtags by region class Trends - # Get trending hashtags and topics by region (alias) + # Get trending hashtags & topics by region (alias) sig do params( count: Integer, diff --git a/rbi/x_twitter_scraper/resources/x.rbi b/rbi/x_twitter_scraper/resources/x.rbi index 42fa42e..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 @@ -99,7 +98,7 @@ module XTwitterScraper ) end - # Get trending hashtags and topics from X by region + # Get trending hashtags & topics from X by region sig do params( count: Integer, diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index 4575ffd..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,21 +44,27 @@ 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 - # Get community name, description and member count + # Get community name, description & member count sig do params( id: String, 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 d1f19d1..a40c4bc 100644 --- a/rbi/x_twitter_scraper/resources/x/media.rbi +++ b/rbi/x_twitter_scraper/resources/x/media.rbi @@ -3,9 +3,8 @@ module XTwitterScraper module Resources class X - # Media upload and download class Media - # Download images and videos from tweets + # Download images & videos from tweets sig do params( tweet_id: String, @@ -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 3f2bf60..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,23 +26,30 @@ 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: {} ) end - # Get tweet with full text, author, metrics and media + # Get tweet with full text, author, metrics & media sig do params( id: String, @@ -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 0c525f1..fcdd465 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -8,7 +8,7 @@ module XTwitterScraper sig { returns(XTwitterScraper::Resources::X::Users::Follow) } attr_reader :follow - # Get user profile with follower counts and verification + # Get user profile with follower counts & verification sig do params( id: String, @@ -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 @@ -66,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, @@ -120,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, @@ -493,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. @@ -512,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/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..97a097c 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 @@ -57,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 @@ -83,7 +151,6 @@ module XTwitterScraper | :x_user_lookup_failed | :x_write_ambiguous | :x_write_failed - | :x_write_unconfirmed module LegacyErrorCode extend XTwitterScraper::Internal::Type::Enum @@ -128,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 @@ -154,7 +254,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 @@ -226,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 @@ -252,7 +384,6 @@ module XTwitterScraper | :x_user_lookup_failed | :x_write_ambiguous | :x_write_failed - | :x_write_unconfirmed module Code extend XTwitterScraper::Internal::Type::Enum @@ -297,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 @@ -323,7 +487,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/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/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..ba5190a 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,60 @@ 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 public_id: String? + attr_accessor attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment] - def public_id=: (String) -> String + attr_accessor public_id: String - def initialize: (?public_id: String) -> void + def initialize: ( + attachments: ::Array[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment], + public_id: String + ) -> void - def to_hash: -> { public_id: String } + 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 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..e447fe3 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,60 @@ 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 public_id: String? + attr_accessor attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment] - def public_id=: (String) -> String + attr_accessor public_id: String - def initialize: (?public_id: String) -> void + def initialize: ( + attachments: ::Array[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment], + public_id: String + ) -> void - def to_hash: -> { public_id: String } + 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 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_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/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/client_test.rb b/test/x_twitter_scraper/client_test.rb index a6a0640..a0298b2 100644 --- a/test/x_twitter_scraper/client_test.rb +++ b/test/x_twitter_scraper/client_test.rb @@ -6,6 +6,11 @@ class XTwitterScraperTest < Minitest::Test extend Minitest::Serial include WebMock::API + def before_all + super + WebMock.enable! + end + def setup super Thread.current.thread_variable_set(:mock_sleep, []) @@ -241,18 +246,10 @@ def test_client_redirect_307 assert_requested(:any, "http://localhost/redirected", times: XTwitterScraper::Client::MAX_REDIRECTS) do assert_equal(recorded.method, _1.method) - if recorded.body.nil? - assert_nil(_1.body) - else - assert_equal(recorded.body, _1.body) - end - recorded_content_type = recorded.headers.transform_keys(&:downcase)["content-type"] - actual_content_type = _1.headers.transform_keys(&:downcase)["content-type"] - if recorded_content_type.nil? - assert_nil(actual_content_type) - else - assert_equal(recorded_content_type, actual_content_type) - end + assert_nil(recorded.body) + assert_nil(_1.body) + assert_nil(recorded.headers.transform_keys(&:downcase)["content-type"]) + assert_nil(_1.headers.transform_keys(&:downcase)["content-type"]) 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 ea55519..e8f75c6 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -18,7 +18,8 @@ def test_create_required_params assert_pattern do response => { - public_id: String | nil + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketCreateResponse::Attachment]), + public_id: String } end end @@ -92,7 +93,8 @@ def test_reply_required_params assert_pattern do response => { - public_id: String | nil + attachments: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketReplyResponse::Attachment]), + public_id: String } 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 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 diff --git a/x_twitter_scraper.gemspec b/x_twitter_scraper.gemspec index cf29367..683dbc6 100644 --- a/x_twitter_scraper.gemspec +++ b/x_twitter_scraper.gemspec @@ -5,18 +5,14 @@ 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 SDK for the Xquik API" s.authors = ["Xquik"] s.email = "support@xquik.com" - s.licenses = ["Apache-2.0"] + s.license = "Apache-2.0" s.homepage = "https://docs.xquik.com/sdks/ruby" 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["rubygems_mfa_required"] = false.to_s s.required_ruby_version = ">= 3.2.0" s.files = Dir[ @@ -30,7 +26,7 @@ Gem::Specification.new do |s| ".ignore" ] s.extra_rdoc_files = ["README.md"] - s.add_dependency "base64", "~> 0.3" - s.add_dependency "cgi", "~> 0.5" - s.add_dependency "connection_pool", ">= 2.5", "< 4.0" + s.add_dependency "base64" + s.add_dependency "cgi" + s.add_dependency "connection_pool" end