Class: Onlyfans::Resources::DataExports
- Inherits:
-
Object
- Object
- Onlyfans::Resources::DataExports
- Defined in:
- lib/onlyfans/resources/data_exports.rb
Overview
APIs for managing data exports
Instance Method Summary collapse
-
#cancel(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportCancelResponse
Cancel a running data export.
-
#create(end_date:, file_type:, start_date:, type:, account_ids: nil, auto_start: nil, export_columns: nil, options: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportCreateResponse
Some parameter documentations has been truncated, see Models::DataExportCreateParams for more details.
-
#initialize(client:) ⇒ DataExports
constructor
private
A new instance of DataExports.
-
#list(download_url_expires_in: nil, page: nil, per_page: nil, status: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportListResponse
Get a paginated list of data exports for the team.
-
#retrieve(data_export_id, download_url_expires_in: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportRetrieveResponse
Some parameter documentations has been truncated, see Models::DataExportRetrieveParams for more details.
-
#retry_(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportRetryResponse
Create a new data export with the same parameters as a failed export and automatically start it.
-
#start(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportStartResponse
Start processing a data export that has completed credit calculation.
Constructor Details
#initialize(client:) ⇒ DataExports
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 DataExports.
172 173 174 |
# File 'lib/onlyfans/resources/data_exports.rb', line 172 def initialize(client:) @client = client end |
Instance Method Details
#cancel(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportCancelResponse
Cancel a running data export. Only exports with status ‘pending` or `in_progress` can be cancelled.
118 119 120 121 122 123 124 125 |
# File 'lib/onlyfans/resources/data_exports.rb', line 118 def cancel(data_export_id, params = {}) @client.request( method: :delete, path: ["api/data-exports/%1$s", data_export_id], model: Onlyfans::Models::DataExportCancelResponse, options: params[:request_options] ) end |
#create(end_date:, file_type:, start_date:, type:, account_ids: nil, auto_start: nil, export_columns: nil, options: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportCreateResponse
Some parameter documentations has been truncated, see Models::DataExportCreateParams for more details.
Create a new data export request. This will calculate the required credits and prepare the export for starting.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/onlyfans/resources/data_exports.rb', line 36 def create(params) parsed, = Onlyfans::DataExportCreateParams.dump_request(params) @client.request( method: :post, path: "api/data-exports", body: parsed, model: Onlyfans::Models::DataExportCreateResponse, options: ) end |
#list(download_url_expires_in: nil, page: nil, per_page: nil, status: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportListResponse
Get a paginated list of data exports for the team
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/onlyfans/resources/data_exports.rb', line 94 def list(params = {}) parsed, = Onlyfans::DataExportListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/data-exports", query: query, model: Onlyfans::Models::DataExportListResponse, options: ) end |
#retrieve(data_export_id, download_url_expires_in: nil, request_options: {}) ⇒ Onlyfans::Models::DataExportRetrieveResponse
Some parameter documentations has been truncated, see Models::DataExportRetrieveParams for more details.
Get the current status and progress of a data export
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/onlyfans/resources/data_exports.rb', line 63 def retrieve(data_export_id, params = {}) parsed, = Onlyfans::DataExportRetrieveParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/data-exports/%1$s", data_export_id], query: query, model: Onlyfans::Models::DataExportRetrieveResponse, options: ) end |
#retry_(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportRetryResponse
Create a new data export with the same parameters as a failed export and automatically start it.
139 140 141 142 143 144 145 146 |
# File 'lib/onlyfans/resources/data_exports.rb', line 139 def retry_(data_export_id, params = {}) @client.request( method: :post, path: ["api/data-exports/%1$s/retry", data_export_id], model: Onlyfans::Models::DataExportRetryResponse, options: params[:request_options] ) end |
#start(data_export_id, request_options: {}) ⇒ Onlyfans::Models::DataExportStartResponse
Start processing a data export that has completed credit calculation. This will begin the actual export process and charge credits.
160 161 162 163 164 165 166 167 |
# File 'lib/onlyfans/resources/data_exports.rb', line 160 def start(data_export_id, params = {}) @client.request( method: :post, path: ["api/data-exports/%1$s/start", data_export_id], model: Onlyfans::Models::DataExportStartResponse, options: params[:request_options] ) end |