Class: Ari::Recording

Inherits:
Resource show all
Defined in:
lib/ari/resources/recording.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#add_listener, client, #client, #remove_all_listeners!, #remove_listener

Methods inherited from Model

#attributes=, #initialize

Constructor Details

This class inherits a constructor from Ari::Model

Class Method Details

.cancel(options = {}) ⇒ Object

DELETE /recordings/live/%recordingName

A recording that is in progress

Parameters:

recordingName (required) - The name of the recording



124
125
126
127
128
129
130
# File 'lib/ari/resources/recording.rb', line 124

def self.cancel(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

.copy_stored(options = {}) ⇒ Object

POST /recordings/stored/%recordingName/copy

Copy an individual recording

Parameters:

recordingName (required) - The name of the recording to copy destinationRecordingName (required) - The destination name of the recording

Raises:

  • (ArgumentError)


81
82
83
84
85
86
87
# File 'lib/ari/resources/recording.rb', line 81

def self.copy_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  raise ArgumentError.new("Parameter destinationRecordingName must be passed in options hash.") unless options[:destinationRecordingName]
  path = '/recordings/stored/%{recordingName}/copy' % options
  response = client(options).post(path, options)
  StoredRecording.new(response.merge(client: options[:client]))
end

.copyStoredObject

POST /recordings/stored/%recordingName/copy

Copy an individual recording

Parameters:

recordingName (required) - The name of the recording to copy destinationRecordingName (required) - The destination name of the recording

Raises:

  • (ArgumentError)


88
89
90
91
92
93
94
# File 'lib/ari/resources/recording.rb', line 88

def self.copy_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  raise ArgumentError.new("Parameter destinationRecordingName must be passed in options hash.") unless options[:destinationRecordingName]
  path = '/recordings/stored/%{recordingName}/copy' % options
  response = client(options).post(path, options)
  StoredRecording.new(response.merge(client: options[:client]))
end

.delete_stored(options = {}) ⇒ Object

DELETE /recordings/stored/%recordingName

Individual recording

Parameters:

recordingName (required) - The name of the recording



58
59
60
61
62
63
64
# File 'lib/ari/resources/recording.rb', line 58

def self.delete_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/stored/%{recordingName}' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

.deleteStoredObject

DELETE /recordings/stored/%recordingName

Individual recording

Parameters:

recordingName (required) - The name of the recording



65
66
67
68
69
70
71
# File 'lib/ari/resources/recording.rb', line 65

def self.delete_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/stored/%{recordingName}' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

.get_live(options = {}) ⇒ Object

GET /recordings/live/%recordingName

A recording that is in progress

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


103
104
105
106
107
108
# File 'lib/ari/resources/recording.rb', line 103

def self.get_live(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}' % options
  response = client(options).get(path, options)
  LiveRecording.new(response.merge(client: options[:client]))
end

.get_stored(options = {}) ⇒ Object

GET /recordings/stored/%recordingName

Individual recording

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


37
38
39
40
41
42
# File 'lib/ari/resources/recording.rb', line 37

def self.get_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/stored/%{recordingName}' % options
  response = client(options).get(path, options)
  StoredRecording.new(response.merge(client: options[:client]))
end

.getLiveObject

GET /recordings/live/%recordingName

A recording that is in progress

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


109
110
111
112
113
114
# File 'lib/ari/resources/recording.rb', line 109

def self.get_live(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}' % options
  response = client(options).get(path, options)
  LiveRecording.new(response.merge(client: options[:client]))
end

.getStoredObject

GET /recordings/stored/%recordingName

Individual recording

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


43
44
45
46
47
48
# File 'lib/ari/resources/recording.rb', line 43

def self.get_stored(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/stored/%{recordingName}' % options
  response = client(options).get(path, options)
  StoredRecording.new(response.merge(client: options[:client]))
end

.list_stored(options = {}) ⇒ Object Also known as: listStored

GET /recordings/stored

Recordings



21
22
23
24
25
# File 'lib/ari/resources/recording.rb', line 21

def self.list_stored(options = {})
  path = '/recordings/stored'
  response = client(options).get(path, options)
  response.map { |hash| StoredRecording.new(hash.merge(client: options[:client])) }
end

.mute(options = {}) ⇒ Object

POST /recordings/live/%recordingName/mute

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


204
205
206
207
208
# File 'lib/ari/resources/recording.rb', line 204

def self.mute(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}/mute' % options
  response = client(options).post(path, options)
end

.pause(options = {}) ⇒ Object

POST /recordings/live/%recordingName/pause

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


164
165
166
167
168
# File 'lib/ari/resources/recording.rb', line 164

def self.pause(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}/pause' % options
  response = client(options).post(path, options)
end

.stop(options = {}) ⇒ Object

POST /recordings/live/%recordingName/stop

Parameters:

recordingName (required) - The name of the recording

Raises:

  • (ArgumentError)


145
146
147
148
149
# File 'lib/ari/resources/recording.rb', line 145

def self.stop(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}/stop' % options
  response = client(options).post(path, options)
end

.unmute(options = {}) ⇒ Object

DELETE /recordings/live/%recordingName/mute

Parameters:

recordingName (required) - The name of the recording



223
224
225
226
227
228
229
# File 'lib/ari/resources/recording.rb', line 223

def self.unmute(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}/mute' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

.unpause(options = {}) ⇒ Object

DELETE /recordings/live/%recordingName/pause

Parameters:

recordingName (required) - The name of the recording



183
184
185
186
187
188
189
# File 'lib/ari/resources/recording.rb', line 183

def self.unpause(options = {})
  raise ArgumentError.new("Parameter recordingName must be passed in options hash.") unless options[:recordingName]
  path = '/recordings/live/%{recordingName}/pause' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

Instance Method Details

#cancel(options = {}) ⇒ Object



132
133
134
# File 'lib/ari/resources/recording.rb', line 132

def cancel(options = {})
  self.class.cancel(options.merge(recordingId: self.id, client: @client))
end

#copy_stored(options = {}) ⇒ Object



90
91
92
# File 'lib/ari/resources/recording.rb', line 90

def copy_stored(options = {})
  self.class.copy_stored(options.merge(recordingId: self.id, client: @client))
end

#delete_stored(options = {}) ⇒ Object



67
68
69
# File 'lib/ari/resources/recording.rb', line 67

def delete_stored(options = {})
  self.class.delete_stored(options.merge(recordingId: self.id, client: @client))
end

#get_live(options = {}) ⇒ Object



111
112
113
# File 'lib/ari/resources/recording.rb', line 111

def get_live(options = {})
  self.class.get_live(options.merge(recordingId: self.id, client: @client))
end

#get_stored(options = {}) ⇒ Object



45
46
47
# File 'lib/ari/resources/recording.rb', line 45

def get_stored(options = {})
  self.class.get_stored(options.merge(recordingId: self.id, client: @client))
end

#mute(options = {}) ⇒ Object



210
211
212
# File 'lib/ari/resources/recording.rb', line 210

def mute(options = {})
  self.class.mute(options.merge(recordingId: self.id, client: @client))
end

#pause(options = {}) ⇒ Object



170
171
172
# File 'lib/ari/resources/recording.rb', line 170

def pause(options = {})
  self.class.pause(options.merge(recordingId: self.id, client: @client))
end

#stop(options = {}) ⇒ Object



151
152
153
# File 'lib/ari/resources/recording.rb', line 151

def stop(options = {})
  self.class.stop(options.merge(recordingId: self.id, client: @client))
end

#unmute(options = {}) ⇒ Object



231
232
233
# File 'lib/ari/resources/recording.rb', line 231

def unmute(options = {})
  self.class.unmute(options.merge(recordingId: self.id, client: @client))
end

#unpause(options = {}) ⇒ Object



191
192
193
# File 'lib/ari/resources/recording.rb', line 191

def unpause(options = {})
  self.class.unpause(options.merge(recordingId: self.id, client: @client))
end