Class: XTwitterScraper::Resources::Account
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Account
- Defined in:
- lib/x_twitter_scraper/resources/account.rb
Overview
Account info & settings
Instance Method Summary collapse
-
#initialize(client:) ⇒ Account
constructor
private
A new instance of Account.
-
#retrieve(request_options: {}) ⇒ XTwitterScraper::Models::AccountRetrieveResponse
Get account info.
-
#set_x_username(username:, request_options: {}) ⇒ XTwitterScraper::Models::AccountSetXUsernameResponse
Set linked X username.
-
#update_locale(locale:, request_options: {}) ⇒ XTwitterScraper::Models::AccountUpdateLocaleResponse
Update account locale.
Constructor Details
#initialize(client:) ⇒ Account
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Account.
73 74 75 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 73 def initialize(client:) @client = client end |
Instance Method Details
#retrieve(request_options: {}) ⇒ XTwitterScraper::Models::AccountRetrieveResponse
Get account info
16 17 18 19 20 21 22 23 24 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 16 def retrieve(params = {}) @client.request( method: :get, path: "account", model: XTwitterScraper::Models::AccountRetrieveResponse, security: {auth_api_key: true}, options: params[:request_options] ) end |
#set_x_username(username:, request_options: {}) ⇒ XTwitterScraper::Models::AccountSetXUsernameResponse
Set linked X username
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 37 def set_x_username(params) parsed, = XTwitterScraper::AccountSetXUsernameParams.dump_request(params) @client.request( method: :put, path: "account/x-identity", body: parsed, model: XTwitterScraper::Models::AccountSetXUsernameResponse, options: ) end |
#update_locale(locale:, request_options: {}) ⇒ XTwitterScraper::Models::AccountUpdateLocaleResponse
Update account locale
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 58 def update_locale(params) parsed, = XTwitterScraper::AccountUpdateLocaleParams.dump_request(params) @client.request( method: :patch, path: "account", body: parsed, model: XTwitterScraper::Models::AccountUpdateLocaleResponse, security: {auth_api_key: true}, options: ) end |