Class: Onlyfans::Resources::Settings::SocialMediaButtons
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Settings::SocialMediaButtons
- Defined in:
- lib/onlyfans/resources/settings/social_media_buttons.rb
Instance Method Summary collapse
-
#add(account, label:, type:, value:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonAddResponse
Adds a new social media button to the account.
-
#delete(button_id, account:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonDeleteResponse
Deletes a social media button from the account.
-
#initialize(client:) ⇒ SocialMediaButtons
constructor
private
A new instance of SocialMediaButtons.
-
#list(account, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonListResponse
Returns the list of social media buttons for the account.
-
#reorder(account, button_ids:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonReorderResponse
Changes the order of social media buttons for the account.
-
#update(button_id, account:, label:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonUpdateResponse
Updates a social media button from the account.
Constructor Details
#initialize(client:) ⇒ SocialMediaButtons
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 SocialMediaButtons.
139 140 141 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 139 def initialize(client:) @client = client end |
Instance Method Details
#add(account, label:, type:, value:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonAddResponse
Adds a new social media button to the account
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 101 def add(account, params) parsed, = Onlyfans::Settings::SocialMediaButtonAddParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/settings/social-media-buttons", account], body: parsed, model: Onlyfans::Models::Settings::SocialMediaButtonAddResponse, options: ) end |
#delete(button_id, account:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonDeleteResponse
Deletes a social media button from the account
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 70 def delete(, params) parsed, = Onlyfans::Settings::SocialMediaButtonDeleteParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/%1$s/settings/social-media-buttons/%2$s", account, ], model: Onlyfans::Models::Settings::SocialMediaButtonDeleteResponse, options: ) end |
#list(account, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonListResponse
Returns the list of social media buttons for the account
48 49 50 51 52 53 54 55 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 48 def list(account, params = {}) @client.request( method: :get, path: ["api/%1$s/settings/social-media-buttons", account], model: Onlyfans::Models::Settings::SocialMediaButtonListResponse, options: params[:request_options] ) end |
#reorder(account, button_ids:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonReorderResponse
Changes the order of social media buttons for the account
125 126 127 128 129 130 131 132 133 134 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 125 def reorder(account, params) parsed, = Onlyfans::Settings::SocialMediaButtonReorderParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/settings/social-media-buttons/reorder", account], body: parsed, model: Onlyfans::Models::Settings::SocialMediaButtonReorderResponse, options: ) end |
#update(button_id, account:, label:, request_options: {}) ⇒ Onlyfans::Models::Settings::SocialMediaButtonUpdateResponse
Updates a social media button from the account
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/onlyfans/resources/settings/social_media_buttons.rb', line 22 def update(, params) parsed, = Onlyfans::Settings::SocialMediaButtonUpdateParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["api/%1$s/settings/social-media-buttons/%2$s", account, ], body: parsed, model: Onlyfans::Models::Settings::SocialMediaButtonUpdateResponse, options: ) end |