Class: SurgeAPI::Resources::Recordings
- Inherits:
-
Object
- Object
- SurgeAPI::Resources::Recordings
- Defined in:
- lib/surge_api/resources/recordings.rb
Instance Method Summary collapse
-
#delete(id, request_options: {}) ⇒ SurgeAPI::Models::RecordingDeleteResponse
Deletes a recording.
-
#get_file(recording_id, request_options: {}) ⇒ SurgeAPI::Models::RecordingGetFileResponse
Redirects to a signed URL where the recording audio file can be downloaded.
-
#initialize(client:) ⇒ Recordings
constructor
private
A new instance of Recordings.
-
#list(account_id, after: nil, before: nil, request_options: {}) ⇒ SurgeAPI::Internal::Cursor<SurgeAPI::Models::RecordingListResponse>
Some parameter documentations has been truncated, see Models::RecordingListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ SurgeAPI::Models::RecordingRetrieveResponse
Retrieves a Recording object.
Constructor Details
#initialize(client:) ⇒ Recordings
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 Recordings.
102 103 104 |
# File 'lib/surge_api/resources/recordings.rb', line 102 def initialize(client:) @client = client end |
Instance Method Details
#delete(id, request_options: {}) ⇒ SurgeAPI::Models::RecordingDeleteResponse
Deletes a recording. The recording file will be removed from storage asynchronously.
69 70 71 72 73 74 75 76 |
# File 'lib/surge_api/resources/recordings.rb', line 69 def delete(id, params = {}) @client.request( method: :delete, path: ["recordings/%1$s", id], model: SurgeAPI::Models::RecordingDeleteResponse, options: params[:request_options] ) end |
#get_file(recording_id, request_options: {}) ⇒ SurgeAPI::Models::RecordingGetFileResponse
Redirects to a signed URL where the recording audio file can be downloaded. URL is short-lived, so redirect should be followed immediately.
90 91 92 93 94 95 96 97 |
# File 'lib/surge_api/resources/recordings.rb', line 90 def get_file(recording_id, params = {}) @client.request( method: :get, path: ["recordings/%1$s/file", recording_id], model: SurgeAPI::Models::RecordingGetFileResponse, options: params[:request_options] ) end |
#list(account_id, after: nil, before: nil, request_options: {}) ⇒ SurgeAPI::Internal::Cursor<SurgeAPI::Models::RecordingListResponse>
Some parameter documentations has been truncated, see Models::RecordingListParams for more details.
List all recordings for an account with cursor-based pagination.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/surge_api/resources/recordings.rb', line 44 def list(account_id, params = {}) parsed, = SurgeAPI::RecordingListParams.dump_request(params) query = SurgeAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["accounts/%1$s/recordings", account_id], query: query, page: SurgeAPI::Internal::Cursor, model: SurgeAPI::Models::RecordingListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ SurgeAPI::Models::RecordingRetrieveResponse
Retrieves a Recording object.
17 18 19 20 21 22 23 24 |
# File 'lib/surge_api/resources/recordings.rb', line 17 def retrieve(id, params = {}) @client.request( method: :get, path: ["recordings/%1$s", id], model: SurgeAPI::Models::RecordingRetrieveResponse, options: params[:request_options] ) end |