Class: XTwitterScraper::Resources::Account
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Account
- Defined in:
- lib/x_twitter_scraper/resources/account.rb,
sig/x_twitter_scraper/resources/account.rbs
Overview
Account info and 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.
75 76 77 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 75 def initialize(client:) @client = client end |
Instance Method Details
#retrieve(request_options: {}) ⇒ XTwitterScraper::Models::AccountRetrieveResponse
Get account info
20 21 22 23 24 25 26 27 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 20 def retrieve(params = {}) @client.request( method: :get, path: "account", model: XTwitterScraper::Models::AccountRetrieveResponse, options: params[:request_options] ) end |
#set_x_username(username:, request_options: {}) ⇒ XTwitterScraper::Models::AccountSetXUsernameResponse
Set linked X username
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 40 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
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/x_twitter_scraper/resources/account.rb', line 61 def update_locale(params) parsed, = XTwitterScraper::AccountUpdateLocaleParams.dump_request(params) @client.request( method: :patch, path: "account", body: parsed, model: XTwitterScraper::Models::AccountUpdateLocaleResponse, options: ) end |