Class: Onlyfans::Resources::Posts::Labels
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Posts::Labels
- Defined in:
- lib/onlyfans/resources/posts/labels.rb
Overview
APIs for managing your post labels
Instance Method Summary collapse
-
#create(account, name:, request_options: {}) ⇒ Onlyfans::Models::Posts::LabelCreateResponse
Create a new post label.
-
#initialize(client:) ⇒ Labels
constructor
private
A new instance of Labels.
-
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::Posts::LabelListResponse
List the labels that you can use to organize your posts.
Constructor Details
#initialize(client:) ⇒ Labels
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 Labels.
62 63 64 |
# File 'lib/onlyfans/resources/posts/labels.rb', line 62 def initialize(client:) @client = client end |
Instance Method Details
#create(account, name:, request_options: {}) ⇒ Onlyfans::Models::Posts::LabelCreateResponse
Create a new post label.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/onlyfans/resources/posts/labels.rb', line 21 def create(account, params) parsed, = Onlyfans::Posts::LabelCreateParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/posts/labels", account], body: parsed, model: Onlyfans::Models::Posts::LabelCreateResponse, options: ) end |
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::Posts::LabelListResponse
List the labels that you can use to organize your posts.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/onlyfans/resources/posts/labels.rb', line 47 def list(account, params = {}) parsed, = Onlyfans::Posts::LabelListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/posts/labels", account], query: query, model: Onlyfans::Models::Posts::LabelListResponse, options: ) end |