Class: Onlyfans::Resources::Media::Uploads
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Media::Uploads
- Defined in:
- lib/onlyfans/resources/media/uploads.rb
Instance Method Summary collapse
-
#get_status(upload, account:, request_options: {}) ⇒ Onlyfans::Models::Media::UploadGetStatusResponse::UnionMember0, ...
Check the status of a media upload.
-
#initialize(client:) ⇒ Uploads
constructor
private
A new instance of Uploads.
Constructor Details
#initialize(client:) ⇒ Uploads
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 Uploads.
45 46 47 |
# File 'lib/onlyfans/resources/media/uploads.rb', line 45 def initialize(client:) @client = client end |
Instance Method Details
#get_status(upload, account:, request_options: {}) ⇒ Onlyfans::Models::Media::UploadGetStatusResponse::UnionMember0, ...
Check the status of a media upload. Poll this endpoint until status is ‘completed` or `failed`. This endpoint is free and does not cost any credits.
**Possible statuses:**
-
‘pending` — Upload is queued
-
‘processing` — Download/upload in progress
-
‘completed` — Upload finished, `media` and `credits_used` are included
-
‘failed` — Upload failed, `error` is included
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/onlyfans/resources/media/uploads.rb', line 28 def get_status(upload, params) parsed, = Onlyfans::Media::UploadGetStatusParams.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/media/uploads/%2$s/status", account, upload], model: Onlyfans::Models::Media::UploadGetStatusResponse, options: ) end |