Class: Onlyfans::Resources::Queue

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Queue

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 Queue.

Parameters:



112
113
114
# File 'lib/onlyfans/resources/queue.rb', line 112

def initialize(client:)
  @client = client
end

Instance Method Details

#count(account, publish_date_end:, publish_date_start:, timezone:, request_options: {}) ⇒ Onlyfans::Models::QueueCountResponse

Some parameter documentations has been truncated, see Models::QueueCountParams for more details.

Count posts and messages in the queue.

Parameters:

  • account (String)

    The Account ID

  • publish_date_end (String)

    Latest publish date to count to

  • publish_date_start (String)

    Earliest publish date to count from (must be at least today)

  • timezone (String)

    Time timezone of the provided dates. [View available timezone values](ww

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

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/onlyfans/resources/queue.rb', line 63

def count(, params)
  parsed, options = Onlyfans::QueueCountParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/queue/counts", ],
    query: query.transform_keys(
      publish_date_end: "publishDateEnd",
      publish_date_start: "publishDateStart"
    ),
    model: Onlyfans::Models::QueueCountResponse,
    options: options
  )
end

#list(account, limit:, publish_date_end:, publish_date_start:, timezone:, request_options: {}) ⇒ Onlyfans::Models::QueueListResponse

Some parameter documentations has been truncated, see Models::QueueListParams for more details.

List posts and messages in the queue.

Parameters:

  • account (String)

    The Account ID

  • limit (Integer)

    Maximum number of queue items to return (default = 20)

  • publish_date_end (String)

    Latest publish date to return

  • publish_date_start (String)

    Earliest publish date to return (must be at least today)

  • timezone (String)

    Time timezone of the provided dates. [View available timezone values](ww

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/onlyfans/resources/queue.rb', line 28

def list(, params)
  parsed, options = Onlyfans::QueueListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/queue", ],
    query: query.transform_keys(
      publish_date_end: "publishDateEnd",
      publish_date_start: "publishDateStart"
    ),
    model: Onlyfans::Models::QueueListResponse,
    options: options
  )
end

#publish(queue_id, account:, request_options: {}) ⇒ Onlyfans::Models::QueuePublishResponse

Some parameter documentations has been truncated, see Models::QueuePublishParams for more details.

Publish a queue item or “saved for later” item (post or mass message). This means that the item will be sent immediately, regardless of its scheduled date.

Parameters:

  • queue_id (String)

    The ID of the message queue item. Can be retrieved from Queue or Mass Messaging

  • account (String)

    The Account ID

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

Returns:

See Also:



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/onlyfans/resources/queue.rb', line 95

def publish(queue_id, params)
  parsed, options = Onlyfans::QueuePublishParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["api/%1$s/queue/%2$s/publish", , queue_id],
    model: Onlyfans::Models::QueuePublishResponse,
    options: options
  )
end