Class: SurgeAPI::Resources::Attachments
- Inherits:
-
Object
- Object
- SurgeAPI::Resources::Attachments
- Defined in:
- lib/surge_api/resources/attachments.rb
Instance Method Summary collapse
-
#get_file(attachment_id, request_options: {}) ⇒ SurgeAPI::Models::AttachmentGetFileResponse
Redirects to a signed URL where the attachment file can be downloaded.
-
#initialize(client:) ⇒ Attachments
constructor
private
A new instance of Attachments.
Constructor Details
#initialize(client:) ⇒ Attachments
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 Attachments.
30 31 32 |
# File 'lib/surge_api/resources/attachments.rb', line 30 def initialize(client:) @client = client end |
Instance Method Details
#get_file(attachment_id, request_options: {}) ⇒ SurgeAPI::Models::AttachmentGetFileResponse
Redirects to a signed URL where the attachment file can be downloaded. URL is short-lived, so redirect should be followed immediately.
18 19 20 21 22 23 24 25 |
# File 'lib/surge_api/resources/attachments.rb', line 18 def get_file(, params = {}) @client.request( method: :get, path: ["attachments/%1$s/file", ], model: SurgeAPI::Models::AttachmentGetFileResponse, options: params[:request_options] ) end |