Class: Onlyfans::Resources::Stories::Highlights

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/stories/highlights.rb

Overview

APIs for managing OnlyFans story highlights

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

  • path_story_id (String)

    Path param: The ID of the story.

  • account (String)

    Path param: The Account ID

  • highlight_id (Integer)

    Path param: The ID of the story highlight to add the story to

  • body_story_id (Integer)

    Body param: The ID of the story to add to the highlight

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Stories::HighlightAddStoryParams.dump_request(params)
   =
    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", , highlight_id, path_story_id],
    body: parsed,
    model: Onlyfans::Models::Stories::HighlightAddStoryResponse,
    options: options
  )
end

#create(account, cover_story_id:, story_ids:, title:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightCreateResponse

Create a new story highlight.

Parameters:

  • account (String)

    The Account ID

  • cover_story_id (Integer)

    The ID of the story to use as the cover for the highlight

  • story_ids (Array<String>)

    An array of story IDs to include in the highlight

  • title (String)

    The title of the story highlight

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/onlyfans/resources/stories/highlights.rb', line 25

def create(, params)
  parsed, options = Onlyfans::Stories::HighlightCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/%1$s/stories/highlights", ],
    body: parsed,
    model: Onlyfans::Models::Stories::HighlightCreateResponse,
    options: options
  )
end

#delete(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightDeleteResponse

Delete a specific story highlight by its ID.

Parameters:

  • highlight_id (Integer)

    The ID of the story highlight to retrieve

  • account (String)

    The Account ID

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Stories::HighlightDeleteParams.dump_request(params)
   =
    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", , highlight_id],
    model: Onlyfans::Models::Stories::HighlightDeleteResponse,
    options: options
  )
end

#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightListResponse

Retrieve a list of your story highlights.

Parameters:

  • account (String)

    The Account ID

  • limit (Integer)

    Number of highlights to return (default = 5)

  • offset (Integer)

    Number of highlights to skip for pagination

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



115
116
117
118
119
120
121
122
123
124
125
# File 'lib/onlyfans/resources/stories/highlights.rb', line 115

def list(, params = {})
  parsed, options = Onlyfans::Stories::HighlightListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/stories/highlights", ],
    query: query,
    model: Onlyfans::Models::Stories::HighlightListResponse,
    options: options
  )
end

#remove_story(story_id, account:, highlight_id:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRemoveStoryResponse

Remove a specific story from a story highlight.

Parameters:

  • story_id (String)

    The ID of the story.

  • account (String)

    The Account ID

  • highlight_id (Integer)

    The ID of the story highlight to add the story to

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Stories::HighlightRemoveStoryParams.dump_request(params)
   =
    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", , highlight_id, story_id],
    model: Onlyfans::Models::Stories::HighlightRemoveStoryResponse,
    options: options
  )
end

#retrieve(highlight_id, account:, request_options: {}) ⇒ Onlyfans::Models::Stories::HighlightRetrieveResponse

Retrieve details of a specific story highlight by its ID.

Parameters:

  • highlight_id (Integer)

    The ID of the story highlight to retrieve

  • account (String)

    The Account ID

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Stories::HighlightRetrieveParams.dump_request(params)
   =
    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", , highlight_id],
    model: Onlyfans::Models::Stories::HighlightRetrieveResponse,
    options: 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.

Parameters:

  • highlight_id (Integer)

    Path param: The ID of the story highlight to retrieve

  • account (String)

    Path param: The Account ID

  • cover_story_id (Integer)

    Body param: The ID of the story to use as the cover for the highlight. Provide t

  • story_ids (Array<String>)

    Body param: An array of story IDs to include in the highlight. Provide the old v

  • title (String)

    Body param: The new title for the story highlight. Provide the old value if you

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Stories::HighlightUpdateParams.dump_request(params)
   =
    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", , highlight_id],
    body: parsed,
    model: Onlyfans::Models::Stories::HighlightUpdateResponse,
    options: options
  )
end