diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f3091..6b7b74c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 58aca93..68ba24f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 115 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-3b2c6c771ad1da0bbfeb0af115972929ed2c7fcd5e47a79556d66cd21431b224.yml -openapi_spec_hash: de2890233b68387bf5f9b6d19e7d87dc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-93bb7d4f1475c8043af464ec88244a034456c549136c8477f284f0a33192e1c9.yml +openapi_spec_hash: 74dca63c872249274ad99b111dea0833 config_hash: 8894c96caeb6df84c9394518810221bd diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b9d65..c7ab913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.3.0 (2026-04-01) + +Full Changelog: [v0.2.0...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.2.0...v0.3.0) + +### Features + +* **api:** api update ([f86e402](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/f86e4024943bd72605879352d377f1a9527ce8c6)) + ## 0.2.0 (2026-04-01) Full Changelog: [v0.1.0...v0.2.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.1.0...v0.2.0) diff --git a/Gemfile.lock b/Gemfile.lock index e025e93..88fc74f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - x-twitter-scraper (0.2.0) + x-twitter-scraper (0.3.0) cgi connection_pool diff --git a/README.md b/README.md index 3a8eafa..ae2dd85 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "x-twitter-scraper", "~> 0.2.0" +gem "x-twitter-scraper", "~> 0.3.0" ``` diff --git a/lib/x_twitter_scraper/models/compose_create_response.rb b/lib/x_twitter_scraper/models/compose_create_response.rb index 80d922d..1375e19 100644 --- a/lib/x_twitter_scraper/models/compose_create_response.rb +++ b/lib/x_twitter_scraper/models/compose_create_response.rb @@ -2,7 +2,40 @@ module XTwitterScraper module Models - # @type [XTwitterScraper::Internal::Type::Converter] - ComposeCreateResponse = XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + # @see XTwitterScraper::Resources::Compose#create + class ComposeCreateResponse < XTwitterScraper::Internal::Type::BaseModel + # @!attribute feedback + # AI feedback on the draft + # + # @return [String, nil] + optional :feedback, String + + # @!attribute score + # Engagement score (0-100) + # + # @return [Float, nil] + optional :score, Float + + # @!attribute suggestions + # Improvement suggestions + # + # @return [Array, nil] + optional :suggestions, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!attribute text + # Generated or refined tweet text + # + # @return [String, nil] + optional :text, String + + # @!method initialize(feedback: nil, score: nil, suggestions: nil, text: nil) + # @param feedback [String] AI feedback on the draft + # + # @param score [Float] Engagement score (0-100) + # + # @param suggestions [Array] Improvement suggestions + # + # @param text [String] Generated or refined tweet text + end end end diff --git a/lib/x_twitter_scraper/models/event_detail.rb b/lib/x_twitter_scraper/models/event_detail.rb index 20ba5c4..299db4c 100644 --- a/lib/x_twitter_scraper/models/event_detail.rb +++ b/lib/x_twitter_scraper/models/event_detail.rb @@ -9,6 +9,7 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute data + # Event payload — shape varies by event type (JSON) # # @return [Hash{Symbol=>Object}] required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -40,11 +41,17 @@ class EventDetail < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:, x_event_id: nil) # @param id [String] - # @param data [Hash{Symbol=>Object}] + # + # @param data [Hash{Symbol=>Object}] Event payload — shape varies by event type (JSON) + # # @param monitor_id [String] + # # @param occurred_at [Time] + # # @param type [Symbol, XTwitterScraper::Models::EventDetail::Type] + # # @param username [String] + # # @param x_event_id [String] # @see XTwitterScraper::Models::EventDetail#type diff --git a/lib/x_twitter_scraper/models/event_retrieve_response.rb b/lib/x_twitter_scraper/models/event_retrieve_response.rb index 99aa59d..09193e0 100644 --- a/lib/x_twitter_scraper/models/event_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/event_retrieve_response.rb @@ -10,6 +10,7 @@ class EventRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute data + # Event payload — shape varies by event type (JSON) # # @return [Hash{Symbol=>Object}] required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -41,11 +42,17 @@ class EventRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, data:, monitor_id:, occurred_at:, type:, username:, x_event_id: nil) # @param id [String] - # @param data [Hash{Symbol=>Object}] + # + # @param data [Hash{Symbol=>Object}] Event payload — shape varies by event type (JSON) + # # @param monitor_id [String] + # # @param occurred_at [Time] + # # @param type [Symbol, XTwitterScraper::Models::EventRetrieveResponse::Type] + # # @param username [String] + # # @param x_event_id [String] # @see XTwitterScraper::Models::EventRetrieveResponse#type diff --git a/lib/x_twitter_scraper/models/extraction_retrieve_response.rb b/lib/x_twitter_scraper/models/extraction_retrieve_response.rb index 3eee018..a5e4454 100644 --- a/lib/x_twitter_scraper/models/extraction_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/extraction_retrieve_response.rb @@ -10,6 +10,7 @@ class ExtractionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel required :has_more, XTwitterScraper::Internal::Type::Boolean, api_name: :hasMore # @!attribute job + # Extraction job metadata — shape varies by tool type (JSON) # # @return [Hash{Symbol=>Object}] required :job, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -27,8 +28,11 @@ class ExtractionRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(has_more:, job:, results:, next_cursor: nil) # @param has_more [Boolean] - # @param job [Hash{Symbol=>Object}] + # + # @param job [Hash{Symbol=>Object}] Extraction job metadata — shape varies by tool type (JSON) + # # @param results [ArrayObject}>] + # # @param next_cursor [String] end end diff --git a/lib/x_twitter_scraper/models/integration.rb b/lib/x_twitter_scraper/models/integration.rb index 7bb80f1..ab6ff49 100644 --- a/lib/x_twitter_scraper/models/integration.rb +++ b/lib/x_twitter_scraper/models/integration.rb @@ -9,6 +9,7 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute config + # Integration config — shape varies by type (JSON) # # @return [Hash{Symbol=>Object}] required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -41,6 +42,7 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel required :type, enum: -> { XTwitterScraper::Integration::Type } # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -62,15 +64,25 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) # @param id [String] - # @param config [Hash{Symbol=>Object}] + # + # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) + # # @param created_at [Time] + # # @param event_types [Array] + # # @param is_active [Boolean] + # # @param name [String] + # # @param type [Symbol, XTwitterScraper::Models::Integration::Type] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param message_template [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] module EventType diff --git a/lib/x_twitter_scraper/models/integration_create_response.rb b/lib/x_twitter_scraper/models/integration_create_response.rb index a4f2ba0..163ca88 100644 --- a/lib/x_twitter_scraper/models/integration_create_response.rb +++ b/lib/x_twitter_scraper/models/integration_create_response.rb @@ -10,6 +10,7 @@ class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute config + # Integration config — shape varies by type (JSON) # # @return [Hash{Symbol=>Object}] required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -42,6 +43,7 @@ class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel required :type, enum: -> { XTwitterScraper::Models::IntegrationCreateResponse::Type } # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -63,15 +65,25 @@ class IntegrationCreateResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) # @param id [String] - # @param config [Hash{Symbol=>Object}] + # + # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) + # # @param created_at [Time] + # # @param event_types [Array] + # # @param is_active [Boolean] + # # @param name [String] + # # @param type [Symbol, XTwitterScraper::Models::IntegrationCreateResponse::Type] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param message_template [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] module EventType diff --git a/lib/x_twitter_scraper/models/integration_list_response.rb b/lib/x_twitter_scraper/models/integration_list_response.rb index d1a4a00..1c79c68 100644 --- a/lib/x_twitter_scraper/models/integration_list_response.rb +++ b/lib/x_twitter_scraper/models/integration_list_response.rb @@ -20,6 +20,7 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute config + # Integration config — shape varies by type (JSON) # # @return [Hash{Symbol=>Object}] required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -52,6 +53,7 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel required :type, enum: -> { XTwitterScraper::Models::IntegrationListResponse::Integration::Type } # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -73,15 +75,25 @@ class Integration < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) # @param id [String] - # @param config [Hash{Symbol=>Object}] + # + # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) + # # @param created_at [Time] + # # @param event_types [Array] + # # @param is_active [Boolean] + # # @param name [String] + # # @param type [Symbol, XTwitterScraper::Models::IntegrationListResponse::Integration::Type] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param message_template [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] module EventType diff --git a/lib/x_twitter_scraper/models/integration_retrieve_response.rb b/lib/x_twitter_scraper/models/integration_retrieve_response.rb index 0cce3c2..25ef1dc 100644 --- a/lib/x_twitter_scraper/models/integration_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/integration_retrieve_response.rb @@ -10,6 +10,7 @@ class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute config + # Integration config — shape varies by type (JSON) # # @return [Hash{Symbol=>Object}] required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -42,6 +43,7 @@ class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel required :type, enum: -> { XTwitterScraper::Models::IntegrationRetrieveResponse::Type } # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -63,15 +65,25 @@ class IntegrationRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) # @param id [String] - # @param config [Hash{Symbol=>Object}] + # + # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) + # # @param created_at [Time] + # # @param event_types [Array] + # # @param is_active [Boolean] + # # @param name [String] + # # @param type [Symbol, XTwitterScraper::Models::IntegrationRetrieveResponse::Type] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param message_template [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] module EventType diff --git a/lib/x_twitter_scraper/models/integration_update_params.rb b/lib/x_twitter_scraper/models/integration_update_params.rb index a20dbee..736a455 100644 --- a/lib/x_twitter_scraper/models/integration_update_params.rb +++ b/lib/x_twitter_scraper/models/integration_update_params.rb @@ -22,6 +22,7 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel api_name: :eventTypes # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -32,6 +33,7 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel optional :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive # @!attribute message_template + # Custom message template (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :message_template, @@ -55,13 +57,21 @@ class IntegrationUpdateParams < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, event_types: nil, filters: nil, is_active: nil, message_template: nil, name: nil, scope_all_monitors: nil, silent_push: nil, request_options: {}) # @param id [String] + # # @param event_types [Array] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param is_active [Boolean] - # @param message_template [Hash{Symbol=>Object}] + # + # @param message_template [Hash{Symbol=>Object}] Custom message template (JSON) + # # @param name [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] module EventType diff --git a/lib/x_twitter_scraper/models/integration_update_response.rb b/lib/x_twitter_scraper/models/integration_update_response.rb index e8017ea..e8a2723 100644 --- a/lib/x_twitter_scraper/models/integration_update_response.rb +++ b/lib/x_twitter_scraper/models/integration_update_response.rb @@ -10,6 +10,7 @@ class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel required :id, String # @!attribute config + # Integration config — shape varies by type (JSON) # # @return [Hash{Symbol=>Object}] required :config, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -42,6 +43,7 @@ class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel required :type, enum: -> { XTwitterScraper::Models::IntegrationUpdateResponse::Type } # @!attribute filters + # Event filter rules (JSON) # # @return [Hash{Symbol=>Object}, nil] optional :filters, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] @@ -63,15 +65,25 @@ class IntegrationUpdateResponse < XTwitterScraper::Internal::Type::BaseModel # @!method initialize(id:, config:, created_at:, event_types:, is_active:, name:, type:, filters: nil, message_template: nil, scope_all_monitors: nil, silent_push: nil) # @param id [String] - # @param config [Hash{Symbol=>Object}] + # + # @param config [Hash{Symbol=>Object}] Integration config — shape varies by type (JSON) + # # @param created_at [Time] + # # @param event_types [Array] + # # @param is_active [Boolean] + # # @param name [String] + # # @param type [Symbol, XTwitterScraper::Models::IntegrationUpdateResponse::Type] - # @param filters [Hash{Symbol=>Object}] + # + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) + # # @param message_template [String] + # # @param scope_all_monitors [Boolean] + # # @param silent_push [Boolean] module EventType diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb index 0ffbf17..7da5eac 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb @@ -8,11 +8,140 @@ class CommunityRetrieveInfoResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute community # Community info object # - # @return [Object] - required :community, XTwitterScraper::Internal::Type::Unknown + # @return [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community] + required :community, -> { XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community } # @!method initialize(community:) - # @param community [Object] Community info object + # @param community [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community] Community info object + + # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse#community + class Community < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # Community ID + # + # @return [String] + required :id, String + + # @!attribute banner_url + # Community banner image URL + # + # @return [String, nil] + optional :banner_url, String + + # @!attribute created_at + # Community creation timestamp + # + # @return [String, nil] + optional :created_at, String + + # @!attribute description + # Community description + # + # @return [String, nil] + optional :description, String + + # @!attribute join_policy + # Join policy (open or restricted) + # + # @return [String, nil] + optional :join_policy, String + + # @!attribute member_count + # Total member count + # + # @return [Integer, nil] + optional :member_count, Integer + + # @!attribute moderator_count + # Total moderator count + # + # @return [Integer, nil] + optional :moderator_count, Integer + + # @!attribute name + # Community name + # + # @return [String, nil] + optional :name, String + + # @!attribute primary_topic + # Primary topic + # + # @return [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, nil] + optional :primary_topic, + -> { XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic } + + # @!attribute rules + # Community rules + # + # @return [Array, nil] + optional :rules, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } + + # @!method initialize(id:, banner_url: nil, created_at: nil, description: nil, join_policy: nil, member_count: nil, moderator_count: nil, name: nil, primary_topic: nil, rules: nil) + # Community info object + # + # @param id [String] Community ID + # + # @param banner_url [String] Community banner image URL + # + # @param created_at [String] Community creation timestamp + # + # @param description [String] Community description + # + # @param join_policy [String] Join policy (open or restricted) + # + # @param member_count [Integer] Total member count + # + # @param moderator_count [Integer] Total moderator count + # + # @param name [String] Community name + # + # @param primary_topic [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic] Primary topic + # + # @param rules [Array] Community rules + + # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community#primary_topic + class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(id: nil, name: nil) + # Primary topic + # + # @param id [String] + # @param name [String] + end + + class Rule < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(id: nil, description: nil, name: nil) + # @param id [String] + # @param description [String] + # @param name [String] + end + end end end end diff --git a/lib/x_twitter_scraper/resources/account.rb b/lib/x_twitter_scraper/resources/account.rb index 1f3f6ff..aec9f9a 100644 --- a/lib/x_twitter_scraper/resources/account.rb +++ b/lib/x_twitter_scraper/resources/account.rb @@ -62,7 +62,7 @@ def update_locale(params) path: "account", body: parsed, model: XTwitterScraper::Models::AccountUpdateLocaleResponse, - security: {}, + security: {auth_api_key: true}, options: options ) end diff --git a/lib/x_twitter_scraper/resources/api_keys.rb b/lib/x_twitter_scraper/resources/api_keys.rb index 57d6146..e2e4882 100644 --- a/lib/x_twitter_scraper/resources/api_keys.rb +++ b/lib/x_twitter_scraper/resources/api_keys.rb @@ -21,7 +21,7 @@ def create(params = {}) path: "api-keys", body: parsed, model: XTwitterScraper::Models::APIKeyCreateResponse, - security: {}, + security: {auth_api_key: true}, options: options ) end @@ -40,7 +40,7 @@ def list(params = {}) method: :get, path: "api-keys", model: XTwitterScraper::Models::APIKeyListResponse, - security: {}, + security: {auth_api_key: true}, options: params[:request_options] ) end @@ -61,7 +61,7 @@ def revoke(id, params = {}) method: :delete, path: ["api-keys/%1$s", id], model: XTwitterScraper::Models::APIKeyRevokeResponse, - security: {}, + security: {auth_api_key: true}, options: params[:request_options] ) end diff --git a/lib/x_twitter_scraper/resources/compose.rb b/lib/x_twitter_scraper/resources/compose.rb index 28bde6e..efaeace 100644 --- a/lib/x_twitter_scraper/resources/compose.rb +++ b/lib/x_twitter_scraper/resources/compose.rb @@ -32,7 +32,7 @@ class Compose # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Hash{Symbol=>Object}] + # @return [XTwitterScraper::Models::ComposeCreateResponse] # # @see XTwitterScraper::Models::ComposeCreateParams def create(params) @@ -41,7 +41,7 @@ def create(params) method: :post, path: "compose", body: parsed, - model: XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + model: XTwitterScraper::Models::ComposeCreateResponse, options: options ) end diff --git a/lib/x_twitter_scraper/resources/integrations.rb b/lib/x_twitter_scraper/resources/integrations.rb index d4a17f6..661a62f 100644 --- a/lib/x_twitter_scraper/resources/integrations.rb +++ b/lib/x_twitter_scraper/resources/integrations.rb @@ -60,11 +60,11 @@ def retrieve(id, params = {}) # # @param event_types [Array] # - # @param filters [Hash{Symbol=>Object}] + # @param filters [Hash{Symbol=>Object}] Event filter rules (JSON) # # @param is_active [Boolean] # - # @param message_template [Hash{Symbol=>Object}] + # @param message_template [Hash{Symbol=>Object}] Custom message template (JSON) # # @param name [String] # diff --git a/lib/x_twitter_scraper/resources/x/accounts.rb b/lib/x_twitter_scraper/resources/x/accounts.rb index 808d802..d04a93c 100644 --- a/lib/x_twitter_scraper/resources/x/accounts.rb +++ b/lib/x_twitter_scraper/resources/x/accounts.rb @@ -31,7 +31,7 @@ def create(params) path: "x/accounts", body: parsed, model: XTwitterScraper::Models::X::AccountCreateResponse, - security: {}, + security: {auth_api_key: true}, options: options ) end @@ -52,7 +52,7 @@ def retrieve(id, params = {}) method: :get, path: ["x/accounts/%1$s", id], model: XTwitterScraper::Models::X::AccountRetrieveResponse, - security: {}, + security: {auth_api_key: true}, options: params[:request_options] ) end @@ -71,7 +71,7 @@ def list(params = {}) method: :get, path: "x/accounts", model: XTwitterScraper::Models::X::AccountListResponse, - security: {}, + security: {auth_api_key: true}, options: params[:request_options] ) end @@ -92,7 +92,7 @@ def delete(id, params = {}) method: :delete, path: ["x/accounts/%1$s", id], model: XTwitterScraper::Models::X::AccountDeleteResponse, - security: {}, + security: {auth_api_key: true}, options: params[:request_options] ) end @@ -119,7 +119,7 @@ def reauth(id, params) path: ["x/accounts/%1$s/reauth", id], body: parsed, model: XTwitterScraper::Models::X::AccountReauthResponse, - security: {}, + security: {auth_api_key: true}, options: options ) end diff --git a/lib/x_twitter_scraper/version.rb b/lib/x_twitter_scraper/version.rb index 2d41234..ae36159 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.2.0" + VERSION = "0.3.0" end diff --git a/rbi/x_twitter_scraper/models/compose_create_response.rbi b/rbi/x_twitter_scraper/models/compose_create_response.rbi index d96658d..872268c 100644 --- a/rbi/x_twitter_scraper/models/compose_create_response.rbi +++ b/rbi/x_twitter_scraper/models/compose_create_response.rbi @@ -2,12 +2,75 @@ module XTwitterScraper module Models - ComposeCreateResponse = - T.let( - XTwitterScraper::Internal::Type::HashOf[ - XTwitterScraper::Internal::Type::Unknown - ], - XTwitterScraper::Internal::Type::Converter + class ComposeCreateResponse < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::ComposeCreateResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + # AI feedback on the draft + sig { returns(T.nilable(String)) } + attr_reader :feedback + + sig { params(feedback: String).void } + attr_writer :feedback + + # Engagement score (0-100) + sig { returns(T.nilable(Float)) } + attr_reader :score + + sig { params(score: Float).void } + attr_writer :score + + # Improvement suggestions + sig { returns(T.nilable(T::Array[String])) } + attr_reader :suggestions + + sig { params(suggestions: T::Array[String]).void } + attr_writer :suggestions + + # Generated or refined tweet text + sig { returns(T.nilable(String)) } + attr_reader :text + + sig { params(text: String).void } + attr_writer :text + + sig do + params( + feedback: String, + score: Float, + suggestions: T::Array[String], + text: String + ).returns(T.attached_class) + end + def self.new( + # AI feedback on the draft + feedback: nil, + # Engagement score (0-100) + score: nil, + # Improvement suggestions + suggestions: nil, + # Generated or refined tweet text + text: nil ) + end + + sig do + override.returns( + { + feedback: String, + score: Float, + suggestions: T::Array[String], + text: String + } + ) + end + def to_hash + end + end end end diff --git a/rbi/x_twitter_scraper/models/event_detail.rbi b/rbi/x_twitter_scraper/models/event_detail.rbi index ff72d28..9b52aa0 100644 --- a/rbi/x_twitter_scraper/models/event_detail.rbi +++ b/rbi/x_twitter_scraper/models/event_detail.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Event payload — shape varies by event type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :data @@ -48,6 +49,7 @@ module XTwitterScraper end def self.new( id:, + # Event payload — shape varies by event type (JSON) data:, monitor_id:, occurred_at:, diff --git a/rbi/x_twitter_scraper/models/event_retrieve_response.rbi b/rbi/x_twitter_scraper/models/event_retrieve_response.rbi index 144b0a7..78cf7e8 100644 --- a/rbi/x_twitter_scraper/models/event_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/event_retrieve_response.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Event payload — shape varies by event type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :data @@ -52,6 +53,7 @@ module XTwitterScraper end def self.new( id:, + # Event payload — shape varies by event type (JSON) data:, monitor_id:, occurred_at:, diff --git a/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi b/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi index 768b40d..887ee76 100644 --- a/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/extraction_retrieve_response.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(T::Boolean) } attr_accessor :has_more + # Extraction job metadata — shape varies by tool type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :job @@ -34,7 +35,13 @@ module XTwitterScraper next_cursor: String ).returns(T.attached_class) end - def self.new(has_more:, job:, results:, next_cursor: nil) + def self.new( + has_more:, + # Extraction job metadata — shape varies by tool type (JSON) + job:, + results:, + next_cursor: nil + ) end sig do diff --git a/rbi/x_twitter_scraper/models/integration.rbi b/rbi/x_twitter_scraper/models/integration.rbi index cb16c6e..e5b80cf 100644 --- a/rbi/x_twitter_scraper/models/integration.rbi +++ b/rbi/x_twitter_scraper/models/integration.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Integration config — shape varies by type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :config @@ -34,6 +35,7 @@ module XTwitterScraper sig { returns(XTwitterScraper::Integration::Type::OrSymbol) } attr_accessor :type + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -76,12 +78,14 @@ module XTwitterScraper end def self.new( id:, + # Integration config — shape varies by type (JSON) config:, created_at:, event_types:, is_active:, name:, type:, + # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/integration_create_response.rbi b/rbi/x_twitter_scraper/models/integration_create_response.rbi index b62e205..6a04a6e 100644 --- a/rbi/x_twitter_scraper/models/integration_create_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_create_response.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Integration config — shape varies by type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :config @@ -42,6 +43,7 @@ module XTwitterScraper end attr_accessor :type + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -87,12 +89,14 @@ module XTwitterScraper end def self.new( id:, + # Integration config — shape varies by type (JSON) config:, created_at:, event_types:, is_active:, name:, type:, + # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/integration_list_response.rbi b/rbi/x_twitter_scraper/models/integration_list_response.rbi index dfcade9..9ccccf0 100644 --- a/rbi/x_twitter_scraper/models/integration_list_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_list_response.rbi @@ -56,6 +56,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Integration config — shape varies by type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :config @@ -84,6 +85,7 @@ module XTwitterScraper end attr_accessor :type + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -129,12 +131,14 @@ module XTwitterScraper end def self.new( id:, + # Integration config — shape varies by type (JSON) config:, created_at:, event_types:, is_active:, name:, type:, + # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi b/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi index ce0f0e3..7ea765d 100644 --- a/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_retrieve_response.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Integration config — shape varies by type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :config @@ -42,6 +43,7 @@ module XTwitterScraper end attr_accessor :type + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -87,12 +89,14 @@ module XTwitterScraper end def self.new( id:, + # Integration config — shape varies by type (JSON) config:, created_at:, event_types:, is_active:, name:, type:, + # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/integration_update_params.rbi b/rbi/x_twitter_scraper/models/integration_update_params.rbi index 40c78d4..f90d545 100644 --- a/rbi/x_twitter_scraper/models/integration_update_params.rbi +++ b/rbi/x_twitter_scraper/models/integration_update_params.rbi @@ -38,6 +38,7 @@ module XTwitterScraper end attr_writer :event_types + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -50,6 +51,7 @@ module XTwitterScraper sig { params(is_active: T::Boolean).void } attr_writer :is_active + # Custom message template (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :message_template @@ -93,8 +95,10 @@ module XTwitterScraper def self.new( id:, event_types: nil, + # Event filter rules (JSON) filters: nil, is_active: nil, + # Custom message template (JSON) message_template: nil, name: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/integration_update_response.rbi b/rbi/x_twitter_scraper/models/integration_update_response.rbi index 2e43097..7daa736 100644 --- a/rbi/x_twitter_scraper/models/integration_update_response.rbi +++ b/rbi/x_twitter_scraper/models/integration_update_response.rbi @@ -14,6 +14,7 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Integration config — shape varies by type (JSON) sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :config @@ -42,6 +43,7 @@ module XTwitterScraper end attr_accessor :type + # Event filter rules (JSON) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :filters @@ -87,12 +89,14 @@ module XTwitterScraper end def self.new( id:, + # Integration config — shape varies by type (JSON) config:, created_at:, event_types:, is_active:, name:, type:, + # Event filter rules (JSON) filters: nil, message_template: nil, scope_all_monitors: nil, diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi index 37f12f1..7a520e2 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi @@ -13,19 +13,287 @@ module XTwitterScraper end # Community info object - sig { returns(T.anything) } - attr_accessor :community + sig do + returns( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community + ) + end + attr_reader :community + + sig do + params( + community: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::OrHash + ).void + end + attr_writer :community - sig { params(community: T.anything).returns(T.attached_class) } + sig do + params( + community: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::OrHash + ).returns(T.attached_class) + end def self.new( # Community info object community: ) end - sig { override.returns({ community: T.anything }) } + sig do + override.returns( + { + community: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community + } + ) + end def to_hash end + + class Community < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community, + XTwitterScraper::Internal::AnyHash + ) + end + + # Community ID + sig { returns(String) } + attr_accessor :id + + # Community banner image URL + sig { returns(T.nilable(String)) } + attr_reader :banner_url + + sig { params(banner_url: String).void } + attr_writer :banner_url + + # Community creation timestamp + sig { returns(T.nilable(String)) } + attr_reader :created_at + + sig { params(created_at: String).void } + attr_writer :created_at + + # Community description + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # Join policy (open or restricted) + sig { returns(T.nilable(String)) } + attr_reader :join_policy + + sig { params(join_policy: String).void } + attr_writer :join_policy + + # Total member count + sig { returns(T.nilable(Integer)) } + attr_reader :member_count + + sig { params(member_count: Integer).void } + attr_writer :member_count + + # Total moderator count + sig { returns(T.nilable(Integer)) } + attr_reader :moderator_count + + sig { params(moderator_count: Integer).void } + attr_writer :moderator_count + + # Community name + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Primary topic + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic + ) + ) + end + attr_reader :primary_topic + + sig do + params( + primary_topic: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic::OrHash + ).void + end + attr_writer :primary_topic + + # Community rules + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule + ] + ) + ) + end + attr_reader :rules + + sig do + params( + rules: + T::Array[ + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule::OrHash + ] + ).void + end + attr_writer :rules + + # Community info object + sig do + params( + id: String, + banner_url: String, + created_at: String, + description: String, + join_policy: String, + member_count: Integer, + moderator_count: Integer, + name: String, + primary_topic: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic::OrHash, + rules: + T::Array[ + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Community ID + id:, + # Community banner image URL + banner_url: nil, + # Community creation timestamp + created_at: nil, + # Community description + description: nil, + # Join policy (open or restricted) + join_policy: nil, + # Total member count + member_count: nil, + # Total moderator count + moderator_count: nil, + # Community name + name: nil, + # Primary topic + primary_topic: nil, + # Community rules + rules: nil + ) + end + + sig do + override.returns( + { + id: String, + banner_url: String, + created_at: String, + description: String, + join_policy: String, + member_count: Integer, + moderator_count: Integer, + name: String, + primary_topic: + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + rules: + T::Array[ + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule + ] + } + ) + end + def to_hash + end + + class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + 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 :name + + sig { params(name: String).void } + attr_writer :name + + # Primary topic + sig { params(id: String, name: String).returns(T.attached_class) } + def self.new(id: nil, name: nil) + end + + sig { override.returns({ id: String, name: String }) } + def to_hash + end + end + + class Rule < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule, + 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 :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params(id: String, description: String, name: String).returns( + T.attached_class + ) + end + def self.new(id: nil, description: nil, name: nil) + end + + sig do + override.returns( + { id: String, description: String, name: String } + ) + end + def to_hash + end + end + end end end end diff --git a/rbi/x_twitter_scraper/resources/compose.rbi b/rbi/x_twitter_scraper/resources/compose.rbi index 36a0a14..a2e018b 100644 --- a/rbi/x_twitter_scraper/resources/compose.rbi +++ b/rbi/x_twitter_scraper/resources/compose.rbi @@ -19,7 +19,7 @@ module XTwitterScraper tone: String, topic: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T::Hash[Symbol, T.anything]) + ).returns(XTwitterScraper::Models::ComposeCreateResponse) end def create( # Workflow step diff --git a/rbi/x_twitter_scraper/resources/integrations.rbi b/rbi/x_twitter_scraper/resources/integrations.rbi index 326cae7..d655b4c 100644 --- a/rbi/x_twitter_scraper/resources/integrations.rbi +++ b/rbi/x_twitter_scraper/resources/integrations.rbi @@ -62,8 +62,10 @@ module XTwitterScraper # Resource ID (stringified bigint) id, event_types: nil, + # Event filter rules (JSON) filters: nil, is_active: nil, + # Custom message template (JSON) message_template: nil, name: nil, scope_all_monitors: nil, diff --git a/sig/x_twitter_scraper/models/compose_create_response.rbs b/sig/x_twitter_scraper/models/compose_create_response.rbs index 69c9eb5..88cfe8f 100644 --- a/sig/x_twitter_scraper/models/compose_create_response.rbs +++ b/sig/x_twitter_scraper/models/compose_create_response.rbs @@ -1,7 +1,43 @@ module XTwitterScraper module Models - type compose_create_response = ::Hash[Symbol, top] + type compose_create_response = + { + feedback: String, + score: Float, + suggestions: ::Array[String], + text: String + } - ComposeCreateResponse: XTwitterScraper::Internal::Type::Converter + class ComposeCreateResponse < XTwitterScraper::Internal::Type::BaseModel + attr_reader feedback: String? + + def feedback=: (String) -> String + + attr_reader score: Float? + + def score=: (Float) -> Float + + attr_reader suggestions: ::Array[String]? + + def suggestions=: (::Array[String]) -> ::Array[String] + + attr_reader text: String? + + def text=: (String) -> String + + def initialize: ( + ?feedback: String, + ?score: Float, + ?suggestions: ::Array[String], + ?text: String + ) -> void + + def to_hash: -> { + feedback: String, + score: Float, + suggestions: ::Array[String], + text: String + } + end end end diff --git a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs index b6c8a04..9ca0665 100644 --- a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +++ b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs @@ -1,14 +1,145 @@ module XTwitterScraper module Models module X - type community_retrieve_info_response = { community: top } + type community_retrieve_info_response = + { + community: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community + } class CommunityRetrieveInfoResponse < XTwitterScraper::Internal::Type::BaseModel - attr_accessor community: top + attr_accessor community: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community - def initialize: (community: top) -> void + def initialize: ( + community: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community + ) -> void - def to_hash: -> { community: top } + def to_hash: -> { + community: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community + } + + type community = + { + id: String, + banner_url: String, + created_at: String, + description: String, + join_policy: String, + member_count: Integer, + moderator_count: Integer, + name: String, + primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] + } + + class Community < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader banner_url: String? + + def banner_url=: (String) -> String + + attr_reader created_at: String? + + def created_at=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader join_policy: String? + + def join_policy=: (String) -> String + + attr_reader member_count: Integer? + + def member_count=: (Integer) -> Integer + + attr_reader moderator_count: Integer? + + def moderator_count=: (Integer) -> Integer + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic? + + def primary_topic=: ( + XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic + ) -> XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic + + attr_reader rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]? + + def rules=: ( + ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] + ) -> ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] + + def initialize: ( + id: String, + ?banner_url: String, + ?created_at: String, + ?description: String, + ?join_policy: String, + ?member_count: Integer, + ?moderator_count: Integer, + ?name: String, + ?primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + ?rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] + ) -> void + + def to_hash: -> { + id: String, + banner_url: String, + created_at: String, + description: String, + join_policy: String, + member_count: Integer, + moderator_count: Integer, + name: String, + primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, + rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] + } + + type primary_topic = { id: String, name: String } + + class PrimaryTopic < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?id: String, ?name: String) -> void + + def to_hash: -> { id: String, name: String } + end + + type rule = { id: String, description: String, name: String } + + class Rule < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + ?id: String, + ?description: String, + ?name: String + ) -> void + + def to_hash: -> { id: String, description: String, name: String } + end + end end end end diff --git a/sig/x_twitter_scraper/resources/compose.rbs b/sig/x_twitter_scraper/resources/compose.rbs index eb0be7b..c582ab6 100644 --- a/sig/x_twitter_scraper/resources/compose.rbs +++ b/sig/x_twitter_scraper/resources/compose.rbs @@ -14,7 +14,7 @@ module XTwitterScraper ?tone: String, ?topic: String, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::Models::compose_create_response + ) -> XTwitterScraper::Models::ComposeCreateResponse def initialize: (client: XTwitterScraper::Client) -> void end diff --git a/test/x_twitter_scraper/resources/compose_test.rb b/test/x_twitter_scraper/resources/compose_test.rb index 0469b23..4952608 100644 --- a/test/x_twitter_scraper/resources/compose_test.rb +++ b/test/x_twitter_scraper/resources/compose_test.rb @@ -9,7 +9,16 @@ def test_create_required_params response = @x_twitter_scraper.compose.create(step: :compose) assert_pattern do - response => ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) + response => XTwitterScraper::Models::ComposeCreateResponse + end + + assert_pattern do + response => { + feedback: String | nil, + score: Float | nil, + suggestions: ^(XTwitterScraper::Internal::Type::ArrayOf[String]) | nil, + text: String | nil + } end end end diff --git a/test/x_twitter_scraper/resources/x/communities_test.rb b/test/x_twitter_scraper/resources/x/communities_test.rb index 69b9a95..db23902 100644 --- a/test/x_twitter_scraper/resources/x/communities_test.rb +++ b/test/x_twitter_scraper/resources/x/communities_test.rb @@ -49,7 +49,7 @@ def test_retrieve_info assert_pattern do response => { - community: XTwitterScraper::Internal::Type::Unknown + community: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community } end end