Class: Onlyfans::Resources::Settings
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Settings
- Defined in:
- lib/onlyfans/resources/settings.rb,
lib/onlyfans/resources/settings/welcome_message.rb,
lib/onlyfans/resources/settings/blocked_countries.rb,
lib/onlyfans/resources/settings/social_media_buttons.rb
Defined Under Namespace
Classes: BlockedCountries, SocialMediaButtons, WelcomeMessage
Instance Attribute Summary collapse
- #blocked_countries ⇒ Onlyfans::Resources::Settings::BlockedCountries readonly
- #social_media_buttons ⇒ Onlyfans::Resources::Settings::SocialMediaButtons readonly
- #welcome_message ⇒ Onlyfans::Resources::Settings::WelcomeMessage readonly
Instance Method Summary collapse
-
#check_username_availability(account, username:, request_options: {}) ⇒ Onlyfans::Models::SettingCheckUsernameAvailabilityResponse
Check if a username is taken.
-
#initialize(client:) ⇒ Settings
constructor
private
A new instance of Settings.
-
#retrieve(account, request_options: {}) ⇒ Onlyfans::Models::SettingRetrieveResponse
Returns the account settings.
-
#update_profile(account, about: nil, avatar: nil, header: nil, location: nil, name: nil, username: nil, website: nil, wishlist: nil, request_options: {}) ⇒ Onlyfans::Models::SettingUpdateProfileResponse
Some parameter documentations has been truncated, see Models::SettingUpdateProfileParams for more details.
-
#update_subscription_price(account, price:, request_options: {}) ⇒ Onlyfans::Models::SettingUpdateSubscriptionPriceResponse
Some parameter documentations has been truncated, see Models::SettingUpdateSubscriptionPriceParams for more details.
Constructor Details
#initialize(client:) ⇒ Settings
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 Settings.
134 135 136 137 138 139 |
# File 'lib/onlyfans/resources/settings.rb', line 134 def initialize(client:) @client = client @blocked_countries = Onlyfans::Resources::Settings::BlockedCountries.new(client: client) @welcome_message = Onlyfans::Resources::Settings::WelcomeMessage.new(client: client) @social_media_buttons = Onlyfans::Resources::Settings::SocialMediaButtons.new(client: client) end |
Instance Attribute Details
#blocked_countries ⇒ Onlyfans::Resources::Settings::BlockedCountries (readonly)
7 8 9 |
# File 'lib/onlyfans/resources/settings.rb', line 7 def blocked_countries @blocked_countries end |
#social_media_buttons ⇒ Onlyfans::Resources::Settings::SocialMediaButtons (readonly)
13 14 15 |
# File 'lib/onlyfans/resources/settings.rb', line 13 def @social_media_buttons end |
#welcome_message ⇒ Onlyfans::Resources::Settings::WelcomeMessage (readonly)
10 11 12 |
# File 'lib/onlyfans/resources/settings.rb', line 10 def @welcome_message end |
Instance Method Details
#check_username_availability(account, username:, request_options: {}) ⇒ Onlyfans::Models::SettingCheckUsernameAvailabilityResponse
Check if a username is taken. Returns ‘false` if the username is available, `true` if it is already taken.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/onlyfans/resources/settings.rb', line 49 def check_username_availability(account, params) parsed, = Onlyfans::SettingCheckUsernameAvailabilityParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/settings/username-exists", account], body: parsed, model: Onlyfans::Models::SettingCheckUsernameAvailabilityResponse, options: ) end |
#retrieve(account, request_options: {}) ⇒ Onlyfans::Models::SettingRetrieveResponse
Returns the account settings
26 27 28 29 30 31 32 33 |
# File 'lib/onlyfans/resources/settings.rb', line 26 def retrieve(account, params = {}) @client.request( method: :get, path: ["api/%1$s/settings", account], model: Onlyfans::Models::SettingRetrieveResponse, options: params[:request_options] ) end |
#update_profile(account, about: nil, avatar: nil, header: nil, location: nil, name: nil, username: nil, website: nil, wishlist: nil, request_options: {}) ⇒ Onlyfans::Models::SettingUpdateProfileResponse
Some parameter documentations has been truncated, see Models::SettingUpdateProfileParams for more details.
Updates the account profile. **Only include the fields you want to update.** To make a field empty, set it to ‘null`.
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/onlyfans/resources/settings.rb', line 91 def update_profile(account, params = {}) parsed, = Onlyfans::SettingUpdateProfileParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/settings/profile", account], body: parsed, model: Onlyfans::Models::SettingUpdateProfileResponse, options: ) end |
#update_subscription_price(account, price:, request_options: {}) ⇒ Onlyfans::Models::SettingUpdateSubscriptionPriceResponse
Some parameter documentations has been truncated, see Models::SettingUpdateSubscriptionPriceParams for more details.
Update the account subscription price. Send ‘0` or `“free”` to make the account free. ⚠️ WARNING! OnlyFans limits updating the subscription price to max. 3 times per day.
120 121 122 123 124 125 126 127 128 129 |
# File 'lib/onlyfans/resources/settings.rb', line 120 def update_subscription_price(account, params) parsed, = Onlyfans::SettingUpdateSubscriptionPriceParams.dump_request(params) @client.request( method: :patch, path: ["api/%1$s/settings/subscription-price", account], body: parsed, model: Onlyfans::Models::SettingUpdateSubscriptionPriceResponse, options: ) end |