Class: Onlyfans::Resources::Stories::Highlights
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Stories::Highlights
- Defined in:
- lib/onlyfans/resources/stories/highlights.rb
Overview
APIs for managing OnlyFans story highlights
Instance Method Summary collapse
-
#add_story(path_story_id, account:, highlight_id:, body_story_id:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightAddStoryResponse
Add a specific story to a story highlight.
-
#create(account, cover_story_id:, story_ids:, title:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightCreateResponse
Create a new story highlight.
-
#delete(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightDeleteResponse
Delete a specific story highlight by its ID.
-
#initialize(client:) ⇒ Highlights
constructor
private
A new instance of Highlights.
-
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightListResponse
Retrieve a list of your story highlights.
-
#remove_story(story_id, account:, highlight_id:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRemoveStoryResponse
Remove a specific story from a story highlight.
-
#retrieve(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRetrieveResponse
Retrieve details of a specific story highlight by its ID.
-
#update(highlight_id, account:, cover_story_id:, story_ids:, title:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightUpdateResponse
Some parameter documentations has been truncated, see Models::Stories::HighlightUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Highlights
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 Highlights.
226 227 228 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 226 def initialize(client:) @client = client end |
Instance Method Details
#add_story(path_story_id, account:, highlight_id:, body_story_id:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightAddStoryResponse
Add a specific story to a story highlight.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 171 def add_story(path_story_id, params) parsed, = Onlyfans::Stories::HighlightAddStoryParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end highlight_id = parsed.delete(:highlight_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["api/%1$s/stories/highlights/%2$s/%3$s", account, highlight_id, path_story_id], body: parsed, model: Onlyfans::Models::Stories::HighlightAddStoryResponse, options: ) end |
#create(account, cover_story_id:, story_ids:, title:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightCreateResponse
Create a new story highlight.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 25 def create(account, params) parsed, = Onlyfans::Stories::HighlightCreateParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/stories/highlights", account], body: parsed, model: Onlyfans::Models::Stories::HighlightCreateResponse, options: ) end |
#delete(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightDeleteResponse
Delete a specific story highlight by its ID.
140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 140 def delete(highlight_id, params) parsed, = Onlyfans::Stories::HighlightDeleteParams.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/highlights/%2$s", account, highlight_id], model: Onlyfans::Models::Stories::HighlightDeleteResponse, options: ) end |
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightListResponse
Retrieve a list of your story highlights.
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 115 def list(account, params = {}) parsed, = Onlyfans::Stories::HighlightListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/stories/highlights", account], query: query, model: Onlyfans::Models::Stories::HighlightListResponse, options: ) end |
#remove_story(story_id, account:, highlight_id:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRemoveStoryResponse
Remove a specific story from a story highlight.
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 205 def remove_story(story_id, params) parsed, = Onlyfans::Stories::HighlightRemoveStoryParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end highlight_id = parsed.delete(:highlight_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/%1$s/stories/highlights/%2$s/%3$s", account, highlight_id, story_id], model: Onlyfans::Models::Stories::HighlightRemoveStoryResponse, options: ) end |
#retrieve(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRetrieveResponse
Retrieve details of a specific story highlight by its ID.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 49 def retrieve(highlight_id, params) parsed, = Onlyfans::Stories::HighlightRetrieveParams.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/highlights/%2$s", account, highlight_id], model: Onlyfans::Models::Stories::HighlightRetrieveResponse, options: ) end |
#update(highlight_id, account:, cover_story_id:, story_ids:, title:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightUpdateResponse
Some parameter documentations has been truncated, see Models::Stories::HighlightUpdateParams for more details.
Update the details of a specific story highlight by its ID.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/onlyfans/resources/stories/highlights.rb', line 85 def update(highlight_id, params) parsed, = Onlyfans::Stories::HighlightUpdateParams.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/stories/highlights/%2$s", account, highlight_id], body: parsed, model: Onlyfans::Models::Stories::HighlightUpdateResponse, options: ) end |