Class: Onlyfans::Resources::Stories
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Stories
- Defined in:
- lib/onlyfans/resources/stories.rb,
lib/onlyfans/resources/stories/highlights.rb
Overview
APIs for managing OnlyFans stories
Defined Under Namespace
Classes: Highlights
Instance Attribute Summary collapse
-
#highlights ⇒ Onlyfans::Resources::Stories::Highlights
readonly
APIs for managing OnlyFans story highlights.
Instance Method Summary collapse
-
#create(account, media_files:, request_options: {}) ⇒ Onlyfans::Models::StoryCreateResponse
Some parameter documentations has been truncated, see Models::StoryCreateParams for more details.
-
#delete(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryDeleteResponse
Delete a specific story by its ID.
-
#initialize(client:) ⇒ Stories
constructor
private
A new instance of Stories.
-
#list_active(account, request_options: {}) ⇒ Onlyfans::Models::StoryListActiveResponse
Retrieve a list of your currently active stories.
-
#list_archive(account, limit: nil, marker: nil, request_options: {}) ⇒ Onlyfans::Models::StoryListArchiveResponse
Retrieve a list of your archived stories.
-
#list_viewers(story_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::StoryListViewersResponse
Retrieve the list of viewers for a specific story by its ID.
-
#mark_as_watched(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryMarkAsWatchedResponse
Mark a specific story as watched by its ID.
-
#retrieve(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryRetrieveResponse
Retrieve details of a specific story by its ID.
-
#retrieve_stats(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryRetrieveStatsResponse
Retrieve viewer count, likes count, comments count, and tips statistics for a specific story by its ID.
Constructor Details
#initialize(client:) ⇒ Stories
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 Stories.
230 231 232 233 |
# File 'lib/onlyfans/resources/stories.rb', line 230 def initialize(client:) @client = client @highlights = Onlyfans::Resources::Stories::Highlights.new(client: client) end |
Instance Attribute Details
#highlights ⇒ Onlyfans::Resources::Stories::Highlights (readonly)
APIs for managing OnlyFans story highlights
9 10 11 |
# File 'lib/onlyfans/resources/stories.rb', line 9 def highlights @highlights end |
Instance Method Details
#create(account, media_files:, request_options: {}) ⇒ Onlyfans::Models::StoryCreateResponse
Some parameter documentations has been truncated, see Models::StoryCreateParams for more details.
Post a new media or vault file to your story.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/onlyfans/resources/stories.rb', line 27 def create(account, params) parsed, = Onlyfans::StoryCreateParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/stories", account], body: parsed, model: Onlyfans::Models::StoryCreateResponse, options: ) end |
#delete(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryDeleteResponse
Delete a specific story by its ID.
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/onlyfans/resources/stories.rb', line 78 def delete(story_id, params) parsed, = Onlyfans::StoryDeleteParams.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/stories/%2$s", account, story_id], model: Onlyfans::Models::StoryDeleteResponse, options: ) end |
#list_active(account, request_options: {}) ⇒ Onlyfans::Models::StoryListActiveResponse
Retrieve a list of your currently active stories.
103 104 105 106 107 108 109 110 |
# File 'lib/onlyfans/resources/stories.rb', line 103 def list_active(account, params = {}) @client.request( method: :get, path: ["api/%1$s/stories", account], model: Onlyfans::Models::StoryListActiveResponse, options: params[:request_options] ) end |
#list_archive(account, limit: nil, marker: nil, request_options: {}) ⇒ Onlyfans::Models::StoryListArchiveResponse
Retrieve a list of your archived stories.
127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/onlyfans/resources/stories.rb', line 127 def list_archive(account, params = {}) parsed, = Onlyfans::StoryListArchiveParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/stories/archive", account], query: query, model: Onlyfans::Models::StoryListArchiveResponse, options: ) end |
#list_viewers(story_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::StoryListViewersResponse
Retrieve the list of viewers for a specific story by its ID.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/onlyfans/resources/stories.rb', line 156 def list_viewers(story_id, params) parsed, = Onlyfans::StoryListViewersParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/stories/%2$s/viewers", account, story_id], query: query, model: Onlyfans::Models::StoryListViewersResponse, options: ) end |
#mark_as_watched(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryMarkAsWatchedResponse
Mark a specific story as watched by its ID.
185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/onlyfans/resources/stories.rb', line 185 def mark_as_watched(story_id, params) parsed, = Onlyfans::StoryMarkAsWatchedParams.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/stories/%2$s/mark-as-watched", account, story_id], model: Onlyfans::Models::StoryMarkAsWatchedResponse, options: ) end |
#retrieve(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryRetrieveResponse
Retrieve details of a specific story by its ID.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/onlyfans/resources/stories.rb', line 51 def retrieve(story_id, params) parsed, = Onlyfans::StoryRetrieveParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/stories/%2$s", account, story_id], model: Onlyfans::Models::StoryRetrieveResponse, options: ) end |
#retrieve_stats(story_id, account:, request_options: {}) ⇒ Onlyfans::Models::StoryRetrieveStatsResponse
Retrieve viewer count, likes count, comments count, and tips statistics for a specific story by its ID.
213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/onlyfans/resources/stories.rb', line 213 def retrieve_stats(story_id, params) parsed, = Onlyfans::StoryRetrieveStatsParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/stories/%2$s/stats", account, story_id], model: Onlyfans::Models::StoryRetrieveStatsResponse, options: ) end |