Module: Camper::Client::RecordingsAPI
- Included in:
- Camper::Client
- Defined in:
- lib/camper/api/recordings.rb
Overview
Defines methods related to recordings.
Instance Method Summary collapse
-
#archive_recording(recording) ⇒ Object
Archive a given recording.
-
#recordings(type, options = {}) ⇒ PaginatedResponse<Resource>
Get a paginated response of recordings of a given type.
-
#trash_recording(recording) ⇒ Object
Trash a given recording.
-
#unarchive_recording(recording) ⇒ Object
Unarchive a given recording.
Instance Method Details
#archive_recording(recording) ⇒ Object
Archive a given recording
60 61 62 63 64 |
# File 'lib/camper/api/recordings.rb', line 60 def archive_recording(recording) raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type) put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/archived") end |
#recordings(type, options = {}) ⇒ PaginatedResponse<Resource>
Get a paginated response of recordings of a given type
26 27 28 29 30 |
# File 'lib/camper/api/recordings.rb', line 26 def recordings(type, = {}) raise Error::InvalidParameter, type unless RecordingTypes.all.include?(type) get('/projects/recordings', query: .merge(type: type)) end |
#trash_recording(recording) ⇒ Object
Trash a given recording
43 44 45 46 47 |
# File 'lib/camper/api/recordings.rb', line 43 def trash_recording(recording) raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type) put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/trashed") end |
#unarchive_recording(recording) ⇒ Object
Unarchive a given recording
77 78 79 80 81 |
# File 'lib/camper/api/recordings.rb', line 77 def unarchive_recording(recording) raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type) put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/active") end |