Class: Onlyfans::Resources::Users::Subscribe
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Users::Subscribe
- Defined in:
- lib/onlyfans/resources/users/subscribe.rb
Overview
APIs for fetching OnlyFans users
Instance Method Summary collapse
-
#create(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::SubscribeCreateResponse
Subscribe to a user’s profile.
-
#delete(user_id, account:, reason:, request_options: {}) ⇒ Onlyfans::Models::Users::SubscribeDeleteResponse
Some parameter documentations has been truncated, see Models::Users::SubscribeDeleteParams for more details.
-
#initialize(client:) ⇒ Subscribe
constructor
private
A new instance of Subscribe.
Constructor Details
#initialize(client:) ⇒ Subscribe
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 Subscribe.
71 72 73 |
# File 'lib/onlyfans/resources/users/subscribe.rb', line 71 def initialize(client:) @client = client end |
Instance Method Details
#create(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::Users::SubscribeCreateResponse
Subscribe to a user’s profile.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/onlyfans/resources/users/subscribe.rb', line 21 def create(user_id, params) parsed, = Onlyfans::Users::SubscribeCreateParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["api/%1$s/users/%2$s/subscribe", account, user_id], model: Onlyfans::Models::Users::SubscribeCreateResponse, options: ) end |
#delete(user_id, account:, reason:, request_options: {}) ⇒ Onlyfans::Models::Users::SubscribeDeleteResponse
Some parameter documentations has been truncated, see Models::Users::SubscribeDeleteParams for more details.
Unsubscribe from a user’s profile.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/onlyfans/resources/users/subscribe.rb', line 53 def delete(user_id, params) parsed, = Onlyfans::Users::SubscribeDeleteParams.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/users/%2$s/subscribe", account, user_id], body: parsed, model: Onlyfans::Models::Users::SubscribeDeleteResponse, options: ) end |