Class: WhopSDK::Resources::Files
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Files
- Defined in:
- lib/whop_sdk/resources/files.rb
Overview
Files
Instance Method Summary collapse
-
#create(filename:, request_options: {}) ⇒ WhopSDK::Models::FileCreateResponse
Some parameter documentations has been truncated, see Models::FileCreateParams for more details.
-
#initialize(client:) ⇒ Files
constructor
private
A new instance of Files.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::FileRetrieveResponse
Retrieves the details of an existing file.
Constructor Details
#initialize(client:) ⇒ Files
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 Files.
56 57 58 |
# File 'lib/whop_sdk/resources/files.rb', line 56 def initialize(client:) @client = client end |
Instance Method Details
#create(filename:, request_options: {}) ⇒ WhopSDK::Models::FileCreateResponse
Some parameter documentations has been truncated, see Models::FileCreateParams for more details.
Create a new file record and receive a presigned URL for uploading content to S3.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/whop_sdk/resources/files.rb', line 22 def create(params) parsed, = WhopSDK::FileCreateParams.dump_request(params) @client.request( method: :post, path: "files", body: parsed, model: WhopSDK::Models::FileCreateResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::FileRetrieveResponse
Retrieves the details of an existing file.
44 45 46 47 48 49 50 51 |
# File 'lib/whop_sdk/resources/files.rb', line 44 def retrieve(id, params = {}) @client.request( method: :get, path: ["files/%1$s", id], model: WhopSDK::Models::FileRetrieveResponse, options: params[:request_options] ) end |